Re: [PATCH] ide: ide-cd.c fix sparse endianness warnings

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

 



On Thu, Jul 03, 2008 at 04:34:45PM -0700, Harvey Harrison wrote:
> drivers/ide/ide-cd.c:1276:46: warning: Using plain integer as NULL pointer
> drivers/ide/ide-cd.c:1298:19: warning: cast to restricted __be32
> drivers/ide/ide-cd.c:1300:4: warning: cast to restricted __be32
> drivers/ide/ide-cd.c:1522:14: warning: cast to restricted __le16
> drivers/ide/ide-cd.c:1523:14: warning: cast to restricted __le16
> drivers/ide/ide-cd.c:1525:14: warning: cast to restricted __be16
> drivers/ide/ide-cd.c:1526:14: warning: cast to restricted __be16
> drivers/ide/ide-cd.c:1667:37: warning: cast to restricted __be16
> 
> Signed-off-by: Harvey Harrison <harvey.harrison@xxxxxxxxx>

Acked-off-by: Borislav Petkov <petkovbb@xxxxxxxxx>

> ---
>  drivers/ide/ide-cd.c |   19 ++++++++-----------
>  1 files changed, 8 insertions(+), 11 deletions(-)
> 
> diff --git a/drivers/ide/ide-cd.c b/drivers/ide/ide-cd.c
> index 9b4acbe..47c58a8 100644
> --- a/drivers/ide/ide-cd.c
> +++ b/drivers/ide/ide-cd.c
> @@ -1273,7 +1273,7 @@ int cdrom_check_status(ide_drive_t *drive, struct request_sense *sense)
>  	 */
>  	cmd[7] = cdi->sanyo_slot % 3;
>  
> -	return ide_cd_queue_pc(drive, cmd, 0, NULL, 0, sense, 0, REQ_QUIET);
> +	return ide_cd_queue_pc(drive, cmd, 0, NULL, NULL, sense, 0, REQ_QUIET);
>  }
>  
>  static int cdrom_read_capacity(ide_drive_t *drive, unsigned long *capacity,
> @@ -1281,8 +1281,8 @@ static int cdrom_read_capacity(ide_drive_t *drive, unsigned long *capacity,
>  			       struct request_sense *sense)
>  {
>  	struct {
> -		__u32 lba;
> -		__u32 blocklen;
> +		__be32 lba;
> +		__be32 blocklen;
>  	} capbuf;
>  
>  	int stat;
> @@ -1515,15 +1515,12 @@ void ide_cdrom_update_speed(ide_drive_t *drive, u8 *buf)
>  	struct cdrom_info *cd = drive->driver_data;
>  	u16 curspeed, maxspeed;
>  
> -	curspeed = *(u16 *)&buf[8 + 14];
> -	maxspeed = *(u16 *)&buf[8 +  8];
> -
>  	if (drive->dev_flags & IDE_DFLAG_LE_SPEED_FIELDS) {
> -		curspeed = le16_to_cpu(curspeed);
> -		maxspeed = le16_to_cpu(maxspeed);
> +		curspeed = le16_to_cpup((__le16 *)&buf[8 + 14]);
> +		maxspeed = le16_to_cpup((__le16 *)&buf[8 + 8]);
>  	} else {
> -		curspeed = be16_to_cpu(curspeed);
> -		maxspeed = be16_to_cpu(maxspeed);
> +		curspeed = be16_to_cpup((__be16 *)&buf[8 + 14]);
> +		maxspeed = be16_to_cpup((__be16 *)&buf[8 + 8]);
>  	}
>  
>  	cd->current_speed = (curspeed + (176/2)) / 176;
> @@ -1664,7 +1661,7 @@ static int ide_cdrom_probe_capabilities(ide_drive_t *drive)
>  	else
>  		printk(KERN_CONT " drive");
>  
> -	printk(KERN_CONT ", %dkB Cache\n", be16_to_cpu(*(u16 *)&buf[8 + 12]));
> +	printk(KERN_CONT ", %dkB Cache\n", be16_to_cpup((__be16 *)&buf[8 + 12]));
>  
>  	return nslots;
>  }
> -- 
> 1.5.6.1.281.g1087e
> 
> --
> 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

-- 
Regards/Gruß,
    Boris.
--
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