* [PATCH] drm/i915/gvt: Remove redundant ternary operators
@ 2025-09-04 11:26 Liao Yuanhong
2025-09-08 10:47 ` Jani Nikula
0 siblings, 1 reply; 2+ messages in thread
From: Liao Yuanhong @ 2025-09-04 11:26 UTC (permalink / raw)
To: Zhenyu Wang, Zhi Wang, Jani Nikula, Joonas Lahtinen,
Rodrigo Vivi, Tvrtko Ursulin, David Airlie, Simona Vetter,
Nitin Gote, Luca Coelho, Krzysztof Niemiec,
open list:DRM DRIVERS, open list
Cc: Liao Yuanhong
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>
---
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
--
2.34.1
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] drm/i915/gvt: Remove redundant ternary operators
2025-09-04 11:26 [PATCH] drm/i915/gvt: Remove redundant ternary operators Liao Yuanhong
@ 2025-09-08 10:47 ` Jani Nikula
0 siblings, 0 replies; 2+ messages in thread
From: Jani Nikula @ 2025-09-08 10:47 UTC (permalink / raw)
To: Liao Yuanhong, Zhenyu Wang, Zhi Wang, Joonas Lahtinen,
Rodrigo Vivi, Tvrtko Ursulin, David Airlie, Simona Vetter,
Nitin Gote, Luca Coelho, Krzysztof Niemiec,
open list:DRM DRIVERS, open list
Cc: Liao Yuanhong
On Thu, 04 Sep 2025, Liao Yuanhong <liaoyuanhong@vivo.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@vivo.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
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2025-09-08 10:47 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-09-04 11:26 [PATCH] drm/i915/gvt: Remove redundant ternary operators Liao Yuanhong
2025-09-08 10:47 ` Jani Nikula
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®