On Fri, 26 Jun 2026, Andi Shyti <[email protected]> wrote:
>> > diff --git a/drivers/gpu/drm/i915/gt/intel_reset.c 
>> > b/drivers/gpu/drm/i915/gt/intel_reset.c
>> > index b2cf672564dd..a3f198646e1d 100644
>> > --- a/drivers/gpu/drm/i915/gt/intel_reset.c
>> > +++ b/drivers/gpu/drm/i915/gt/intel_reset.c
>> > @@ -797,9 +797,9 @@ static int __intel_gt_reset(struct intel_gt *gt, 
>> > intel_engine_mask_t engine_mask
>> >  bool intel_has_gpu_reset(const struct intel_gt *gt)
>> >  {
>> >    if (!gt->i915->params.reset)
>> > -          return NULL;
>> > +          return false;
>> >  
>> > -  return intel_get_gpu_reset(gt);
>> > +  return !!intel_get_gpu_reset(gt);
>> 
>> !! is superfluous.
>
> OK, I can resend it. I actually like the use of "!!" because it
> explicitly converts the result to 1 or 0, by definition of true
> and false, but I don't have a strong opinion on it in this case.

!! is a convention from the time predating stdbool, when you had to use
an integer type to represent booleans, and often wanted to normalize the
value to 0 or 1 avoid errors with inadvertent val == TRUE comparisons
and the like.

Since C99 and stdbool, the !! is just redundant because of the implicit
type conversion that guarantees the same for you.

I don't like adding the redundant stuff, because I think they set a bad
example for people to replicate.


BR,
Jani.


-- 
Jani Nikula, Intel

Reply via email to