From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751673AbbLUUQb (ORCPT ); Mon, 21 Dec 2015 15:16:31 -0500 Received: from mx1.redhat.com ([209.132.183.28]:33106 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751566AbbLUUQa (ORCPT ); Mon, 21 Dec 2015 15:16:30 -0500 Subject: Re: [PATCH 1/1] staging: android: ion: fixes spars warning cast to restricted gfp_t To: Bijosh Thykkoottathil , gregkh@linuxfoundation.org, arve@android.com, riandrews@android.com References: <1450697079-31849-1-git-send-email-bjosh.thyks@gmail.com> Cc: mitchelh@codeaurora.org, sumit.semwal@linaro.org, linux-kernel@vger.kernel.org From: Laura Abbott Message-ID: <56785E1B.4090001@redhat.com> Date: Mon, 21 Dec 2015 12:16:27 -0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.4.0 MIME-Version: 1.0 In-Reply-To: <1450697079-31849-1-git-send-email-bjosh.thyks@gmail.com> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 12/21/2015 03:24 AM, Bijosh Thykkoottathil wrote: > From: Bijosh Thykkoottathil > > 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 > --- > 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