]> www.infradead.org Git - users/hch/misc.git/commitdiff
drm/i915/gvt: Remove redundant ternary operators
authorLiao Yuanhong <liaoyuanhong@vivo.com>
Thu, 4 Sep 2025 11:26:40 +0000 (19:26 +0800)
committerJani Nikula <jani.nikula@intel.com>
Mon, 8 Sep 2025 10:45:49 +0000 (13:45 +0300)
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>
Link: https://lore.kernel.org/r/20250904112644.350512-1-liaoyuanhong@vivo.com
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
drivers/gpu/drm/i915/gvt/cmd_parser.c

index a91e23c22ea10bba5a2451eda139952303260e3a..d432fdd698331bc12a010e60de48fa35b65a0c6d 100644 (file)
@@ -1921,7 +1921,7 @@ static int perform_bb_shadow(struct parser_exec_state *s)
        if (!bb)
                return -ENOMEM;
 
-       bb->ppgtt = (s->buf_addr_type == GTT_BUFFER) ? false : true;
+       bb->ppgtt = s->buf_addr_type != GTT_BUFFER;
 
        /*
         * The start_offset stores the batch buffer's start gma's