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: <4115c6fb-7031-27ca-f891-55c0806895dd@canonical.com>
Date:   Mon, 11 Jun 2018 17:37:43 +0100
From:   Colin Ian King <colin.king@...onical.com>
To:     Ville Syrjälä <ville.syrjala@...ux.intel.com>
Cc:     Jani Nikula <jani.nikula@...ux.intel.com>,
        Joonas Lahtinen <joonas.lahtinen@...ux.intel.com>,
        Rodrigo Vivi <rodrigo.vivi@...el.com>,
        David Airlie <airlied@...ux.ie>,
        intel-gfx@...ts.freedesktop.org, dri-devel@...ts.freedesktop.org,
        kernel-janitors@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [Intel-gfx] [PATCH] drm/i915/guc: remove redundant GEM_BUG_ON
 check

On 11/06/18 17:25, Ville Syrjälä wrote:
> On Mon, Jun 11, 2018 at 05:00:37PM +0100, Colin King wrote:
>> From: Colin Ian King <colin.king@...onical.com>
>>
>> The check for level being less than zero is redundant as level
>> is an unsigned u32 and hence will never be less than zero.
>> Remove this redundant check.
>>
>> Detected by CoverityScan, CID#1468363 ("Macro compares unsigned to 0")
>>
>> Signed-off-by: Colin Ian King <colin.king@...onical.com>
>> ---
>>  drivers/gpu/drm/i915/intel_guc.c | 2 --
>>  1 file changed, 2 deletions(-)
>>
>> diff --git a/drivers/gpu/drm/i915/intel_guc.c b/drivers/gpu/drm/i915/intel_guc.c
>> index 116f4ccf1bbd..a2f782a4f97d 100644
>> --- a/drivers/gpu/drm/i915/intel_guc.c
>> +++ b/drivers/gpu/drm/i915/intel_guc.c
>> @@ -208,8 +208,6 @@ static u32 get_log_control_flags(void)
>>  	u32 level = i915_modparams.guc_log_level;
>>  	u32 flags = 0;
>>  
>> -	GEM_BUG_ON(level < 0);
> 
> i915_modparams.guc_log_level is a signed int. So s/u32/int would seem
> like a better fix.

Good point, I somehow thought it  guc_loc_level was unsigned, but I was
wrong. Sending a V2.

> 
>> -
>>  	if (!GUC_LOG_LEVEL_IS_ENABLED(level))
>>  		flags |= GUC_LOG_DEFAULT_DISABLED;
>>  
>> -- 
>> 2.17.0
>>
>> _______________________________________________
>> Intel-gfx mailing list
>> Intel-gfx@...ts.freedesktop.org
>> https://lists.freedesktop.org/mailman/listinfo/intel-gfx
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ