Re: [PATCH] scsi/trace: Use get_unaligned_be*()

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

 



Bart,

> This patch fixes an unintended sign extension on left shifts. From
> Colin King: "Shifting a u8 left will cause the value to be promoted to
> an integer. If the top bit of the u8 is set then the following
> conversion to an u64 will sign extend the value causing the upper 32
> bits to be set in the result."

Looks good in general. One minor nit:

> +	 * From SBC-2: a TRANSFER LENGTH field set to zero specifies that 256
> +	 * logical blocks shall be read (READ(6)) or written (WRITE(6)).
> +	 */
> +	txlen = cdb[4] ? : 256;

Please avoid using the gcc conditional extension. Please either write it
out in full or make it an if statement.

Also, maybe this change should be a separate patch.

-- 
Martin K. Petersen	Oracle Linux Engineering



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [SCSI Target Devel]     [Linux SCSI Target Infrastructure]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Samba]     [Device Mapper]

  Powered by Linux