linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH-2.6.10] ide-lib printk readability fix
@ 2005-01-09  0:48 Gunther Mayer
  2005-01-15  1:05 ` Bartlomiej Zolnierkiewicz
  0 siblings, 1 reply; 2+ messages in thread
From: Gunther Mayer @ 2005-01-09  0:48 UTC (permalink / raw)
  To: Alan Cox; +Cc: linux-kernel

[-- Attachment #1: Type: text/plain, Size: 2373 bytes --]

Hi,
this improves logic and readability:
- remove blank from: AbortedCommand (as other flags)
- add blank and {} to error= line
- clean up: remove 2 lines and extra printk

before:
  hdd: status error: status=0x7f { DriveReady DeviceFault SeekComplete 
DataRequest CorrectedError Index Error }
  hdd: status error: error=0x7fIllegalLengthIndication EndOfMedia 
Aborted Command MediaChangeRequested LastFailedSense 0x07


after:
  hdd: status error: status=0x7f { DriveReady DeviceFault SeekComplete 
DataRequest CorrectedError Index Error }
  hdd: status error: error=0x7f { IllegalLengthIndication EndOfMedia 
AbortedCommand MediaChangeRequested LastFailedSense=0x07 }

Please apply.
-
Gunther

--- linux-2.6.10/drivers/ide/ide-lib.c-orig     2004-12-24 
13:35:39.000000000 -0800
+++ linux-2.6.10/drivers/ide/ide-lib.c  2005-01-08 16:04:35.977731896 -0800
@@ -462,8 +462,7 @@
 
        status.all = stat;
        local_irq_set(flags);
-       printk("%s: %s: status=0x%02x", drive->name, msg, stat);
-       printk(" { ");
+       printk("%s: %s: status=0x%02x { ", drive->name, msg, stat);
        if (status.b.bsy)
                printk("Busy ");
        else {
@@ -475,18 +474,17 @@
                if (status.b.idx)       printk("Index ");
                if (status.b.check)     printk("Error ");
        }
-       printk("}");
-       printk("\n");
+       printk("}\n");
        if ((status.all & (status.b.bsy|status.b.check)) == 
status.b.check) {
                error.all = HWIF(drive)->INB(IDE_ERROR_REG);
-               printk("%s: %s: error=0x%02x", drive->name, msg, error.all);
+               printk("%s: %s: error=0x%02x { ", drive->name, msg, 
error.all);
                if (error.b.ili)        printk("IllegalLengthIndication ");
                if (error.b.eom)        printk("EndOfMedia ");
-               if (error.b.abrt)       printk("Aborted Command ");
+               if (error.b.abrt)       printk("AbortedCommand ");
                if (error.b.mcr)        printk("MediaChangeRequested ");
-               if (error.b.sense_key)  printk("LastFailedSense 0x%02x ",
+               if (error.b.sense_key)  printk("LastFailedSense=0x%02x ",
                                                error.b.sense_key);
-               printk("\n");
+               printk("}\n");
        }
        local_irq_restore(flags);
        return error.all;


[-- Attachment #2: gmdiff-lx2610-ide-lib-error-readability-fix --]
[-- Type: text/plain, Size: 1297 bytes --]

--- linux-2.6.10/drivers/ide/ide-lib.c-orig	2004-12-24 13:35:39.000000000 -0800
+++ linux-2.6.10/drivers/ide/ide-lib.c	2005-01-08 16:04:35.977731896 -0800
@@ -462,8 +462,7 @@
 
 	status.all = stat;
 	local_irq_set(flags);
-	printk("%s: %s: status=0x%02x", drive->name, msg, stat);
-	printk(" { ");
+	printk("%s: %s: status=0x%02x { ", drive->name, msg, stat);
 	if (status.b.bsy)
 		printk("Busy ");
 	else {
@@ -475,18 +474,17 @@
 		if (status.b.idx)	printk("Index ");
 		if (status.b.check)	printk("Error ");
 	}
-	printk("}");
-	printk("\n");
+	printk("}\n");
 	if ((status.all & (status.b.bsy|status.b.check)) == status.b.check) {
 		error.all = HWIF(drive)->INB(IDE_ERROR_REG);
-		printk("%s: %s: error=0x%02x", drive->name, msg, error.all);
+		printk("%s: %s: error=0x%02x { ", drive->name, msg, error.all);
 		if (error.b.ili)	printk("IllegalLengthIndication ");
 		if (error.b.eom)	printk("EndOfMedia ");
-		if (error.b.abrt)	printk("Aborted Command ");
+		if (error.b.abrt)	printk("AbortedCommand ");
 		if (error.b.mcr)	printk("MediaChangeRequested ");
-		if (error.b.sense_key)	printk("LastFailedSense 0x%02x ",
+		if (error.b.sense_key)	printk("LastFailedSense=0x%02x ",
 						error.b.sense_key);
-		printk("\n");
+		printk("}\n");
 	}
 	local_irq_restore(flags);
 	return error.all;

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

* Re: [PATCH-2.6.10] ide-lib printk readability fix
  2005-01-09  0:48 [PATCH-2.6.10] ide-lib printk readability fix Gunther Mayer
@ 2005-01-15  1:05 ` Bartlomiej Zolnierkiewicz
  0 siblings, 0 replies; 2+ messages in thread
From: Bartlomiej Zolnierkiewicz @ 2005-01-15  1:05 UTC (permalink / raw)
  To: Gunther Mayer; +Cc: Alan Cox, linux-kernel

On Sat, 08 Jan 2005 16:48:21 -0800, Gunther Mayer <gunther.mayer@gmx.net> wrote:
> Hi,
> this improves logic and readability:
> - remove blank from: AbortedCommand (as other flags)
> - add blank and {} to error= line
> - clean up: remove 2 lines and extra printk
> 
> before:
>   hdd: status error: status=0x7f { DriveReady DeviceFault SeekComplete
> DataRequest CorrectedError Index Error }
>   hdd: status error: error=0x7fIllegalLengthIndication EndOfMedia
> Aborted Command MediaChangeRequested LastFailedSense 0x07
> 
> after:
>   hdd: status error: status=0x7f { DriveReady DeviceFault SeekComplete
> DataRequest CorrectedError Index Error }
>   hdd: status error: error=0x7f { IllegalLengthIndication EndOfMedia
> AbortedCommand MediaChangeRequested LastFailedSense=0x07 }
> 
> Please apply.

applied

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

end of thread, other threads:[~2005-01-15  1:12 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-01-09  0:48 [PATCH-2.6.10] ide-lib printk readability fix Gunther Mayer
2005-01-15  1:05 ` Bartlomiej Zolnierkiewicz

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).