[<prev] [next>] [day] [month] [year] [list]
Message-ID: <CACVxJT90gx7c2E4F-c54jvKTvxNDwj7P2076u7covk9h8fmY8A@mail.gmail.com>
Date: Thu, 30 Apr 2015 13:54:32 +0300
From: Alexey Dobriyan <adobriyan@...il.com>
To: fabf@...net.be, swhiteho@...hat.com
Cc: Linux Kernel <linux-kernel@...r.kernel.org>
Subject: Re: [RFC 1/1 linux-next] gfs2: convert simple_str to kstr
[cc linux-kernel]
On Thu, Apr 30, 2015 at 1:53 PM, Alexey Dobriyan <adobriyan@...il.com> wrote:
>> By default I used destination type as a reference. Maybe it's wrong and
>> we really want to read long, unsigned long from source ?
>
> long and unsigned long -- no. Always look at type of data.
> There are many places where unsigned long is needlessly
> used because there is no simple_strtoint().
>
> Your patch is OK except block_store() wdack_store() chunks:
>
>> @@ static ssize_t block_store(struct gfs2_sbd *sdp, const char *buf, size_t len)
>> ssize_t ret = len;
>> - int val;
>> + int val, error;
>
> There is no need to add second "error" variable and
> there is no need for it to be ssize_t:
>
> int ret;
>
> ret = kstrtoint();
> if (ret < 0)
> return ret;
> if (val == 1)
> ...
> else if (val == 0)
> ...
> else
> return -EINVAL;
> return len;
>
> Overall, this code is exactly code kstrto*() was designed for.
--
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