[PATCH 2/2] Fix one warning (v2)

Jan Vesely jan.vesely at rutgers.edu
Tue Apr 28 07:43:43 PDT 2015


On Mon, 2015-04-27 at 10:29 +0800, Jammy Zhou wrote:
> xf86drm.c:356:2: warning: comparison of unsigned expression >= 0 is always true [-Wtype-limits]
>   group = (serv_group >= 0) ? serv_group : DRM_DEV_GID;
>   ^
> 
> v2: do 'int' cast to fix the warning
> 
> Signed-off-by: Jammy Zhou <Jammy.Zhou at amd.com>

FWIW
Reviewed-by: Jan Vesely <jan.vesely at rutgers.edu>

Emil, are you OK with this approach?

> ---
>  xf86drm.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/xf86drm.c b/xf86drm.c
> index 4d67861..4ecb24f 100644
> --- a/xf86drm.c
> +++ b/xf86drm.c
> @@ -353,7 +353,7 @@ static int drmOpenDevice(dev_t dev, int minor, int type)
>      }
>  
>      if (drm_server_info) {
> -	group = (serv_group >= 0) ? serv_group : DRM_DEV_GID;
> +	group = ((int)serv_group >= 0) ? serv_group : DRM_DEV_GID;
>  	chown_check_return(buf, user, group);
>  	chmod(buf, devmode);
>      }

-- 
Jan Vesely <jan.vesely at rutgers.edu>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: This is a digitally signed message part
URL: <http://lists.freedesktop.org/archives/dri-devel/attachments/20150428/4a23ab1a/attachment-0001.sig>


More information about the dri-devel mailing list