Re: dm snapshot: Use kmalloc_array() in init_origin_hash() ?

2016-09-30 Thread SF Markus Elfring
> I've recently ping-ponged with the kernel's "resident wrong bot of the > day" over this very rule (kmalloc_array() is safer than kmalloc(), so > change your driver now!). Your bot of the day is going to point more update candidates out in various source files that can "accidentally" belong also

Re: dm snapshot: Use kmalloc_array() in init_origin_hash() ?

2016-09-30 Thread SF Markus Elfring
> I've recently ping-ponged with the kernel's "resident wrong bot of the > day" over this very rule (kmalloc_array() is safer than kmalloc(), so > change your driver now!). Your bot of the day is going to point more update candidates out in various source files that can "accidentally" belong also

Re: [PATCH 01/10] dm snapshot: Use kmalloc_array() in init_origin_hash()

2016-09-29 Thread Paul Bolle
On Thu, 2016-09-29 at 14:21 -0700, Joe Perches wrote: > > > It doesn't matter match either way to me. > > Why does this stop you fixing an apparently wrong checkpatch rule, > > crude as parts of it are (ie, uppercase identifier must be a > > constant)? > > It doesn't.  It just doesn't matter much

Re: [PATCH 01/10] dm snapshot: Use kmalloc_array() in init_origin_hash()

2016-09-29 Thread Paul Bolle
On Thu, 2016-09-29 at 14:21 -0700, Joe Perches wrote: > > > It doesn't matter match either way to me. > > Why does this stop you fixing an apparently wrong checkpatch rule, > > crude as parts of it are (ie, uppercase identifier must be a > > constant)? > > It doesn't.  It just doesn't matter much

Re: [PATCH 01/10] dm snapshot: Use kmalloc_array() in init_origin_hash()

2016-09-29 Thread Joe Perches
On Thu, 2016-09-29 at 23:14 +0200, Paul Bolle wrote: > On Thu, 2016-09-29 at 13:56 -0700, Joe Perches wrote: > > It doesn't matter match either way to me. > Why does this stop you fixing an apparently wrong checkpatch rule, > crude as parts of it are (ie, uppercase identifier must be a constant)?

Re: [PATCH 01/10] dm snapshot: Use kmalloc_array() in init_origin_hash()

2016-09-29 Thread Joe Perches
On Thu, 2016-09-29 at 23:14 +0200, Paul Bolle wrote: > On Thu, 2016-09-29 at 13:56 -0700, Joe Perches wrote: > > It doesn't matter match either way to me. > Why does this stop you fixing an apparently wrong checkpatch rule, > crude as parts of it are (ie, uppercase identifier must be a constant)?

Re: [PATCH 01/10] dm snapshot: Use kmalloc_array() in init_origin_hash()

2016-09-29 Thread Paul Bolle
On Thu, 2016-09-29 at 13:56 -0700, Joe Perches wrote: > It doesn't matter match either way to me. > > The case for the unnecessary multiply with <= gcc 4.8 was > removed with: > > commit 91c6a05f72a996bee5133e76374ab3ad7d3b9b72 > Author: Alexey Dobriyan > Date:   Tue Jul 26

Re: [PATCH 01/10] dm snapshot: Use kmalloc_array() in init_origin_hash()

2016-09-29 Thread Paul Bolle
On Thu, 2016-09-29 at 13:56 -0700, Joe Perches wrote: > It doesn't matter match either way to me. > > The case for the unnecessary multiply with <= gcc 4.8 was > removed with: > > commit 91c6a05f72a996bee5133e76374ab3ad7d3b9b72 > Author: Alexey Dobriyan > Date:   Tue Jul 26 15:22:08 2016 -0700

Re: [PATCH 01/10] dm snapshot: Use kmalloc_array() in init_origin_hash()

2016-09-29 Thread Joe Perches
On Thu, 2016-09-29 at 22:39 +0200, Paul Bolle wrote: > On Thu, 2016-09-29 at 13:24 -0700, Joe Perches wrote: > > On Thu, 2016-09-29 at 21:43 +0200, Paul Bolle wrote: > > > Why doesn't that regex match on "ORIGIN_HASH_SIZE"? > > It does match. > If that regex does match, it being part of a negative

Re: [PATCH 01/10] dm snapshot: Use kmalloc_array() in init_origin_hash()

2016-09-29 Thread Joe Perches
On Thu, 2016-09-29 at 22:39 +0200, Paul Bolle wrote: > On Thu, 2016-09-29 at 13:24 -0700, Joe Perches wrote: > > On Thu, 2016-09-29 at 21:43 +0200, Paul Bolle wrote: > > > Why doesn't that regex match on "ORIGIN_HASH_SIZE"? > > It does match. > If that regex does match, it being part of a negative

Re: [PATCH 01/10] dm snapshot: Use kmalloc_array() in init_origin_hash()

2016-09-29 Thread Paul Bolle
On Thu, 2016-09-29 at 13:24 -0700, Joe Perches wrote: > On Thu, 2016-09-29 at 21:43 +0200, Paul Bolle wrote: > > Why doesn't that regex match on "ORIGIN_HASH_SIZE"? > > It does match. If that regex does match, it being part of a negative test, the specific checkpatch rule should be silent,

Re: [PATCH 01/10] dm snapshot: Use kmalloc_array() in init_origin_hash()

2016-09-29 Thread Paul Bolle
On Thu, 2016-09-29 at 13:24 -0700, Joe Perches wrote: > On Thu, 2016-09-29 at 21:43 +0200, Paul Bolle wrote: > > Why doesn't that regex match on "ORIGIN_HASH_SIZE"? > > It does match. If that regex does match, it being part of a negative test, the specific checkpatch rule should be silent,

Re: [PATCH 01/10] dm snapshot: Use kmalloc_array() in init_origin_hash()

2016-09-29 Thread Joe Perches
On Thu, 2016-09-29 at 21:43 +0200, Paul Bolle wrote: > On Thu, 2016-09-29 at 08:01 -0700, Joe Perches wrote: > > $Constant there is any number and the match regex is > > any upper case variable. > Why doesn't that regex match on "ORIGIN_HASH_SIZE"? It does match. Did you see my earlier email? $

Re: [PATCH 01/10] dm snapshot: Use kmalloc_array() in init_origin_hash()

2016-09-29 Thread Joe Perches
On Thu, 2016-09-29 at 21:43 +0200, Paul Bolle wrote: > On Thu, 2016-09-29 at 08:01 -0700, Joe Perches wrote: > > $Constant there is any number and the match regex is > > any upper case variable. > Why doesn't that regex match on "ORIGIN_HASH_SIZE"? It does match. Did you see my earlier email? $

Re: [PATCH 01/10] dm snapshot: Use kmalloc_array() in init_origin_hash()

2016-09-29 Thread Paul Bolle
On Thu, 2016-09-29 at 08:01 -0700, Joe Perches wrote: > $Constant there is any number and the match regex is > any upper case variable. Why doesn't that regex match on "ORIGIN_HASH_SIZE"? Paul Bolle

Re: [PATCH 01/10] dm snapshot: Use kmalloc_array() in init_origin_hash()

2016-09-29 Thread Paul Bolle
On Thu, 2016-09-29 at 08:01 -0700, Joe Perches wrote: > $Constant there is any number and the match regex is > any upper case variable. Why doesn't that regex match on "ORIGIN_HASH_SIZE"? Paul Bolle

Re: [PATCH 01/10] dm snapshot: Use kmalloc_array() in init_origin_hash()

2016-09-29 Thread Joe Perches
On Thu, 2016-09-29 at 13:45 +0200, Paul Bolle wrote: > On Thu, 2016-09-29 at 13:12 +0200, Paul Bolle wrote: > > Or did I misread that test? > I finally did some digging: commit e367455a9f25 ("checkpatch: emit > fewer kmalloc_array/kcalloc conversion warnings") shows I didn't. You still misread it

Re: [PATCH 01/10] dm snapshot: Use kmalloc_array() in init_origin_hash()

2016-09-29 Thread Joe Perches
On Thu, 2016-09-29 at 13:45 +0200, Paul Bolle wrote: > On Thu, 2016-09-29 at 13:12 +0200, Paul Bolle wrote: > > Or did I misread that test? > I finally did some digging: commit e367455a9f25 ("checkpatch: emit > fewer kmalloc_array/kcalloc conversion warnings") shows I didn't. You still misread it

Re: dm snapshot: Use kmalloc_array() in init_origin_hash()

2016-09-29 Thread Theodore Ts'o
On Thu, Sep 29, 2016 at 01:45:41PM +0200, SF Markus Elfring wrote: > > We have no hope of fixing Markus' homegrown coccinelle script. > > I have got an other impression. I see further possibilities > to clarify involved communication and software development challenges > for a few source code

Re: dm snapshot: Use kmalloc_array() in init_origin_hash()

2016-09-29 Thread Theodore Ts'o
On Thu, Sep 29, 2016 at 01:45:41PM +0200, SF Markus Elfring wrote: > > We have no hope of fixing Markus' homegrown coccinelle script. > > I have got an other impression. I see further possibilities > to clarify involved communication and software development challenges > for a few source code

Re: dm snapshot: Use kmalloc_array() in init_origin_hash()

2016-09-29 Thread SF Markus Elfring
> We have no hope of fixing Markus' homegrown coccinelle script. I have got an other impression. I see further possibilities to clarify involved communication and software development challenges for a few source code search patterns. How do you think about to discuss the corresponding collateral

Re: dm snapshot: Use kmalloc_array() in init_origin_hash()

2016-09-29 Thread SF Markus Elfring
> We have no hope of fixing Markus' homegrown coccinelle script. I have got an other impression. I see further possibilities to clarify involved communication and software development challenges for a few source code search patterns. How do you think about to discuss the corresponding collateral

Re: [PATCH 01/10] dm snapshot: Use kmalloc_array() in init_origin_hash()

2016-09-29 Thread Paul Bolle
On Thu, 2016-09-29 at 13:12 +0200, Paul Bolle wrote: > Or did I misread that test? I finally did some digging: commit e367455a9f25 ("checkpatch: emit fewer kmalloc_array/kcalloc conversion warnings") shows I didn't. Paul Bolle

Re: [PATCH 01/10] dm snapshot: Use kmalloc_array() in init_origin_hash()

2016-09-29 Thread Paul Bolle
On Thu, 2016-09-29 at 13:12 +0200, Paul Bolle wrote: > Or did I misread that test? I finally did some digging: commit e367455a9f25 ("checkpatch: emit fewer kmalloc_array/kcalloc conversion warnings") shows I didn't. Paul Bolle

Re: [PATCH 01/10] dm snapshot: Use kmalloc_array() in init_origin_hash()

2016-09-29 Thread Paul Bolle
On Thu, 2016-09-29 at 03:02 -0700, Joe Perches wrote: > What's the false positive? > > I get: > > $ ./scripts/checkpatch.pl -f drivers/md/dm-snap.c --show-types > --types=alloc_with_multiply > WARNING:ALLOC_WITH_MULTIPLY: Prefer kmalloc_array over kmalloc with multiply > #329: FILE:

Re: [PATCH 01/10] dm snapshot: Use kmalloc_array() in init_origin_hash()

2016-09-29 Thread Paul Bolle
On Thu, 2016-09-29 at 03:02 -0700, Joe Perches wrote: > What's the false positive? > > I get: > > $ ./scripts/checkpatch.pl -f drivers/md/dm-snap.c --show-types > --types=alloc_with_multiply > WARNING:ALLOC_WITH_MULTIPLY: Prefer kmalloc_array over kmalloc with multiply > #329: FILE:

Re: [PATCH 01/10] dm snapshot: Use kmalloc_array() in init_origin_hash()

2016-09-29 Thread Joe Perches
On Thu, 2016-09-29 at 11:54 +0200, Paul Bolle wrote: > Andy, Joe, > > On Thu, 2016-09-29 at 11:07 +0200, SF Markus Elfring wrote: > > * Multiplications for the size determination of memory allocations > >   indicated that array data structures should be processed. > >   Thus use the corresponding

Re: [PATCH 01/10] dm snapshot: Use kmalloc_array() in init_origin_hash()

2016-09-29 Thread Joe Perches
On Thu, 2016-09-29 at 11:54 +0200, Paul Bolle wrote: > Andy, Joe, > > On Thu, 2016-09-29 at 11:07 +0200, SF Markus Elfring wrote: > > * Multiplications for the size determination of memory allocations > >   indicated that array data structures should be processed. > >   Thus use the corresponding

Re: [PATCH 01/10] dm snapshot: Use kmalloc_array() in init_origin_hash()

2016-09-29 Thread Paul Bolle
Andy, Joe, On Thu, 2016-09-29 at 11:07 +0200, SF Markus Elfring wrote: > * Multiplications for the size determination of memory allocations >   indicated that array data structures should be processed. >   Thus use the corresponding function "kmalloc_array". > >   This issue was detected by

Re: [PATCH 01/10] dm snapshot: Use kmalloc_array() in init_origin_hash()

2016-09-29 Thread Paul Bolle
Andy, Joe, On Thu, 2016-09-29 at 11:07 +0200, SF Markus Elfring wrote: > * Multiplications for the size determination of memory allocations >   indicated that array data structures should be processed. >   Thus use the corresponding function "kmalloc_array". > >   This issue was detected by

[PATCH 01/10] dm snapshot: Use kmalloc_array() in init_origin_hash()

2016-09-29 Thread SF Markus Elfring
From: Markus Elfring Date: Wed, 28 Sep 2016 22:20:08 +0200 * Multiplications for the size determination of memory allocations indicated that array data structures should be processed. Thus use the corresponding function "kmalloc_array". This issue was

[PATCH 01/10] dm snapshot: Use kmalloc_array() in init_origin_hash()

2016-09-29 Thread SF Markus Elfring
From: Markus Elfring Date: Wed, 28 Sep 2016 22:20:08 +0200 * Multiplications for the size determination of memory allocations indicated that array data structures should be processed. Thus use the corresponding function "kmalloc_array". This issue was detected by using the Coccinelle