[coreboot] r3767 - trunk/util/msrtool

svn at coreboot.org svn at coreboot.org
Sat Nov 22 19:29:44 CET 2008


Author: stuge
Date: 2008-11-22 19:29:44 +0100 (Sat, 22 Nov 2008)
New Revision: 3767

Modified:
   trunk/util/msrtool/msrutils.c
Log:
msrtool: Very small fixes I made after sending out the rc1 tarball.

Signed-off-by: Peter Stuge <peter at stuge.se>
Acked-by: Peter Stuge <peter at stuge.se>


Modified: trunk/util/msrtool/msrutils.c
===================================================================
--- trunk/util/msrtool/msrutils.c	2008-11-22 17:13:36 UTC (rev 3766)
+++ trunk/util/msrtool/msrutils.c	2008-11-22 18:29:44 UTC (rev 3767)
@@ -25,7 +25,7 @@
 
 static void print_bitdef(FILE *f, const struct msrbits *mb, const char *tail) {
 	uint8_t endbit;
-	if (!reserved && !strcmp(mb->name, "RSVD"))
+	if (!reserved && 0 == strcmp(mb->name, "RSVD"))
 		return;
 	if (1 == mb->size)
 		fprintf(f, "# %5d", mb->start);
@@ -33,7 +33,7 @@
 		endbit = mb->start - mb->size + 1;
 		fprintf(f, "# %*d:%d", endbit < 10 ? 3 : 2, mb->start, endbit);
 	}
-	if (!strcmp(mb->name, "RSVD"))
+	if (0 == strcmp(mb->name, "RSVD"))
 		fprintf(f, " [%s]", mb->desc);
 	else
 		fprintf(f, " %s %s", mb->name, mb->desc);
@@ -55,7 +55,6 @@
 			fprintf(f, "%d", (tmp.hi || tmp.lo) ? 1 : 0);
 			mask = msr_shr(mask, 1);
 		}
-		/* TODO */
 		break;
 	case PRESENT_DEC:
 		fprintf(f, "%d", val.lo);
@@ -141,7 +140,7 @@
 void dumpmsrdefs(const struct targetdef *t) {
 	const struct msrdef *m;
 	const struct msrbits *mb;
-	if (!t)
+	if (NULL == t)
 		return;
 	printf("# %s MSRs:\n", t->name);
 	for (m = t->msrs; !MSR_ISEOT(*m); m++) {
@@ -158,7 +157,7 @@
 	struct msr val = MSR1(0);
 	const struct msrdef *m;
 	const struct msrbits *mb;
-	if (!t)
+	if (NULL == t)
 		return 1;
 	fprintf(f, "# %s MSRs:\n", t->name);
 	for (m = t->msrs; !MSR_ISEOT(*m); m++) {
@@ -225,10 +224,10 @@
 	const struct msrdef *m = findmsrdef(addr);
 	const struct msrbits *mb;
 
-	if (m)
+	if (NULL != m)
 		printf("# %s ", m->symbol);
 	printf("0x%08x = 0x%08x%08x\n", addr, val.hi, val.lo);
-	if (!m) {
+	if (NULL == m) {
 		fprintf(stderr, "Sorry - no definition exists for this MSR! Please add it and send a signed-off\n");
 		fprintf(stderr, "patch to coreboot at coreboot.org. Thanks for your help!\n");
 		return;
@@ -266,7 +265,7 @@
 	if (a.hi == b.hi && a.lo == b.lo)
 		return 0;
 
-	if (!m) {
+	if (NULL == m) {
 		fprintf(stderr, "MSR 0x%08x has no definition! Please add it and send a Signed-off-by patch\n", addr);
 		fprintf(stderr, "to coreboot at coreboot.org. Thank you for your help!\n");
 		return 1;





More information about the coreboot mailing list