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: <56785E1B.4090001@redhat.com>
Date:	Mon, 21 Dec 2015 12:16:27 -0800
From:	Laura Abbott <labbott@...hat.com>
To:	Bijosh Thykkoottathil <bijosh.thyks@...il.com>,
	gregkh@...uxfoundation.org, arve@...roid.com, riandrews@...roid.com
Cc:	mitchelh@...eaurora.org, sumit.semwal@...aro.org,
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH 1/1] staging: android: ion: fixes spars warning cast to
 restricted gfp_t

On 12/21/2015 03:24 AM, Bijosh Thykkoottathil wrote:
> From: Bijosh Thykkoottathil <bijosh.thyks@...il.com>
>
> This patch fixes following sparse warnings:
>
> drivers/staging/android/ion/ion.c:1475:21: warning: incorrect type in assignment (different base types)
> drivers/staging/android/ion/ion.c:1475:21:    expected restricted gfp_t [usertype] gfp_mask
> drivers/staging/android/ion/ion.c:1475:21:    got int
> drivers/staging/android/ion/ion.c:1493:21: warning: incorrect type in assignment (different base types)
> drivers/staging/android/ion/ion.c:1493:21:    expected restricted gfp_t [usertype] gfp_mask
> drivers/staging/android/ion/ion.c:1493:21:    got int
>
> Signed-off-by: Bijosh Thykkoottathil <bijosh.thyks@...il.com>
> ---
>   drivers/staging/android/ion/ion.c | 4 ++--
>   1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/staging/android/ion/ion.c b/drivers/staging/android/ion/ion.c
> index e237e9f..f986a58 100644
> --- a/drivers/staging/android/ion/ion.c
> +++ b/drivers/staging/android/ion/ion.c
> @@ -1472,7 +1472,7 @@ static int debug_shrink_set(void *data, u64 val)
>   	struct shrink_control sc;
>   	int objs;
>
> -	sc.gfp_mask = -1;
> +	sc.gfp_mask = (__force gfp_t)(-1);
>   	sc.nr_to_scan = val;

-1 doesn't actually make much sense here. I'd rather see this changed to be an
appropriate GFP flag rather than just casting it away, probably
GFP_HIGHUSER. If you'd like to fix this up, make sure to double check
that the shrinking behavior remains the same (similar number of low and high
pages are reclaimed).

Thanks,
Laura

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ