Re: [Cocci] [PATCH 2/2] tree-wide: rename vmemdup_user to kvmemdup_user

2020-08-15 Thread Matthew Wilcox
On Sat, Aug 15, 2020 at 03:10:12PM +0200, Markus Elfring wrote: > > This helper uses kvmalloc, not vmalloc, so rename it to kvmemdup_user to > > make it clear we're using kvmalloc() and will need to use kvfree(). > > Can the renaming of this function name trigger software updates > for any more

Re: [Cocci] [PATCH v3] Documentation: Coccinelle: fix various typos etc.

2020-07-02 Thread Matthew Wilcox
On Thu, Jul 02, 2020 at 08:56:24AM +0200, Markus Elfring wrote: > … > > +++ linux-next-20200629/Documentation/dev-tools/coccinelle.rst > … > > @@ -260,13 +260,13 @@ If not using the kernel's coccicheck tar > … > > -We help Coccinelle when used against Linux with a set of sensible defaults > > +We

Re: [Cocci] [v2] Documentation: Coccinelle: fix typos and command example

2020-07-01 Thread Matthew Wilcox
On Wed, Jul 01, 2020 at 07:52:58AM -0700, Randy Dunlap wrote: > On 7/1/20 6:32 AM, Markus Elfring wrote: > >>> How do you think about to use the following command variant > >>> for the adjustment of the software documentation? > >>> > >>> +make C=1 CHECK='scripts/coccicheck' 'path/to/file.o' >

Re: [Cocci] [PATCH 2/2] mm: Add kvmalloc_ab_c and kvzalloc_struct

2018-04-30 Thread Matthew Wilcox
On Mon, Apr 30, 2018 at 11:29:04PM +0200, Rasmus Villemoes wrote: > On 2018-04-30 22:16, Matthew Wilcox wrote: > > On Mon, Apr 30, 2018 at 12:02:14PM -0700, Kees Cook wrote: > >> (I just wish C had a sensible way to catch overflow...) > > > > Every CPU I ever wor

Re: [Cocci] [PATCH 2/2] mm: Add kvmalloc_ab_c and kvzalloc_struct

2018-04-30 Thread Matthew Wilcox
On Mon, Apr 30, 2018 at 12:02:14PM -0700, Kees Cook wrote: > On Sun, Apr 29, 2018 at 1:30 PM, Matthew Wilcox <wi...@infradead.org> wrote: > > On Sun, Apr 29, 2018 at 09:59:27AM -0700, Kees Cook wrote: > >> Did this ever happen? > > > > Not yet. I bro

Re: [Cocci] [PATCH 2/2] mm: Add kvmalloc_ab_c and kvzalloc_struct

2018-04-29 Thread Matthew Wilcox
On Sun, Apr 29, 2018 at 09:59:27AM -0700, Kees Cook wrote: > Did this ever happen? Not yet. I brought it up at LSFMM, and I'll repost the patches soon. > I'd also like to see kmalloc_array_3d() or > something that takes three size arguments. We have a lot of this > pattern too: > >

Re: [Cocci] [PATCH 2/2] mm: Add kvmalloc_ab_c and kvzalloc_struct

2018-03-13 Thread Matthew Wilcox
On Tue, Mar 13, 2018 at 06:19:51PM +0100, Julia Lawall wrote: > On Thu, 8 Mar 2018, Matthew Wilcox wrote: > > On Thu, Mar 08, 2018 at 07:24:47AM +0100, Julia Lawall wrote: > > > Thanks. So it's OK to replace kmalloc and kzalloc, even though they > > > didn't previousl

Re: [Cocci] [PATCH 2/2] mm: Add kvmalloc_ab_c and kvzalloc_struct

2018-03-08 Thread Matthew Wilcox
On Thu, Mar 08, 2018 at 07:24:47AM +0100, Julia Lawall wrote: > On Wed, 7 Mar 2018, Matthew Wilcox wrote: > > On Wed, Mar 07, 2018 at 10:18:21PM +0100, Julia Lawall wrote: > > > > Otherwise, yes, please. We could build a coccinelle rule for > >

Re: [Cocci] [PATCH 2/2] mm: Add kvmalloc_ab_c and kvzalloc_struct

2018-03-07 Thread Matthew Wilcox
On Wed, Mar 07, 2018 at 10:18:21PM +0100, Julia Lawall wrote: > > Otherwise, yes, please. We could build a coccinelle rule for > > additional replacements... > > A potential semantic patch and the changes it generates are attached > below. Himanshu Jha helped with its development. Working on

Re: [Cocci] [PATCH 2/2] mm: Add kvmalloc_ab_c and kvzalloc_struct

2018-02-17 Thread Matthew Wilcox
On Wed, Feb 14, 2018 at 11:22:38AM -0800, Kees Cook wrote: > > +/** > > + * kvmalloc_ab_c() - Allocate memory. > > Longer description, maybe? "Allocate a *b + c bytes of memory"? Done! > > + * @n: Number of elements. > > + * @size: Size of each element (should be constant). > > + * @c: Size of