LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
* Re: [PATCH] staging: fieldbus: anybuss: Remove unnecessary variables
[not found] <20190523063504.10530-1-nishka.dasgupta@yahoo.com>
@ 2019-05-23 7:22 ` Greg KH
[not found] ` <b8cc12d9-2fe3-754b-be08-f23055a31ffe@yahoo.com>
0 siblings, 1 reply; 6+ messages in thread
From: Greg KH @ 2019-05-23 7:22 UTC (permalink / raw)
To: Nishka Dasgupta; +Cc: devel, linux-kernel
On Thu, May 23, 2019 at 12:05:01PM +0530, Nishka Dasgupta wrote:
> In the functions export_reset_0 and export_reset_1 in arcx-anybus.c,
> the only operation performed before return is passing the variable cd
> (which takes the value of a function call on one of the parameters) as
> argument to another function. Hence the variable cd can be removed.
> Issue found using Coccinelle.
>
> Signed-off-by: Nishka Dasgupta <nishka.dasgupta@yahoo.com>
> ---
> drivers/staging/fieldbus/anybuss/arcx-anybus.c | 8 ++------
> 1 file changed, 2 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/staging/fieldbus/anybuss/arcx-anybus.c b/drivers/staging/fieldbus/anybuss/arcx-anybus.c
> index 2ecffa42e561..e245f940a5c4 100644
> --- a/drivers/staging/fieldbus/anybuss/arcx-anybus.c
> +++ b/drivers/staging/fieldbus/anybuss/arcx-anybus.c
> @@ -87,16 +87,12 @@ static int anybuss_reset(struct controller_priv *cd,
>
> static void export_reset_0(struct device *dev, bool assert)
> {
> - struct controller_priv *cd = dev_get_drvdata(dev);
> -
> - anybuss_reset(cd, 0, assert);
> + anybuss_reset(dev_get_drvdata(dev), 0, assert);
> }
While your patch is "correct", it's not the nicest thing. The way the
code looks today is to make it obvious we are passing a pointer to a
struct controller_priv() into anybuss_reset(). But with your change, it
looks like we are passing any random void pointer to it.
So I'd prefer the original code please.
Also, you forgot to cc: Sven on this patch, please always use the output
of scripts/get_maintainer.pl.
thanks,
greg k-h
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] staging: fieldbus: anybuss: Remove unnecessary variables
[not found] ` <b8cc12d9-2fe3-754b-be08-f23055a31ffe@yahoo.com>
@ 2019-05-23 8:27 ` Jeremy Sowden
2019-05-23 9:09 ` Dan Carpenter
2019-05-23 8:42 ` Greg KH
1 sibling, 1 reply; 6+ messages in thread
From: Jeremy Sowden @ 2019-05-23 8:27 UTC (permalink / raw)
To: Nishka Dasgupta; +Cc: Greg KH, devel, linux-kernel
[-- Attachment #1: Type: text/plain, Size: 2366 bytes --]
On 2019-05-23, at 13:51:18 +0530, Nishka Dasgupta wrote:
> On 23/05/19 12:52 PM, Greg KH wrote:
> > On Thu, May 23, 2019 at 12:05:01PM +0530, Nishka Dasgupta wrote:
> > > In the functions export_reset_0 and export_reset_1 in
> > > arcx-anybus.c, the only operation performed before return is
> > > passing the variable cd (which takes the value of a function call
> > > on one of the parameters) as argument to another function. Hence
> > > the variable cd can be removed. Issue found using Coccinelle.
> > >
> > > Signed-off-by: Nishka Dasgupta <nishka.dasgupta@yahoo.com>
> > > ---
> > > drivers/staging/fieldbus/anybuss/arcx-anybus.c | 8 ++------
> > > 1 file changed, 2 insertions(+), 6 deletions(-)
> > >
> > > diff --git a/drivers/staging/fieldbus/anybuss/arcx-anybus.c b/drivers/staging/fieldbus/anybuss/arcx-anybus.c
> > > index 2ecffa42e561..e245f940a5c4 100644
> > > --- a/drivers/staging/fieldbus/anybuss/arcx-anybus.c
> > > +++ b/drivers/staging/fieldbus/anybuss/arcx-anybus.c
> > > @@ -87,16 +87,12 @@ static int anybuss_reset(struct controller_priv *cd,
> > > static void export_reset_0(struct device *dev, bool assert)
> > > {
> > > - struct controller_priv *cd = dev_get_drvdata(dev);
> > > -
> > > - anybuss_reset(cd, 0, assert);
> > > + anybuss_reset(dev_get_drvdata(dev), 0, assert);
> > > }
> >
> > While your patch is "correct", it's not the nicest thing. The way the
> > code looks today is to make it obvious we are passing a pointer to a
> > struct controller_priv() into anybuss_reset(). But with your change, it
> > looks like we are passing any random void pointer to it.
> >
> > So I'd prefer the original code please.
>
> Thank you, I'll drop this patch then.
>
> > Also, you forgot to cc: Sven on this patch, please always use the output
> > of scripts/get_maintainer.pl.
>
> Which arguments should I use? If I use --nokeywords, --nogit,
> --nogit-fallback and --norolestats then only your name and the two
> mailing lists show up. (Also, regarding the mailing lists: every mail
> sent to linux-kernel@vger.kernel.org is bouncing; should I not send to
> that list anymore?)
He is listed in the TODO:
$ cat drivers/staging/fieldbus/TODO
TODO:
-Get more people/drivers to use the Fieldbus userspace ABI. It requires
verification/sign-off by multiple users.
Contact: Sven Van Asbroeck <TheSven73@gmail.com>
J.
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] staging: fieldbus: anybuss: Remove unnecessary variables
[not found] ` <b8cc12d9-2fe3-754b-be08-f23055a31ffe@yahoo.com>
2019-05-23 8:27 ` Jeremy Sowden
@ 2019-05-23 8:42 ` Greg KH
1 sibling, 0 replies; 6+ messages in thread
From: Greg KH @ 2019-05-23 8:42 UTC (permalink / raw)
To: Nishka Dasgupta; +Cc: devel, linux-kernel
On Thu, May 23, 2019 at 01:51:18PM +0530, Nishka Dasgupta wrote:
>
>
> On 23/05/19 12:52 PM, Greg KH wrote:
> > On Thu, May 23, 2019 at 12:05:01PM +0530, Nishka Dasgupta wrote:
> > > In the functions export_reset_0 and export_reset_1 in arcx-anybus.c,
> > > the only operation performed before return is passing the variable cd
> > > (which takes the value of a function call on one of the parameters) as
> > > argument to another function. Hence the variable cd can be removed.
> > > Issue found using Coccinelle.
> > >
> > > Signed-off-by: Nishka Dasgupta <nishka.dasgupta@yahoo.com>
> > > ---
> > > drivers/staging/fieldbus/anybuss/arcx-anybus.c | 8 ++------
> > > 1 file changed, 2 insertions(+), 6 deletions(-)
> > >
> > > diff --git a/drivers/staging/fieldbus/anybuss/arcx-anybus.c b/drivers/staging/fieldbus/anybuss/arcx-anybus.c
> > > index 2ecffa42e561..e245f940a5c4 100644
> > > --- a/drivers/staging/fieldbus/anybuss/arcx-anybus.c
> > > +++ b/drivers/staging/fieldbus/anybuss/arcx-anybus.c
> > > @@ -87,16 +87,12 @@ static int anybuss_reset(struct controller_priv *cd,
> > > static void export_reset_0(struct device *dev, bool assert)
> > > {
> > > - struct controller_priv *cd = dev_get_drvdata(dev);
> > > -
> > > - anybuss_reset(cd, 0, assert);
> > > + anybuss_reset(dev_get_drvdata(dev), 0, assert);
> > > }
> >
> > While your patch is "correct", it's not the nicest thing. The way the
> > code looks today is to make it obvious we are passing a pointer to a
> > struct controller_priv() into anybuss_reset(). But with your change, it
> > looks like we are passing any random void pointer to it.
> >
> > So I'd prefer the original code please.
>
> Thank you, I'll drop this patch then.
>
> > Also, you forgot to cc: Sven on this patch, please always use the output
> > of scripts/get_maintainer.pl.
>
> Which arguments should I use? If I use --nokeywords, --nogit,
> --nogit-fallback and --norolestats then only your name and the two mailing
> lists show up.
I don't use any arguments at all:
$ ./scripts/get_maintainer.pl --file drivers/staging/fieldbus/anybuss/arcx-anybus.c
Greg Kroah-Hartman <gregkh@linuxfoundation.org> (supporter:STAGING SUBSYSTEM,commit_signer:2/2=100%)
Sven Van Asbroeck <thesven73@gmail.com> (commit_signer:2/2=100%,authored:2/2=100%,added_lines:412/412=100%,removed_lines:31/31=100%)
devel@driverdev.osuosl.org (open list:STAGING SUBSYSTEM)
linux-kernel@vger.kernel.org (open list)
> (Also, regarding the mailing lists: every mail sent to
> linux-kernel@vger.kernel.org is bouncing; should I not send to that list
> anymore?)
Please pick a reputable email server, yahoo.com emails are banned from
all vger.kernel.org mailing lists.
thanks,
greg k-h
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] staging: fieldbus: anybuss: Remove unnecessary variables
2019-05-23 8:27 ` Jeremy Sowden
@ 2019-05-23 9:09 ` Dan Carpenter
2019-05-23 13:02 ` Sven Van Asbroeck
0 siblings, 1 reply; 6+ messages in thread
From: Dan Carpenter @ 2019-05-23 9:09 UTC (permalink / raw)
To: Jeremy Sowden, Sven Van Asbroeck
Cc: Nishka Dasgupta, devel, Greg KH, linux-kernel
On Thu, May 23, 2019 at 09:27:02AM +0100, Jeremy Sowden wrote:
> On 2019-05-23, at 13:51:18 +0530, Nishka Dasgupta wrote:
> > On 23/05/19 12:52 PM, Greg KH wrote:
> > > On Thu, May 23, 2019 at 12:05:01PM +0530, Nishka Dasgupta wrote:
> > > Also, you forgot to cc: Sven on this patch, please always use the output
> > > of scripts/get_maintainer.pl.
> >
> > Which arguments should I use? If I use --nokeywords, --nogit,
> > --nogit-fallback and --norolestats then only your name and the two
> > mailing lists show up. (Also, regarding the mailing lists: every mail
> > sent to linux-kernel@vger.kernel.org is bouncing; should I not send to
> > that list anymore?)
>
> He is listed in the TODO:
>
> $ cat drivers/staging/fieldbus/TODO
> TODO:
> -Get more people/drivers to use the Fieldbus userspace ABI. It requires
> verification/sign-off by multiple users.
>
> Contact: Sven Van Asbroeck <TheSven73@gmail.com>
Sven, you should add yourself to the MAINTAINERS file.
regards,
dan carpenter
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] staging: fieldbus: anybuss: Remove unnecessary variables
2019-05-23 9:09 ` Dan Carpenter
@ 2019-05-23 13:02 ` Sven Van Asbroeck
2019-05-23 18:05 ` Greg KH
0 siblings, 1 reply; 6+ messages in thread
From: Sven Van Asbroeck @ 2019-05-23 13:02 UTC (permalink / raw)
To: Greg KH
Cc: Dan Carpenter, Jeremy Sowden, Nishka Dasgupta, devel,
Linux Kernel Mailing List
On Thu, May 23, 2019 at 5:09 AM Dan Carpenter <dan.carpenter@oracle.com> wrote:
>
> Sven, you should add yourself to the MAINTAINERS file.
Greg, what do you think?
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] staging: fieldbus: anybuss: Remove unnecessary variables
2019-05-23 13:02 ` Sven Van Asbroeck
@ 2019-05-23 18:05 ` Greg KH
0 siblings, 0 replies; 6+ messages in thread
From: Greg KH @ 2019-05-23 18:05 UTC (permalink / raw)
To: Sven Van Asbroeck
Cc: Dan Carpenter, Jeremy Sowden, Nishka Dasgupta, devel,
Linux Kernel Mailing List
On Thu, May 23, 2019 at 09:02:11AM -0400, Sven Van Asbroeck wrote:
> On Thu, May 23, 2019 at 5:09 AM Dan Carpenter <dan.carpenter@oracle.com> wrote:
> >
> > Sven, you should add yourself to the MAINTAINERS file.
>
> Greg, what do you think?
Yes!
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2019-05-23 18:06 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
[not found] <20190523063504.10530-1-nishka.dasgupta@yahoo.com>
2019-05-23 7:22 ` [PATCH] staging: fieldbus: anybuss: Remove unnecessary variables Greg KH
[not found] ` <b8cc12d9-2fe3-754b-be08-f23055a31ffe@yahoo.com>
2019-05-23 8:27 ` Jeremy Sowden
2019-05-23 9:09 ` Dan Carpenter
2019-05-23 13:02 ` Sven Van Asbroeck
2019-05-23 18:05 ` Greg KH
2019-05-23 8:42 ` Greg KH
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).