[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAEVVKH-RJoghp4Entg6J-mHbJACXcChX466Ws31a4hW5UJmWXA@mail.gmail.com>
Date: Thu, 4 Jan 2018 23:15:50 +0800
From: Xiongwei Song <sxwjean@...il.com>
To: Dan Carpenter <dan.carpenter@...cle.com>
Cc: gregkh@...uxfoundation.org, arve@...roid.com, tkjos@...roid.com,
maco@...roid.com, devel@...verdev.osuosl.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH] staging: android: check the return value of register_shrinker
2018-01-04 22:55 GMT+08:00 Dan Carpenter <dan.carpenter@...cle.com>:
> On Thu, Jan 04, 2018 at 08:08:53AM +0800, Xiongwei Song wrote:
>> register_shrinker call is made in ashmem_init, it may return error code,
>> so we need to check it.
>>
>> Signed-off-by: Xiongwei Song <sxwjean@...il.com>
>> ---
>> drivers/staging/android/ashmem.c | 8 +++++++-
>> 1 file changed, 7 insertions(+), 1 deletion(-)
>>
>> diff --git a/drivers/staging/android/ashmem.c b/drivers/staging/android/ashmem.c
>> index 4e8947923904..0b23c3e25cd4 100644
>> --- a/drivers/staging/android/ashmem.c
>> +++ b/drivers/staging/android/ashmem.c
>> @@ -854,12 +854,18 @@ static int __init ashmem_init(void)
>> goto out_free2;
>> }
>>
>> - register_shrinker(&ashmem_shrinker);
>> + ret = register_shrinker(&ashmem_shrinker);
>> + if (unlikely(ret)) {
>
> Don't add the unlikely() here. It hurts readability and this is not a
> fast path. I know the other callers all have it... :/
OK. Thanks for your suggestion. I'll send v2 out.
Thanks,
Xiongwei
>
> regards,
> dan carpenter
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
Powered by blists - more mailing lists