Re: [RESEND] drm/i915/syncmap: squelch a sparse warning

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, 29 Nov 2023, Rodrigo Vivi <rodrigo.vivi@xxxxxxxxx> wrote:
> On Wed, Nov 29, 2023 at 07:35:06PM +0200, Jani Nikula wrote:
>> The code is fine, really, but tweak it to get rid of the sparse warning:
>> 
>> drivers/gpu/drm/i915/selftests/i915_syncmap.c:80:54: warning: dubious: x | !y
>> 
>> Signed-off-by: Jani Nikula <jani.nikula@xxxxxxxxx>
>
> I always disliked the '!!' magic anyway,
>
> Reviewed-by: Rodrigo Vivi <rodrigo.vivi@xxxxxxxxx>

Thanks, pushed.


>
>> ---
>>  drivers/gpu/drm/i915/selftests/i915_syncmap.c | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>> 
>> diff --git a/drivers/gpu/drm/i915/selftests/i915_syncmap.c b/drivers/gpu/drm/i915/selftests/i915_syncmap.c
>> index 47f4ae18a1ef..88fa845e9f4a 100644
>> --- a/drivers/gpu/drm/i915/selftests/i915_syncmap.c
>> +++ b/drivers/gpu/drm/i915/selftests/i915_syncmap.c
>> @@ -77,7 +77,7 @@ __sync_print(struct i915_syncmap *p,
>>  		for_each_set_bit(i, (unsigned long *)&p->bitmap, KSYNCMAP) {
>>  			buf = __sync_print(__sync_child(p)[i], buf, sz,
>>  					   depth + 1,
>> -					   last << 1 | !!(p->bitmap >> (i + 1)),
>> +					   last << 1 | ((p->bitmap >> (i + 1)) ? 1 : 0),
>>  					   i);
>>  		}
>>  	}
>> -- 
>> 2.39.2
>> 

-- 
Jani Nikula, Intel



[Index of Archives]     [AMD Graphics]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux