Re: [PATCH] kernel/params.c: make use of unused but set variable

2015-06-16 Thread Tejun Heo
Hello, Rusty. On Mon, Jun 15, 2015 at 05:19:26AM +0930, Rusty Russell wrote: > Oh. Perhaps my sense of humour is miscalibrated. Heh, prolly mine was. Sorry if I came off as aggressive. > === > Subject: params: suppress unused variable error, warn once just in case code > changes. > > It shou

Re: [PATCH] kernel/params.c: make use of unused but set variable

2015-06-14 Thread Rusty Russell
Tejun Heo writes: > On Fri, Jun 12, 2015 at 10:57:24AM +0930, Rusty Russell wrote: >> Linus Torvalds writes: >> > On Sun, Jun 7, 2015 at 5:00 PM, Tejun Heo wrote: >> > At most, it could be a "WARN_ON_ONCE()". Maybe even just silently >> > ignore the error. But BUG_ON()? Hell no. >> >> Yeah, in

Re: [PATCH] kernel/params.c: make use of unused but set variable

2015-06-11 Thread Louis Langholtz
Hi Tejun, On Jun 10, 2015, at 7:54 PM, Tejun Heo wrote: > Hey, Louis. > > On Wed, Jun 10, 2015 at 11:05:21AM -0600, Louis Langholtz wrote: >> The underlying code for sysfs_create_file does call WARN to warn about >> any errors. So it's not like the code is totally silent anyway. Then the >> un

Re: [PATCH] kernel/params.c: make use of unused but set variable

2015-06-11 Thread Tejun Heo
On Fri, Jun 12, 2015 at 10:57:24AM +0930, Rusty Russell wrote: > Linus Torvalds writes: > > On Sun, Jun 7, 2015 at 5:00 PM, Tejun Heo wrote: > > At most, it could be a "WARN_ON_ONCE()". Maybe even just silently > > ignore the error. But BUG_ON()? Hell no. > > Yeah, in practice it's already (1) p

Re: [PATCH] kernel/params.c: make use of unused but set variable

2015-06-11 Thread Rusty Russell
Linus Torvalds writes: > On Sun, Jun 7, 2015 at 5:00 PM, Tejun Heo wrote: > At most, it could be a "WARN_ON_ONCE()". Maybe even just silently > ignore the error. But BUG_ON()? Hell no. Yeah, in practice it's already (1) paniced if we ran out of memory, or (2) warned if we somehow tried to create

Re: [PATCH] kernel/params.c: make use of unused but set variable

2015-06-10 Thread Tejun Heo
Hey, Louis. On Wed, Jun 10, 2015 at 11:05:21AM -0600, Louis Langholtz wrote: > The underlying code for sysfs_create_file does call WARN to warn about > any errors. So it's not like the code is totally silent anyway. Then the > unused Not any errors. It triggers warning on missing ops and dup fi

Re: [PATCH] kernel/params.c: make use of unused but set variable

2015-06-10 Thread Louis Langholtz
On Jun 7, 2015, at 6:58 PM, Tejun Heo wrote: > On Sun, Jun 07, 2015 at 05:17:20PM -0700, Linus Torvalds wrote: >> At most, it could be a "WARN_ON_ONCE()". Maybe even just silently >> ignore the error. But BUG_ON()? Hell no. > > Yeah, WARN_ON_ONCE() is the right one... > > -- > tejun On furthe

Re: [PATCH] kernel/params.c: make use of unused but set variable

2015-06-07 Thread Louis Langholtz
On Jun 7, 2015, at 6:17 PM, Linus Torvalds wrote: > On Sun, Jun 7, 2015 at 5:00 PM, Tejun Heo wrote: >> On Sun, Jun 07, 2015 at 05:54:30PM -0600, Louis Langholtz wrote: >>> @@ -853,6 +853,7 @@ static void __init version_sysfs_builtin(void) >>> mk = locate_module_kobject(vattr->modu

Re: [PATCH] kernel/params.c: make use of unused but set variable

2015-06-07 Thread Tejun Heo
On Sun, Jun 07, 2015 at 05:17:20PM -0700, Linus Torvalds wrote: > At most, it could be a "WARN_ON_ONCE()". Maybe even just silently > ignore the error. But BUG_ON()? Hell no. Yeah, WARN_ON_ONCE() is the right one. The short history here is that sysfs_create_file() has __must_check on it which tri

[PATCH] kernel/params.c: make use of unused but set variable

2015-06-07 Thread Louis Langholtz
While Rusty Russell wants the return value of sysfs_create_file ignored, it's annotated '__must_check'. Tejun Heo made the annotaion and suggests just using BUG_ON(). Meanwhile the compiler warns that the 'err' variable is set but unused. This patch uses Tejun's suggestion. This eliminates the warn

Re: [PATCH] kernel/params.c: make use of unused but set variable

2015-06-07 Thread Linus Torvalds
On Sun, Jun 7, 2015 at 5:00 PM, Tejun Heo wrote: > On Sun, Jun 07, 2015 at 05:54:30PM -0600, Louis Langholtz wrote: >> @@ -853,6 +853,7 @@ static void __init version_sysfs_builtin(void) >> mk = locate_module_kobject(vattr->module_name); >> if (mk) { >>

Re: [PATCH] kernel/params.c: make use of unused but set variable

2015-06-07 Thread Tejun Heo
On Sun, Jun 07, 2015 at 05:54:30PM -0600, Louis Langholtz wrote: > While Rusty Russell wants the return value of sysfs_create_file > ignored, it's annotated '__must_check'. Tejun Heo made the annotaion > and suggests just using BUG_ON(). Meanwhile the compiler warns that > the 'err' variable is set