Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 2 Jun 2011 00:43:16 +0000 (UTC)
From:      Ed Maste <emaste@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r222589 - in head: sys/dev/mfi usr.sbin/mfiutil
Message-ID:  <201106020043.p520hGZQ093560@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: emaste
Date: Thu Jun  2 00:43:16 2011
New Revision: 222589
URL: http://svn.freebsd.org/changeset/base/222589

Log:
  There are a couple of structs in mfireg.h with members named 'class'.
  These cause problems when trying to include the header in a C++ project.
  Rename them to 'evt_class', and track the change in mfi and mfiutil.
  
  Submitted by:	Mark Johnston
  Sponsored by:	Sandvine Incorporated
  Reviewed by:	jhb@
  MFC after:	1 week

Modified:
  head/sys/dev/mfi/mfi.c
  head/sys/dev/mfi/mfireg.h
  head/usr.sbin/mfiutil/mfi_evt.c

Modified: head/sys/dev/mfi/mfi.c
==============================================================================
--- head/sys/dev/mfi/mfi.c	Thu Jun  2 00:34:57 2011	(r222588)
+++ head/sys/dev/mfi/mfi.c	Thu Jun  2 00:43:16 2011	(r222589)
@@ -788,7 +788,7 @@ mfi_aen_setup(struct mfi_softc *sc, uint
 
 	class_locale.members.reserved = 0;
 	class_locale.members.locale = mfi_event_locale;
-	class_locale.members.class  = mfi_event_class;
+	class_locale.members.evt_class  = mfi_event_class;
 
 	if (seq_start == 0) {
 		error = mfi_get_log_state(sc, &log_state);
@@ -1082,8 +1082,8 @@ mfi_decode_evt(struct mfi_softc *sc, str
 {
 
 	device_printf(sc->mfi_dev, "%d (%s/0x%04x/%s) - %s\n", detail->seq,
-	    format_timestamp(detail->time), detail->class.members.locale,
-	    format_class(detail->class.members.class), detail->description);
+	    format_timestamp(detail->time), detail->evt_class.members.locale,
+	    format_class(detail->evt_class.members.evt_class), detail->description);
 }
 
 static int
@@ -1099,16 +1099,16 @@ mfi_aen_register(struct mfi_softc *sc, i
 	if (sc->mfi_aen_cm != NULL) {
 		prior_aen.word =
 		    ((uint32_t *)&sc->mfi_aen_cm->cm_frame->dcmd.mbox)[1];
-		if (prior_aen.members.class <= current_aen.members.class &&
+		if (prior_aen.members.evt_class <= current_aen.members.evt_class &&
 		    !((prior_aen.members.locale & current_aen.members.locale)
 		    ^current_aen.members.locale)) {
 			return (0);
 		} else {
 			prior_aen.members.locale |= current_aen.members.locale;
-			if (prior_aen.members.class
-			    < current_aen.members.class)
-				current_aen.members.class =
-				    prior_aen.members.class;
+			if (prior_aen.members.evt_class
+			    < current_aen.members.evt_class)
+				current_aen.members.evt_class =
+				    prior_aen.members.evt_class;
 			mfi_abort(sc, sc->mfi_aen_cm);
 		}
 	}
@@ -1199,7 +1199,7 @@ mfi_parse_entries(struct mfi_softc *sc, 
 
 	class_locale.members.reserved = 0;
 	class_locale.members.locale = mfi_event_locale;
-	class_locale.members.class  = mfi_event_class;
+	class_locale.members.evt_class  = mfi_event_class;
 
 	size = sizeof(struct mfi_evt_list) + sizeof(struct mfi_evt_detail)
 		* (MAX_EVENTS - 1);

Modified: head/sys/dev/mfi/mfireg.h
==============================================================================
--- head/sys/dev/mfi/mfireg.h	Thu Jun  2 00:34:57 2011	(r222588)
+++ head/sys/dev/mfi/mfireg.h	Thu Jun  2 00:43:16 2011	(r222589)
@@ -719,7 +719,7 @@ union mfi_evt {
 	struct {
 		uint16_t	locale;
 		uint8_t		reserved;
-		int8_t		class;
+		int8_t		evt_class;
 	} members;
 	uint32_t		word;
 } __packed;
@@ -755,7 +755,7 @@ struct mfi_evt_detail {
 	uint32_t		seq;
 	uint32_t		time;
 	uint32_t		code;
-	union mfi_evt		class;
+	union mfi_evt		evt_class;
 	uint8_t			arg_type;
 	uint8_t			reserved1[15];
 

Modified: head/usr.sbin/mfiutil/mfi_evt.c
==============================================================================
--- head/usr.sbin/mfiutil/mfi_evt.c	Thu Jun  2 00:34:57 2011	(r222588)
+++ head/usr.sbin/mfiutil/mfi_evt.c	Thu Jun  2 00:43:16 2011	(r222589)
@@ -362,8 +362,8 @@ mfi_decode_evt(int fd, struct mfi_evt_de
 {
 
 	printf("%5d (%s/%s/%s) - ", detail->seq, format_timestamp(detail->time),
-	    format_locale(detail->class.members.locale),
-	    format_class(detail->class.members.class));
+	    format_locale(detail->evt_class.members.locale),
+	    format_class(detail->evt_class.members.evt_class));
 	switch (detail->arg_type) {
 	case MR_EVT_ARGS_NONE:
 		break;
@@ -557,7 +557,7 @@ show_events(int ac, char **av)
 	num_events = 15;
 	filter.members.reserved = 0;
 	filter.members.locale = MFI_EVT_LOCALE_ALL;
-	filter.members.class = MFI_EVT_CLASS_WARNING;
+	filter.members.evt_class = MFI_EVT_CLASS_WARNING;
 	start = info.boot_seq_num;
 	stop = info.newest_seq_num;
 	verbose = 0;
@@ -567,7 +567,7 @@ show_events(int ac, char **av)
 	while ((ch = getopt(ac, av, "c:l:n:v")) != -1) {
 		switch (ch) {
 		case 'c':
-			if (parse_class(optarg, &filter.members.class) < 0) {
+			if (parse_class(optarg, &filter.members.evt_class) < 0) {
 				error = errno;
 				warn("Error parsing event class");
 				return (error);



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201106020043.p520hGZQ093560>