Skip to content

Commit e1ad3a0

Browse files
committed
platform/x86: dell-smo8800: Use min_t() for comparison and assignment
JIRA: https://issues.redhat.com/browse/RHEL-47426 commit bdf2ffb Author: Deepak R Varma <drv@mailo.com> Date: Fri Jan 27 22:01:49 2023 +0530 platform/x86: dell-smo8800: Use min_t() for comparison and assignment Simplify code by using min_t helper macro for logical evaluation and value assignment. Use the _t variant of min macro since the variable types are not same. This issue is identified by coccicheck using the minmax.cocci file. Signed-off-by: Deepak R Varma <drv@mailo.com> Acked-by: Pali Rohár <pali@kernel.org> Link: https://lore.kernel.org/r/Y9P8debIztOZXazW@ubun2204.myguest.virtualbox.org Reviewed-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: David Arcari <darcari@redhat.com>
1 parent 871db98 commit e1ad3a0

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

drivers/platform/x86/dell/dell-smo8800.c

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -67,10 +67,7 @@ static ssize_t smo8800_misc_read(struct file *file, char __user *buf,
6767

6868
retval = 1;
6969

70-
if (data < 255)
71-
byte_data = data;
72-
else
73-
byte_data = 255;
70+
byte_data = min_t(u32, data, 255);
7471

7572
if (put_user(byte_data, buf))
7673
retval = -EFAULT;

0 commit comments

Comments
 (0)