mirror of
https://github.com/torvalds/linux.git
synced 2024-11-10 14:11:52 +00:00
scsi: core: Use min() instead of open-coding it
Use min() instead of open-coding it in scsi_normalize_sense(). Reviewed-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Benjamin Block <bblock@linux.ibm.com> Cc: Douglas Gilbert <dgilbert@interlog.com> Signed-off-by: Bart Van Assche <bvanassche@acm.org> Link: https://lore.kernel.org/r/20230518193159.1166304-2-bvanassche@acm.org Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
This commit is contained in:
parent
f047d1e38b
commit
416dace649
@ -219,8 +219,7 @@ bool scsi_normalize_sense(const u8 *sense_buffer, int sb_len,
|
||||
if (sb_len > 2)
|
||||
sshdr->sense_key = (sense_buffer[2] & 0xf);
|
||||
if (sb_len > 7) {
|
||||
sb_len = (sb_len < (sense_buffer[7] + 8)) ?
|
||||
sb_len : (sense_buffer[7] + 8);
|
||||
sb_len = min(sb_len, sense_buffer[7] + 8);
|
||||
if (sb_len > 12)
|
||||
sshdr->asc = sense_buffer[12];
|
||||
if (sb_len > 13)
|
||||
|
Loading…
Reference in New Issue
Block a user