]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
media: siano: Remove redundant ternary operators
authorLiao Yuanhong <liaoyuanhong@vivo.com>
Thu, 4 Sep 2025 11:30:34 +0000 (19:30 +0800)
committerHans Verkuil <hverkuil+cisco@kernel.org>
Tue, 11 Nov 2025 09:17:33 +0000 (10:17 +0100)
For ternary operators in the form of "a ? false : true", if 'a' itself
returns a boolean result, the ternary operator can be omitted. Remove
redundant ternary operators to clean up the code.

Signed-off-by: Liao Yuanhong <liaoyuanhong@vivo.com>
Signed-off-by: Sean Young <sean@mess.org>
Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
drivers/media/common/siano/smsir.c

index d85c78c104b990c85f668e0e0790d822a1b3fdbb..af07fed21ae1232a77068ef79911f2a7a218f29b 100644 (file)
@@ -28,7 +28,7 @@ void sms_ir_event(struct smscore_device_t *coredev, const char *buf, int len)
        for (i = 0; i < len >> 2; i++) {
                struct ir_raw_event ev = {
                        .duration = abs(samples[i]),
-                       .pulse = (samples[i] > 0) ? false : true
+                       .pulse = samples[i] <= 0
                };
 
                ir_raw_event_store(coredev->ir.dev, &ev);