* [PATCH] scsi: st: replace ternary operator with max()
@ 2022-10-29 15:40 wangkailong
0 siblings, 0 replies; only message in thread
From: wangkailong @ 2022-10-29 15:40 UTC (permalink / raw)
To: Kai.Makisara, jejb, martin.petersen; +Cc: linux-scsi, linux-kernel
Fix the following coccicheck warning:
drivers/scsi/st.c:1577: WARNING opportunity for max()
Signed-off-by: KaiLong Wang <wangkailong@jari.cn>
---
drivers/scsi/st.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/scsi/st.c b/drivers/scsi/st.c
index b90a440e135d..5477897aa920 100644
--- a/drivers/scsi/st.c
+++ b/drivers/scsi/st.c
@@ -1574,8 +1574,7 @@ static int setup_buffering(struct scsi_tape *STp, const char __user *buf,
if (!STbp->do_dio) {
if (STp->block_size)
- bufsize = STp->block_size > st_fixed_buffer_size ?
- STp->block_size : st_fixed_buffer_size;
+ bufsize = max(STp->block_size, st_fixed_buffer_size);
else {
bufsize = count;
/* Make sure that data from previous user is not leaked even if
--
2.25.1
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2022-10-29 15:45 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-10-29 15:40 [PATCH] scsi: st: replace ternary operator with max() wangkailong
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®