]> git.baikalelectronics.ru Git - kernel.git/commit
[SCSI] be2iscsi: cleanup a min_t() call
authorDan Carpenter <dan.carpenter@oracle.com>
Mon, 26 Sep 2011 06:23:37 +0000 (09:23 +0300)
committerJames Bottomley <JBottomley@Parallels.com>
Thu, 15 Dec 2011 06:57:31 +0000 (10:57 +0400)
commit7ba612b756f3e1d1407af09464fabb7ec02c7749
tree081b70eb50643040b85104aa652533ad07fa5379
parent5d5c6983195700c6e9bd506a19cab834aaca2f4c
[SCSI] be2iscsi: cleanup a min_t() call

"sense_len" was declared as int type but actually it only stores a
u16 value that comes from hardware.  The cast to u16 in min_t()
confuses static analysis because it truncates the int to u16 so I've
fixed the declaration to reflect that "sense_len" is just a u16.

Also there was a call to cpu_to_be16() which I've changed to
be16_to_cpu().  The functions are equivalent, but obviously the
hardware is big endian and we're doing the min_t() comparison on CPU
endian values.

This whole patch is just a cleanup and doesn't affect how the code
works.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Reviewed-by: Mike Christie <michaelc@cs.wisc.edu>
Acked-by: Jayamohan Kallickal <Jayamohan.kallickal@emulex.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
drivers/scsi/be2iscsi/be_main.c