Re: [PATCH 1/3] IDE: Coding Style fixes to drivers/ide/ide-cd.c

2008-02-24 Thread Adrian Bunk
On Sun, Feb 24, 2008 at 10:10:33PM +0100, Paolo Ciarrocchi wrote:
> Before:
> total: 43 errors, 66 warnings, 2183 lines checked
> 
> After:
> total: 0 errors, 36 warnings, 2192 lines checked
> 
> I didn't (and I don't plan to) fix the warnings:
> WARNING: line over 80 characters
> 
> 
> Signed-off-by: Paolo Ciarrocchi <[EMAIL PROTECTED]>
> ---
>  drivers/ide/ide-cd.c |  245 
> ++
>  1 files changed, 127 insertions(+), 118 deletions(-)
> 
> diff --git a/drivers/ide/ide-cd.c b/drivers/ide/ide-cd.c
> index 546f436..3181e71 100644
> --- a/drivers/ide/ide-cd.c
> +++ b/drivers/ide/ide-cd.c
>...
>   switch (sense->sense_key) {
> - case NO_SENSE: case RECOVERED_ERROR:
> - break;
>...
> + case NO_SENSE: case RECOVERED_ERROR:
> + break;
>...

In case the goal is not to only improve the checkpatch metrics but to 
improve the readability of the code the biggest coding style problem 
here was (and still is) not the indentation.

cu
Adrian

-- 

   "Is there not promise of rain?" Ling Tan asked suddenly out
of the darkness. There had been need of rain for many days.
   "Only a promise," Lao Er said.
   Pearl S. Buck - Dragon Seed

-
To unsubscribe from this list: send the line "unsubscribe linux-ide" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 1/3] IDE: Coding Style fixes to drivers/ide/ide-cd.c

2008-02-24 Thread Paolo Ciarrocchi
Before:
total: 43 errors, 66 warnings, 2183 lines checked

After:
total: 0 errors, 36 warnings, 2192 lines checked

I didn't (and I don't plan to) fix the warnings:
WARNING: line over 80 characters


Signed-off-by: Paolo Ciarrocchi <[EMAIL PROTECTED]>
---
 drivers/ide/ide-cd.c |  245 ++
 1 files changed, 127 insertions(+), 118 deletions(-)

diff --git a/drivers/ide/ide-cd.c b/drivers/ide/ide-cd.c
index 546f436..3181e71 100644
--- a/drivers/ide/ide-cd.c
+++ b/drivers/ide/ide-cd.c
@@ -13,8 +13,8 @@
  *
  * Suggestions are welcome. Patches that work are more welcome though. ;-)
  * For those wishing to work on this driver, please be sure you download
- * and comply with the latest Mt. Fuji (SFF8090 version 4) and ATAPI 
- * (SFF-8020i rev 2.6) standards. These documents can be obtained by 
+ * and comply with the latest Mt. Fuji (SFF8090 version 4) and ATAPI
+ * (SFF-8020i rev 2.6) standards. These documents can be obtained by
  * anonymous ftp from:
  * 
ftp://fission.dt.wdc.com/pub/standards/SFF_atapi/spec/SFF8020-r2.6/PS/8020r26.ps
  * ftp://ftp.avc-pioneer.com/Mtfuji4/Spec/Fuji4r10.pdf
@@ -51,7 +51,7 @@
 
 static DEFINE_MUTEX(idecd_ref_mutex);
 
-#define to_ide_cd(obj) container_of(obj, struct cdrom_info, kref) 
+#define to_ide_cd(obj) container_of(obj, struct cdrom_info, kref)
 
 #define ide_cd_g(disk) \
container_of((disk)->private_data, struct cdrom_info, driver)
@@ -83,7 +83,7 @@ static void ide_cd_put(struct cdrom_info *cd)
 
 /* Mark that we've seen a media change, and invalidate our internal
buffers. */
-static void cdrom_saw_media_change (ide_drive_t *drive)
+static void cdrom_saw_media_change(ide_drive_t *drive)
 {
struct cdrom_info *cd = drive->driver_data;
 
@@ -100,37 +100,37 @@ static int cdrom_log_sense(ide_drive_t *drive, struct 
request *rq,
return 0;
 
switch (sense->sense_key) {
-   case NO_SENSE: case RECOVERED_ERROR:
-   break;
-   case NOT_READY:
-   /*
-* don't care about tray state messages for
-* e.g. capacity commands or in-progress or
-* becoming ready
-*/
-   if (sense->asc == 0x3a || sense->asc == 0x04)
-   break;
-   log = 1;
-   break;
-   case ILLEGAL_REQUEST:
-   /*
-* don't log START_STOP unit with LoEj set, since
-* we cannot reliably check if drive can auto-close
-*/
-   if (rq->cmd[0] == GPCMD_START_STOP_UNIT && sense->asc 
== 0x24)
-   break;
-   log = 1;
+   case NO_SENSE: case RECOVERED_ERROR:
+   break;
+   case NOT_READY:
+   /*
+* don't care about tray state messages for
+* e.g. capacity commands or in-progress or
+* becoming ready
+*/
+   if (sense->asc == 0x3a || sense->asc == 0x04)
break;
-   case UNIT_ATTENTION:
-   /*
-* Make good and sure we've seen this potential media
-* change. Some drives (i.e. Creative) fail to present
-* the correct sense key in the error register.
-*/
-   cdrom_saw_media_change(drive);
+   log = 1;
+   break;
+   case ILLEGAL_REQUEST:
+   /*
+* don't log START_STOP unit with LoEj set, since
+* we cannot reliably check if drive can auto-close
+*/
+   if (rq->cmd[0] == GPCMD_START_STOP_UNIT && sense->asc == 0x24)
break;
-   default:
-   log = 1;
+   log = 1;
+   break;
+   case UNIT_ATTENTION:
+   /*
+* Make good and sure we've seen this potential media
+* change. Some drives (i.e. Creative) fail to present
+* the correct sense key in the error register.
+*/
+   cdrom_saw_media_change(drive);
+   break;
+   default:
+   log = 1;
break;
}
return log;
@@ -158,8 +158,8 @@ void cdrom_analyze_sense_data(ide_drive_t *drive,
if (sense->sense_key == 0x05 && sense->asc == 0x24)
return;
 
-   if (sense->error_code == 0x70) {/* Current Error */
-   switch(sense->sense_key) {
+   if (sense->error_code == 0x70) {/* Current Error */
+   switch (sense->sense_key) {
case MEDIUM_ERROR:
case VOLUME_OVERFLOW:
ca