lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <35ac1aad8feb977017d1d1a6eea86ed3754d8646@intel.com>
Date: Mon, 08 Sep 2025 13:47:02 +0300
From: Jani Nikula <jani.nikula@...ux.intel.com>
To: Liao Yuanhong <liaoyuanhong@...o.com>, Zhenyu Wang
 <zhenyuw.linux@...il.com>, Zhi Wang <zhi.wang.linux@...il.com>, Joonas
 Lahtinen <joonas.lahtinen@...ux.intel.com>, Rodrigo Vivi
 <rodrigo.vivi@...el.com>, Tvrtko Ursulin <tursulin@...ulin.net>, David
 Airlie <airlied@...il.com>, Simona Vetter <simona@...ll.ch>, Nitin Gote
 <nitin.r.gote@...el.com>, Luca Coelho <luciano.coelho@...el.com>,
 Krzysztof Niemiec <krzysztof.niemiec@...el.com>, "open list:DRM DRIVERS"
 <dri-devel@...ts.freedesktop.org>, open list
 <linux-kernel@...r.kernel.org>
Cc: Liao Yuanhong <liaoyuanhong@...o.com>
Subject: Re: [PATCH] drm/i915/gvt: Remove redundant ternary operators

On Thu, 04 Sep 2025, Liao Yuanhong <liaoyuanhong@...o.com> wrote:
> 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@...o.com>

Pushed to drm-intel-next, thanks for the patch.

BR,
Jani.


> ---
>  drivers/gpu/drm/i915/gvt/cmd_parser.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/i915/gvt/cmd_parser.c b/drivers/gpu/drm/i915/gvt/cmd_parser.c
> index a91e23c22ea1..d432fdd69833 100644
> --- a/drivers/gpu/drm/i915/gvt/cmd_parser.c
> +++ b/drivers/gpu/drm/i915/gvt/cmd_parser.c
> @@ -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

-- 
Jani Nikula, Intel

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ