diff mbox series

scsi: st: replace ternary operator with max()

Message ID 317f9e05.40.18424674406.Coremail.wangkailong@jari.cn (mailing list archive)
State Deferred
Headers show
Series scsi: st: replace ternary operator with max() | expand

Commit Message

KaiLong Wang Oct. 29, 2022, 3:40 p.m. UTC
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 mbox series

Patch

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