From: Pan Xinhui <xinhuix.pan@intel.com>
To: Frans Klaver <fransklaver@gmail.com>
Cc: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
Yury Norov <yury.norov@gmail.com>,
Andrew Morton <akpm@linux-foundation.org>,
Rasmus Villemoes <linux@rasmusvillemoes.dk>,
tj@kernel.org, Peter Zijlstra <peterz@infradead.org>,
sudeep.holla@arm.com, mina86@mina86.com,
"mnipxh@163.com" <mnipxh@163.com>,
Alexey Klimov <klimov.linux@gmail.com>,
"yanmin_zhang@linux.intel.com" <yanmin_zhang@linux.intel.com>
Subject: Re: [PATCH V2] lib/bitmap.c: fix some parsing issues and code style
Date: Wed, 01 Jul 2015 14:25:35 +0800 [thread overview]
Message-ID: <559387DF.9050606@intel.com> (raw)
In-Reply-To: <CAH6sp9PLNEQHHT_ETDrYkDZpV3pDj9iK3zpLqn=VyQ0jTv4B6Q@mail.gmail.com>
hello, Frans
thanks for your reply :)
On 2015年07月01日 14:17, Frans Klaver wrote:
> On Wed, Jul 1, 2015 at 6:15 AM, Pan Xinhui <xinhuix.pan@intel.com> wrote:
>>
>> In __bitmap_parselist we can accept whitespaces on head or tail
>> during every parsing procedure.
>> If input has valid ranges, there is no reason to reject the user.
>>
>> fixes are:
>> 1) if input ends with ',', bit 0 might be set unexpectedly.
>> now we check if any digit is available after every loop.
>> 2) if input has '0-', bit 0 might be set unexpectedly,
>> now we return -EINVAL as this kind of input is definitely wrong.
>> 3) minor code style fix in __bitmap_parse.
>> and avoid in-loop incrementation of ndigits.
>
> Why not three patches, so it becomes easier to see which is which?
>
your advice sounds good, I will have a try. and welcome for review. :)
thanks.
>
>> commit 2528a8b also add some check, but it's still not enough.
>> it only correct the result in fix 1 above.
>
> I believe the convention is to have at least 12 characters of the
> sha1, with the title behind it: 2528a8b8f457 (__bitmap_parselist: fix
> bug in empty string handling). Using only seven characters still risks
> collisions.
>
sorry for my lack knowledge of comment rules. thanks for pointing out my mistakes.
thanks
xinhui
> Thanks,
> Frans
>
next prev parent reply other threads:[~2015-07-01 6:28 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-07-01 3:14 [PATCH] lib/bitmap.c: fix some parsing issues and code style Pan Xinhui
2015-07-01 4:15 ` [PATCH V2] " Pan Xinhui
2015-07-01 6:17 ` Frans Klaver
2015-07-01 6:25 ` Pan Xinhui [this message]
2015-07-01 6:35 ` Frans Klaver
2015-07-01 7:59 ` [PATCH 1/3] lib/bitmap.c: correct a code style and do some optimization in __bitmap_parse Pan Xinhui
2015-07-01 8:01 ` [PATCH 3/3] lib/bitmap.c: bitmap_parselist can accept string with whitespaces on head or tail Pan Xinhui
2015-07-01 8:00 ` [PATCH 2/3] lib/bitmap.c: fix a special string handling bug in __bitmap_parselist Pan Xinhui
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=559387DF.9050606@intel.com \
--to=xinhuix.pan@intel.com \
--cc=akpm@linux-foundation.org \
--cc=fransklaver@gmail.com \
--cc=klimov.linux@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@rasmusvillemoes.dk \
--cc=mina86@mina86.com \
--cc=mnipxh@163.com \
--cc=peterz@infradead.org \
--cc=sudeep.holla@arm.com \
--cc=tj@kernel.org \
--cc=yanmin_zhang@linux.intel.com \
--cc=yury.norov@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox