Re: [PATCH] ide: ide-cd.c blocklen is a big-endian value

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thursday 24 July 2008, Harvey Harrison wrote:
> Noticed by sparse between next-20080722 and next-20080723
> 
> Signed-off-by: Harvey Harrison <harvey.harrison@xxxxxxxxx>

Thanks for noticing/fixing this.

I integrated it into the guilty patch
("ide-cd: fix oops when using growisofs").

> ---
>  drivers/ide/ide-cd.c |   10 +++++-----
>  1 files changed, 5 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/ide/ide-cd.c b/drivers/ide/ide-cd.c
> index 3a6fef5..a384500 100644
> --- a/drivers/ide/ide-cd.c
> +++ b/drivers/ide/ide-cd.c
> @@ -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;
>  	}
>  
> -- 
> 1.5.6.4.570.g052e
--
To unsubscribe from this list: send the line "unsubscribe linux-ide" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Filesystems]     [Linux SCSI]     [Linux RAID]     [Git]     [Kernel Newbies]     [Linux Newbie]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Samba]     [Device Mapper]

  Powered by Linux