ide: ide-cd.c blocklen is a big-endian value
Subsystems (2)
PATCH 1/1 ide: ide-cd.c blocklen is a big-endian value
Noticed by sparse between next-20080722 and next-20080723
Signed-off-by Harvey Harrison <[email protected]>
--- drivers/ide/ide-cd.c | 10 +++++----- 1 files changed, 5 insertions(+), 5 deletions(-)
drivers/ide/ide-cd.c +5 -5
@@ -1318,17 +1318,17 @@ static int cdrom_read_capacity(ide_drive_t *drive, unsigned long *capacity,* Sanity check the given block size */ switch (capbuf.blocklen) { -case 512 : -case 1024 : -case 2048 : -case 4096 : +case __constant_cpu_to_be32 (512 ): +case __constant_cpu_to_be32 (1024 ): +case __constant_cpu_to_be32 (2048 ): +case __constant_cpu_to_be32 (4096 ):break ;default :printk (KERN_ERR "%s: weird block size %u\n" , drive->name, capbuf.blocklen);printk (KERN_ERR "%s: default to 2kb block size\n" , drive->name); - capbuf.blocklen =2048 ; + capbuf.blocklen =__constant_cpu_to_be32 (2048 );break ; }
Signature · 1 line
1.5.6.4.570.g052e
Quoted 3 lines · Harvey Harrison
Noticed by sparse between next-20080722 and next-20080723
Signed-off-by Harvey Harrison <[email protected]>
Thanks for noticing/fixing this.
I integrated it into the guilty patch
("ide-cd: fix oops when using growisofs").
Quoted 33 lines
--- drivers/ide/ide-cd.c | 10 +++++----- 1 files changed, 5 insertions(+), 5 deletions(-)drivers/ide/ide-cd.c +5
-5@@ -1318,17 +1318,17 @@ static int cdrom_read_capacity(ide_drive_t *drive, unsigned long *capacity,* Sanity check the given block size */ switch (capbuf.blocklen) { -case 512 : -case 1024 : -case 2048 : -case 4096 : +case __constant_cpu_to_be32 (512 ): +case __constant_cpu_to_be32 (1024 ): +case __constant_cpu_to_be32 (2048 ): +case __constant_cpu_to_be32 (4096 ):break ;default :printk (KERN_ERR "%s: weird block size %u\n" , drive->name, capbuf.blocklen);printk (KERN_ERR "%s: default to 2kb block size\n" , drive->name); - capbuf.blocklen =2048 ; + capbuf.blocklen =__constant_cpu_to_be32 (2048 );break ; }Signature · 1 line
1.5.6.4.570.g052e
Quoted 10 lines · Bartlomiej Zolnierkiewicz
Quoted 3 lines · Harvey Harrison
Noticed by sparse between next-20080722 and next-20080723
Signed-off-by Harvey Harrison <[email protected]>Thanks for noticing/fixing this.
I integrated it into the guilty patch
("ide-cd: fix oops when using growisofs").
This is precisely why I'm running sparse on each linux-next, so no worries.
Harvey
Hi Harvey,
Quoted 3 lines · On Thu, 24 Jul 2008 12:16:57 -0700 Harvey Harrison <[email protected]>…
This is precisely why I'm running sparse on each linux-next, so no worries.
Thanks Harvey, that is a great addition to the testing.
Signature · 3 lines
Cheers, Stephen Rothwell [email protected] http://www.canb.auug.org.au/~sfr/