RE: [PATCH] string.h: Mark 34 functions with __must_check

2019-10-10 Thread David Laight
From: David Sterba > Sent: 10 October 2019 15:28 ... > > Can we pick a style and enforce it via checkpatch? (It's probably not > > fun to check for each function attribute in > > include/linux/compiler_attributes.h). > > Anything that has the return type, attributes and function name on one > line

Re: [PATCH] string.h: Mark 34 functions with __must_check

2019-10-10 Thread Joe Perches
On Thu, 2019-10-10 at 16:27 +0200, David Sterba wrote: > On Wed, Oct 09, 2019 at 10:33:45AM -0700, Nick Desaulniers wrote: > > On Wed, Oct 9, 2019 at 9:38 AM Joe Perches wrote: > > > I believe __must_check is best placed before the return type as > > > that makes grep for function return type easi

Re: [PATCH] string.h: Mark 34 functions with __must_check

2019-10-10 Thread David Sterba
On Wed, Oct 09, 2019 at 10:33:45AM -0700, Nick Desaulniers wrote: > On Wed, Oct 9, 2019 at 9:38 AM Joe Perches wrote: > > > > On Wed, 2019-10-09 at 09:13 -0700, Nick Desaulniers wrote: > > > On Wed, Oct 9, 2019 at 8:09 AM Steven Rostedt wrote: > > > > On Wed, 9 Oct 2019 14:14:28 +0200 Markus Elfr

Re: [PATCH] string.h: Mark 34 functions with __must_check

2019-10-10 Thread Rasmus Villemoes
On 09/10/2019 18.31, Nick Desaulniers wrote: > On Wed, Oct 9, 2019 at 7:30 AM Dan Carpenter wrote: >> >> On Wed, Oct 09, 2019 at 04:21:20PM +0200, Rasmus Villemoes wrote: >>> On 09/10/2019 15.56, Dan Carpenter wrote: That's because glibc strlen is annotated with __attribute_pure__ which

Re: [PATCH] string.h: Mark 34 functions with __must_check

2019-10-09 Thread Dan Carpenter
On Wed, Oct 09, 2019 at 09:31:41AM -0700, Nick Desaulniers wrote: > On Wed, Oct 9, 2019 at 7:30 AM Dan Carpenter wrote: > > > > On Wed, Oct 09, 2019 at 04:21:20PM +0200, Rasmus Villemoes wrote: > > > On 09/10/2019 15.56, Dan Carpenter wrote: > > > > That's because glibc strlen is annotated with __

Re: [PATCH] string.h: Mark 34 functions with __must_check

2019-10-09 Thread Nick Desaulniers
On Wed, Oct 9, 2019 at 9:38 AM Joe Perches wrote: > > On Wed, 2019-10-09 at 09:13 -0700, Nick Desaulniers wrote: > > On Wed, Oct 9, 2019 at 8:09 AM Steven Rostedt wrote: > > > On Wed, 9 Oct 2019 14:14:28 +0200 Markus Elfring > > > wrote: > [] > > > > Several functions return values with which u

Re: [PATCH] string.h: Mark 34 functions with __must_check

2019-10-09 Thread Nick Desaulniers
On Wed, Oct 9, 2019 at 9:27 AM Steven Rostedt wrote: > > On Wed, 9 Oct 2019 09:13:17 -0700 > Nick Desaulniers wrote: > > > On Wed, Oct 9, 2019 at 8:09 AM Steven Rostedt wrote: > > > > > > I'm curious. How many warnings showed up when you applied this patch? > > > > I got zero for x86_64 and arm6

Re: [PATCH] string.h: Mark 34 functions with __must_check

2019-10-09 Thread Joe Perches
On Wed, 2019-10-09 at 09:13 -0700, Nick Desaulniers wrote: > On Wed, Oct 9, 2019 at 8:09 AM Steven Rostedt wrote: > > On Wed, 9 Oct 2019 14:14:28 +0200 Markus Elfring > > wrote: [] > > > Several functions return values with which useful data processing > > > should be performed. These values mus

Re: [PATCH] string.h: Mark 34 functions with __must_check

2019-10-09 Thread Nick Desaulniers
On Wed, Oct 9, 2019 at 6:26 AM Rasmus Villemoes wrote: > > On 09/10/2019 14.14, Markus Elfring wrote: > > From: Markus Elfring > > Date: Wed, 9 Oct 2019 13:53:59 +0200 > > > > Several functions return values with which useful data processing > > should be performed. These values must not be ignor

Re: [PATCH] string.h: Mark 34 functions with __must_check

2019-10-09 Thread Nick Desaulniers
On Wed, Oct 9, 2019 at 7:30 AM Dan Carpenter wrote: > > On Wed, Oct 09, 2019 at 04:21:20PM +0200, Rasmus Villemoes wrote: > > On 09/10/2019 15.56, Dan Carpenter wrote: > > > That's because glibc strlen is annotated with __attribute_pure__ which > > > means it has no side effects. > > > > I know, e

Re: [PATCH] string.h: Mark 34 functions with __must_check

2019-10-09 Thread Steven Rostedt
On Wed, 9 Oct 2019 09:13:17 -0700 Nick Desaulniers wrote: > On Wed, Oct 9, 2019 at 8:09 AM Steven Rostedt wrote: > > > > On Wed, 9 Oct 2019 14:14:28 +0200 > > Markus Elfring wrote: > > > > > From: Markus Elfring > > > Date: Wed, 9 Oct 2019 13:53:59 +0200 > > > > > > Several functions return

Re: [PATCH] string.h: Mark 34 functions with __must_check

2019-10-09 Thread Nick Desaulniers
On Wed, Oct 9, 2019 at 8:09 AM Steven Rostedt wrote: > > On Wed, 9 Oct 2019 14:14:28 +0200 > Markus Elfring wrote: > > > From: Markus Elfring > > Date: Wed, 9 Oct 2019 13:53:59 +0200 > > > > Several functions return values with which useful data processing > > should be performed. These values m

Re: [PATCH] string.h: Mark 34 functions with __must_check

2019-10-09 Thread Steven Rostedt
On Wed, 9 Oct 2019 14:14:28 +0200 Markus Elfring wrote: > From: Markus Elfring > Date: Wed, 9 Oct 2019 13:53:59 +0200 > > Several functions return values with which useful data processing > should be performed. These values must not be ignored then. > Thus use the annotation “__must_check” in t

Re: [PATCH] string.h: Mark 34 functions with __must_check

2019-10-09 Thread Dan Carpenter
On Wed, Oct 09, 2019 at 04:21:20PM +0200, Rasmus Villemoes wrote: > On 09/10/2019 15.56, Dan Carpenter wrote: > > That's because glibc strlen is annotated with __attribute_pure__ which > > means it has no side effects. > > I know, except it has nothing to do with glibc headers. Just try the > same

Re: [PATCH] string.h: Mark 34 functions with __must_check

2019-10-09 Thread Rasmus Villemoes
On 09/10/2019 15.56, Dan Carpenter wrote: > [ I haven't reviewed the original patch ] > > On Wed, Oct 09, 2019 at 03:26:18PM +0200, Rasmus Villemoes wrote: >> On 09/10/2019 14.14, Markus Elfring wrote: >>> From: Markus Elfring >>> Date: Wed, 9 Oct 2019 13:53:59 +0200 >>> >>> Several functions ret

Re: [PATCH] string.h: Mark 34 functions with __must_check

2019-10-09 Thread Dan Carpenter
[ I haven't reviewed the original patch ] On Wed, Oct 09, 2019 at 03:26:18PM +0200, Rasmus Villemoes wrote: > On 09/10/2019 14.14, Markus Elfring wrote: > > From: Markus Elfring > > Date: Wed, 9 Oct 2019 13:53:59 +0200 > > > > Several functions return values with which useful data processing > >

Re: [PATCH] string.h: Mark 34 functions with __must_check

2019-10-09 Thread Rasmus Villemoes
On 09/10/2019 14.14, Markus Elfring wrote: > From: Markus Elfring > Date: Wed, 9 Oct 2019 13:53:59 +0200 > > Several functions return values with which useful data processing > should be performed. These values must not be ignored then. > Thus use the annotation “__must_check” in the shown functi

[PATCH] string.h: Mark 34 functions with __must_check

2019-10-09 Thread Markus Elfring
From: Markus Elfring Date: Wed, 9 Oct 2019 13:53:59 +0200 Several functions return values with which useful data processing should be performed. These values must not be ignored then. Thus use the annotation “__must_check” in the shown function declarations. Add also corresponding parameter name