public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 2.4.6-ac2] dmi_scan.c cleanups.
@ 2001-07-09 10:08 Stelian Pop
  2001-07-09 11:16 ` Robert J.Dunlop
  2001-07-10  6:33 ` Juan Quintela
  0 siblings, 2 replies; 3+ messages in thread
From: Stelian Pop @ 2001-07-09 10:08 UTC (permalink / raw)
  To: Linux Kernel Mailing List; +Cc: Alan Cox

This patch cleans up the printk code in dmi_scan.c (the previous
code gave compile warnings on enabling the printk).

Stelian.

diff -uNr --exclude-from=dontdiff linux-2.4.6-ac2.orig/arch/i386/kernel/dmi_scan.c linux-2.4.6-ac2/arch/i386/kernel/dmi_scan.c
--- linux-2.4.6-ac2.orig/arch/i386/kernel/dmi_scan.c	Mon Jul  9 10:25:52 2001
+++ linux-2.4.6-ac2/arch/i386/kernel/dmi_scan.c	Mon Jul  9 11:03:29 2001
@@ -14,8 +14,8 @@
 	u16	handle;
 };
 
-#define dmi_printk(x)
-//#define dmi_printk(x) printk(x)
+#define dmi_printk while(0) printk
+//#define dmi_printk printk
 
 static char * __init dmi_string(struct dmi_header *dm, u8 s)
 {
@@ -78,13 +78,13 @@
 			u16 len=buf[7]<<8|buf[6];
 			u32 base=buf[11]<<24|buf[10]<<16|buf[9]<<8|buf[8];
 
-			dmi_printk((KERN_INFO "DMI %d.%d present.\n",
-				buf[14]>>4, buf[14]&0x0F));
-			dmi_printk((KERN_INFO "%d structures occupying %d bytes.\n",
+			dmi_printk(KERN_INFO "DMI %d.%d present.\n",
+				buf[14]>>4, buf[14]&0x0F);
+			dmi_printk(KERN_INFO "%d structures occupying %d bytes.\n",
 				buf[13]<<8|buf[12],
-				buf[7]<<8|buf[6]));
-			dmi_printk((KERN_INFO "DMI table at 0x%08X.\n",
-				buf[11]<<24|buf[10]<<16|buf[9]<<8|buf[8]));
+				buf[7]<<8|buf[6]);
+			dmi_printk(KERN_INFO "DMI table at 0x%08X.\n",
+				buf[11]<<24|buf[10]<<16|buf[9]<<8|buf[8]);
 			if(dmi_table(base,len, num, decode)==0)
 				return 0;
 		}
@@ -355,13 +355,13 @@
 			p=dmi_string(dm,data[4]);
 			if(*p)
 			{
-				dmi_printk(("BIOS Vendor: %s\n", p));
+				dmi_printk("BIOS Vendor: %s\n", p);
 				dmi_save_ident(dm, DMI_BIOS_VENDOR, 4);
-				dmi_printk(("BIOS Version: %s\n", 
-					dmi_string(dm, data[5])));
+				dmi_printk("BIOS Version: %s\n", 
+					dmi_string(dm, data[5]));
 				dmi_save_ident(dm, DMI_BIOS_VERSION, 5);
-				dmi_printk(("BIOS Release: %s\n",
-					dmi_string(dm, data[8])));
+				dmi_printk("BIOS Release: %s\n",
+					dmi_string(dm, data[8]));
 				dmi_save_ident(dm, DMI_BIOS_DATE, 8);
 			}
 			break;
@@ -370,36 +370,36 @@
 			p=dmi_string(dm,data[4]);
 			if(*p)
 			{
-				dmi_printk(("System Vendor: %s.\n",p));
+				dmi_printk("System Vendor: %s.\n",p);
 				dmi_save_ident(dm, DMI_SYS_VENDOR, 4);
-				dmi_printk(("Product Name: %s.\n",
-					dmi_string(dm, data[5])));
+				dmi_printk("Product Name: %s.\n",
+					dmi_string(dm, data[5]));
 				dmi_save_ident(dm, DMI_PRODUCT_NAME, 5);
-				dmi_printk(("Version %s.\n",
-					dmi_string(dm, data[6])));
+				dmi_printk("Version %s.\n",
+					dmi_string(dm, data[6]));
 				dmi_save_ident(dm, DMI_PRODUCT_VERSION, 6);
-				dmi_printk(("Serial Number %s.\n",
-					dmi_string(dm, data[7])));
+				dmi_printk("Serial Number %s.\n",
+					dmi_string(dm, data[7]));
 			}
 			break;
 		case 2:
 			p=dmi_string(dm,data[4]);
 			if(*p)
 			{
-				dmi_printk(("Board Vendor: %s.\n",p));
+				dmi_printk("Board Vendor: %s.\n",p);
 				dmi_save_ident(dm, DMI_BOARD_VENDOR, 4);
-				dmi_printk(("Board Name: %s.\n",
-					dmi_string(dm, data[5])));
+				dmi_printk("Board Name: %s.\n",
+					dmi_string(dm, data[5]));
 				dmi_save_ident(dm, DMI_BOARD_NAME, 5);
-				dmi_printk(("Board Version: %s.\n",
-					dmi_string(dm, data[6])));
+				dmi_printk("Board Version: %s.\n",
+					dmi_string(dm, data[6]));
 				dmi_save_ident(dm, DMI_BOARD_VERSION, 6);
 			}
 			break;
 		case 3:
 			p=dmi_string(dm,data[8]);
 			if(*p && *p!=' ')
-				dmi_printk(("Asset Tag: %s.\n", p));
+				dmi_printk("Asset Tag: %s.\n", p);
 			break;
 	}
 }
-- 
Stelian Pop <stelian.pop@fr.alcove.com>
|---------------- Free Software Engineer -----------------|
| Alcôve - http://www.alcove.com - Tel: +33 1 49 22 68 00 |
|------------- Alcôve, liberating software ---------------|

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH 2.4.6-ac2] dmi_scan.c cleanups.
  2001-07-09 10:08 [PATCH 2.4.6-ac2] dmi_scan.c cleanups Stelian Pop
@ 2001-07-09 11:16 ` Robert J.Dunlop
  2001-07-10  6:33 ` Juan Quintela
  1 sibling, 0 replies; 3+ messages in thread
From: Robert J.Dunlop @ 2001-07-09 11:16 UTC (permalink / raw)
  To: Stelian Pop; +Cc: Linux Kernel Mailing List, Alan Cox

On Mon, Jul 09, 2001 at 11:27:12AM +0100, Stelian Pop wrote:
> This patch cleans up the printk code in dmi_scan.c (the previous
> code gave compile warnings on enabling the printk).

A much smaller (but not necessarily better) patch would simply be:


--- arch/i386/kernel/dmi_scan.c.orig	Mon Jul  9 11:41:21 2001
+++ arch/i386/kernel/dmi_scan.c	Mon Jul  9 11:57:43 2001
@@ -15,7 +15,7 @@
 };
 
 #define dmi_printk(x)
-//#define dmi_printk(x) printk(x)
+//#define dmi_printk(x) printk x
 
 static char * __init dmi_string(struct dmi_header *dm, u8 s)
 {


-- 
        Bob Dunlop
        rjd@xyzzy.clara.co.uk
        www.xyzzy.clara.co.uk

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH 2.4.6-ac2] dmi_scan.c cleanups.
  2001-07-09 10:08 [PATCH 2.4.6-ac2] dmi_scan.c cleanups Stelian Pop
  2001-07-09 11:16 ` Robert J.Dunlop
@ 2001-07-10  6:33 ` Juan Quintela
  1 sibling, 0 replies; 3+ messages in thread
From: Juan Quintela @ 2001-07-10  6:33 UTC (permalink / raw)
  To: Stelian Pop; +Cc: Linux Kernel Mailing List, Alan Cox

>>>>> "stelian" == Stelian Pop <stelian.pop@fr.alcove.com> writes:

Hi
        how about var args macros?

stelian> diff -uNr --exclude-from=dontdiff linux-2.4.6-ac2.orig/arch/i386/kernel/dmi_scan.c linux-2.4.6-ac2/arch/i386/kernel/dmi_scan.c
stelian> --- linux-2.4.6-ac2.orig/arch/i386/kernel/dmi_scan.c	Mon Jul  9 10:25:52 2001
stelian> +++ linux-2.4.6-ac2/arch/i386/kernel/dmi_scan.c	Mon Jul  9 11:03:29 2001
stelian> @@ -14,8 +14,8 @@
stelian> u16	handle;
stelian> };
 
stelian> -#define dmi_printk(x)
stelian> -//#define dmi_printk(x) printk(x)
stelian> +#define dmi_printk while(0) printk
stelian> +//#define dmi_printk printk
 

#define dmp_printk(x...) printk(x)

once, here, put labels to the printks will be also a nice idea.

Later, Juan.

-- 
In theory, practice and theory are the same, but in practice they 
are different -- Larry McVoy

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2001-07-10 11:45 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2001-07-09 10:08 [PATCH 2.4.6-ac2] dmi_scan.c cleanups Stelian Pop
2001-07-09 11:16 ` Robert J.Dunlop
2001-07-10  6:33 ` Juan Quintela

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox