Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1621258 > unrolled thread

[PATCH] staging: ks7010: Adjust dev_err() calls in ks7010_sdio_probe()

Started bySF Markus Elfring <elfring@users.sourceforge.net>
First post2017-04-11 15:20 +0200
Last post2017-04-12 14:40 +0200
Articles 6 — 3 participants

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  [PATCH] staging: ks7010: Adjust dev_err() calls in  ks7010_sdio_probe() SF Markus Elfring <elfring@users.sourceforge.net> - 2017-04-11 15:20 +0200
    Re: [PATCH] staging: ks7010: Adjust dev_err() calls in  ks7010_sdio_probe() "Tobin C. Harding" <me@tobin.cc> - 2017-04-12 00:40 +0200
      Re: staging: ks7010: Adjust dev_err() calls in ks7010_sdio_probe() SF Markus Elfring <elfring@users.sourceforge.net> - 2017-04-12 10:50 +0200
      Re: [PATCH] staging: ks7010: Adjust dev_err() calls in  ks7010_sdio_probe() Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-04-12 12:30 +0200
        Re: [PATCH] staging: ks7010: Adjust dev_err() calls in  ks7010_sdio_probe() "Tobin C. Harding" <me@tobin.cc> - 2017-04-12 14:00 +0200
          Re: [PATCH] staging: ks7010: Adjust dev_err() calls in  ks7010_sdio_probe() Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-04-12 14:40 +0200

#1621258 — [PATCH] staging: ks7010: Adjust dev_err() calls in ks7010_sdio_probe()

FromSF Markus Elfring <elfring@users.sourceforge.net>
Date2017-04-11 15:20 +0200
Subject[PATCH] staging: ks7010: Adjust dev_err() calls in ks7010_sdio_probe()
Message-ID<tv3S9-7tH-5@gated-at.bofh.it>
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Tue, 11 Apr 2017 14:54:35 +0200

The use of the logging function "dev_err" was introduced here on 2016-09-26.

I find the following implementation details worth for another look.
* Reduce expressions for the first input parameter "dev".

* Omit an extra module prefix in passed error messages because the device name
  will be displayed by the function "__dev_printk".

Fixes: 9887b5e51fafaf919601ccb8bdae1e0ad749032f ("staging: ks7010: Fix warnings on printk() usage")

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
 drivers/staging/ks7010/ks7010_sdio.c | 11 +++++------
 1 file changed, 5 insertions(+), 6 deletions(-)

diff --git a/drivers/staging/ks7010/ks7010_sdio.c b/drivers/staging/ks7010/ks7010_sdio.c
index b16618b41253..85feb170869b 100644
--- a/drivers/staging/ks7010/ks7010_sdio.c
+++ b/drivers/staging/ks7010/ks7010_sdio.c
@@ -955,12 +955,11 @@ static int ks7010_sdio_probe(struct sdio_func *func,
 	/* private memory allocate */
 	netdev = alloc_etherdev(sizeof(*priv));
 	if (!netdev) {
-		dev_err(&card->func->dev, "ks7010 : Unable to alloc new net device\n");
+		dev_err(&func->dev, "Unable to alloc new net device\n");
 		goto err_release_irq;
 	}
 	if (dev_alloc_name(netdev, "wlan%d") < 0) {
-		dev_err(&card->func->dev,
-			"ks7010 :  Couldn't get name!\n");
+		dev_err(&func->dev, "Couldn't get name!\n");
 		goto err_free_netdev;
 	}
 
@@ -1000,9 +999,9 @@ static int ks7010_sdio_probe(struct sdio_func *func,
 	/* Upload firmware */
 	ret = ks7010_upload_firmware(priv, card);	/* firmware load */
 	if (ret) {
-		dev_err(&card->func->dev,
-			"ks7010: firmware load failed !! return code = %d\n",
-			 ret);
+		dev_err(&func->dev,
+			"firmware load failed! return code = %d\n",
+			ret);
 		goto err_free_read_buf;
 	}
 
-- 
2.12.2

[toc] | [next] | [standalone]


#1621665

From"Tobin C. Harding" <me@tobin.cc>
Date2017-04-12 00:40 +0200
Message-ID<tvcC5-4Dw-3@gated-at.bofh.it>
In reply to#1621258
On Tue, Apr 11, 2017 at 03:15:32PM +0200, SF Markus Elfring wrote:
> From: Markus Elfring <elfring@users.sourceforge.net>
> Date: Tue, 11 Apr 2017 14:54:35 +0200
> 
> The use of the logging function "dev_err" was introduced here on 2016-09-26.
> 
> I find the following implementation details worth for another look.
> * Reduce expressions for the first input parameter "dev".
> 
> * Omit an extra module prefix in passed error messages because the device name
>   will be displayed by the function "__dev_printk".
> 
> Fixes: 9887b5e51fafaf919601ccb8bdae1e0ad749032f ("staging: ks7010: Fix warnings on printk() usage")
> 
> Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
> ---
>  drivers/staging/ks7010/ks7010_sdio.c | 11 +++++------
>  1 file changed, 5 insertions(+), 6 deletions(-)
> 
> diff --git a/drivers/staging/ks7010/ks7010_sdio.c b/drivers/staging/ks7010/ks7010_sdio.c
> index b16618b41253..85feb170869b 100644
> --- a/drivers/staging/ks7010/ks7010_sdio.c
> +++ b/drivers/staging/ks7010/ks7010_sdio.c
> @@ -955,12 +955,11 @@ static int ks7010_sdio_probe(struct sdio_func *func,
>  	/* private memory allocate */
>  	netdev = alloc_etherdev(sizeof(*priv));
>  	if (!netdev) {
> -		dev_err(&card->func->dev, "ks7010 : Unable to alloc new net device\n");
> +		dev_err(&func->dev, "Unable to alloc new net device\n");
>  		goto err_release_irq;
>  	}
>  	if (dev_alloc_name(netdev, "wlan%d") < 0) {
> -		dev_err(&card->func->dev,
> -			"ks7010 :  Couldn't get name!\n");
> +		dev_err(&func->dev, "Couldn't get name!\n");
>  		goto err_free_netdev;
>  	}
>  
> @@ -1000,9 +999,9 @@ static int ks7010_sdio_probe(struct sdio_func *func,
>  	/* Upload firmware */
>  	ret = ks7010_upload_firmware(priv, card);	/* firmware load */
>  	if (ret) {
> -		dev_err(&card->func->dev,
> -			"ks7010: firmware load failed !! return code = %d\n",
> -			 ret);
> +		dev_err(&func->dev,
> +			"firmware load failed! return code = %d\n",
> +			ret);
>  		goto err_free_read_buf;
>  	}

This patch does not apply to Greg's staging-testing branch. Sorry
Markus a patch was merged the same day you submitted this one that
refactored this code.

The patch was good though, good spotting.

Good luck,
Tobin.

[toc] | [prev] | [next] | [standalone]


#1621930 — Re: staging: ks7010: Adjust dev_err() calls in ks7010_sdio_probe()

FromSF Markus Elfring <elfring@users.sourceforge.net>
Date2017-04-12 10:50 +0200
SubjectRe: staging: ks7010: Adjust dev_err() calls in ks7010_sdio_probe()
Message-ID<tvm8p-2hK-17@gated-at.bofh.it>
In reply to#1621665
> This patch does not apply to Greg's staging-testing branch.

Could the proposed changes be applied with a bit of “fuzz” for the
implementation of the function “ks7010_sdio_probe”?


> Markus a patch was merged the same day you submitted this one that
> refactored this code.

Do you refer to your contributions from 2017-04-10 here which seem to
touch only other functions?
https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging.git/log/?h=staging-testing&qt=author&q=Tobin+C.+Harding


> The patch was good though, good spotting.

Will there any more approaches be needed for a corresponding
editing conflict resolution?
Which day would be better to dare a resend for my small update suggestion?

Regards,
Markus

[toc] | [prev] | [next] | [standalone]


#1621972

FromGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Date2017-04-12 12:30 +0200
Message-ID<tvnHb-3hy-3@gated-at.bofh.it>
In reply to#1621665
On Wed, Apr 12, 2017 at 08:39:15AM +1000, Tobin C. Harding wrote:
> On Tue, Apr 11, 2017 at 03:15:32PM +0200, SF Markus Elfring wrote:
> > From: Markus Elfring <elfring@users.sourceforge.net>
> > Date: Tue, 11 Apr 2017 14:54:35 +0200
> > 
> > The use of the logging function "dev_err" was introduced here on 2016-09-26.
> > 
> > I find the following implementation details worth for another look.
> > * Reduce expressions for the first input parameter "dev".
> > 
> > * Omit an extra module prefix in passed error messages because the device name
> >   will be displayed by the function "__dev_printk".
> > 
> > Fixes: 9887b5e51fafaf919601ccb8bdae1e0ad749032f ("staging: ks7010: Fix warnings on printk() usage")
> > 
> > Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
> > ---
> >  drivers/staging/ks7010/ks7010_sdio.c | 11 +++++------
> >  1 file changed, 5 insertions(+), 6 deletions(-)
> > 
> > diff --git a/drivers/staging/ks7010/ks7010_sdio.c b/drivers/staging/ks7010/ks7010_sdio.c
> > index b16618b41253..85feb170869b 100644
> > --- a/drivers/staging/ks7010/ks7010_sdio.c
> > +++ b/drivers/staging/ks7010/ks7010_sdio.c
> > @@ -955,12 +955,11 @@ static int ks7010_sdio_probe(struct sdio_func *func,
> >  	/* private memory allocate */
> >  	netdev = alloc_etherdev(sizeof(*priv));
> >  	if (!netdev) {
> > -		dev_err(&card->func->dev, "ks7010 : Unable to alloc new net device\n");
> > +		dev_err(&func->dev, "Unable to alloc new net device\n");
> >  		goto err_release_irq;
> >  	}
> >  	if (dev_alloc_name(netdev, "wlan%d") < 0) {
> > -		dev_err(&card->func->dev,
> > -			"ks7010 :  Couldn't get name!\n");
> > +		dev_err(&func->dev, "Couldn't get name!\n");
> >  		goto err_free_netdev;
> >  	}
> >  
> > @@ -1000,9 +999,9 @@ static int ks7010_sdio_probe(struct sdio_func *func,
> >  	/* Upload firmware */
> >  	ret = ks7010_upload_firmware(priv, card);	/* firmware load */
> >  	if (ret) {
> > -		dev_err(&card->func->dev,
> > -			"ks7010: firmware load failed !! return code = %d\n",
> > -			 ret);
> > +		dev_err(&func->dev,
> > +			"firmware load failed! return code = %d\n",
> > +			ret);
> >  		goto err_free_read_buf;
> >  	}
> 
> This patch does not apply to Greg's staging-testing branch. Sorry
> Markus a patch was merged the same day you submitted this one that
> refactored this code.

Note, Markus is in almost all maintainers kill-file, so we don't even
see their emails, and I'd recommend you not even worry about them
either.

thanks,

greg k-h

[toc] | [prev] | [next] | [standalone]


#1622039

From"Tobin C. Harding" <me@tobin.cc>
Date2017-04-12 14:00 +0200
Message-ID<tvp6h-3Zp-1@gated-at.bofh.it>
In reply to#1621972
On Wed, Apr 12, 2017 at 12:27:10PM +0200, Greg Kroah-Hartman wrote:
> On Wed, Apr 12, 2017 at 08:39:15AM +1000, Tobin C. Harding wrote:
> > On Tue, Apr 11, 2017 at 03:15:32PM +0200, SF Markus Elfring wrote:
> > > From: Markus Elfring <elfring@users.sourceforge.net>
> > > Date: Tue, 11 Apr 2017 14:54:35 +0200
> > > 
> > > The use of the logging function "dev_err" was introduced here on 2016-09-26.
> > > 
> > > I find the following implementation details worth for another look.
> > > * Reduce expressions for the first input parameter "dev".
> > > 
> > > * Omit an extra module prefix in passed error messages because the device name
> > >   will be displayed by the function "__dev_printk".
> > > 
> > > Fixes: 9887b5e51fafaf919601ccb8bdae1e0ad749032f ("staging: ks7010: Fix warnings on printk() usage")
> > > 
> > > Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
> > > ---
> > >  drivers/staging/ks7010/ks7010_sdio.c | 11 +++++------
> > >  1 file changed, 5 insertions(+), 6 deletions(-)
> > > 
> > > diff --git a/drivers/staging/ks7010/ks7010_sdio.c b/drivers/staging/ks7010/ks7010_sdio.c
> > > index b16618b41253..85feb170869b 100644
> > > --- a/drivers/staging/ks7010/ks7010_sdio.c
> > > +++ b/drivers/staging/ks7010/ks7010_sdio.c
> > > @@ -955,12 +955,11 @@ static int ks7010_sdio_probe(struct sdio_func *func,
> > >  	/* private memory allocate */
> > >  	netdev = alloc_etherdev(sizeof(*priv));
> > >  	if (!netdev) {
> > > -		dev_err(&card->func->dev, "ks7010 : Unable to alloc new net device\n");
> > > +		dev_err(&func->dev, "Unable to alloc new net device\n");
> > >  		goto err_release_irq;
> > >  	}
> > >  	if (dev_alloc_name(netdev, "wlan%d") < 0) {
> > > -		dev_err(&card->func->dev,
> > > -			"ks7010 :  Couldn't get name!\n");
> > > +		dev_err(&func->dev, "Couldn't get name!\n");
> > >  		goto err_free_netdev;
> > >  	}
> > >  
> > > @@ -1000,9 +999,9 @@ static int ks7010_sdio_probe(struct sdio_func *func,
> > >  	/* Upload firmware */
> > >  	ret = ks7010_upload_firmware(priv, card);	/* firmware load */
> > >  	if (ret) {
> > > -		dev_err(&card->func->dev,
> > > -			"ks7010: firmware load failed !! return code = %d\n",
> > > -			 ret);
> > > +		dev_err(&func->dev,
> > > +			"firmware load failed! return code = %d\n",
> > > +			ret);
> > >  		goto err_free_read_buf;
> > >  	}
> > 
> > This patch does not apply to Greg's staging-testing branch. Sorry
> > Markus a patch was merged the same day you submitted this one that
> > refactored this code.
> 
> Note, Markus is in almost all maintainers kill-file, so we don't even
> see their emails, and I'd recommend you not even worry about them
> either.

I've never heard of a kill-file, it sounds awesome. I hope to some day
have one of those myself. I settled for a incoming mail rule deleting his
email.

thanks for the tip,
Tobin.

[toc] | [prev] | [next] | [standalone]


#1622101

FromGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Date2017-04-12 14:40 +0200
Message-ID<tvpJ0-4rx-17@gated-at.bofh.it>
In reply to#1622039
On Wed, Apr 12, 2017 at 09:57:35PM +1000, Tobin C. Harding wrote:
> On Wed, Apr 12, 2017 at 12:27:10PM +0200, Greg Kroah-Hartman wrote:
> > On Wed, Apr 12, 2017 at 08:39:15AM +1000, Tobin C. Harding wrote:
> > > On Tue, Apr 11, 2017 at 03:15:32PM +0200, SF Markus Elfring wrote:
> > > > From: Markus Elfring <elfring@users.sourceforge.net>
> > > > Date: Tue, 11 Apr 2017 14:54:35 +0200
> > > > 
> > > > The use of the logging function "dev_err" was introduced here on 2016-09-26.
> > > > 
> > > > I find the following implementation details worth for another look.
> > > > * Reduce expressions for the first input parameter "dev".
> > > > 
> > > > * Omit an extra module prefix in passed error messages because the device name
> > > >   will be displayed by the function "__dev_printk".
> > > > 
> > > > Fixes: 9887b5e51fafaf919601ccb8bdae1e0ad749032f ("staging: ks7010: Fix warnings on printk() usage")
> > > > 
> > > > Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
> > > > ---
> > > >  drivers/staging/ks7010/ks7010_sdio.c | 11 +++++------
> > > >  1 file changed, 5 insertions(+), 6 deletions(-)
> > > > 
> > > > diff --git a/drivers/staging/ks7010/ks7010_sdio.c b/drivers/staging/ks7010/ks7010_sdio.c
> > > > index b16618b41253..85feb170869b 100644
> > > > --- a/drivers/staging/ks7010/ks7010_sdio.c
> > > > +++ b/drivers/staging/ks7010/ks7010_sdio.c
> > > > @@ -955,12 +955,11 @@ static int ks7010_sdio_probe(struct sdio_func *func,
> > > >  	/* private memory allocate */
> > > >  	netdev = alloc_etherdev(sizeof(*priv));
> > > >  	if (!netdev) {
> > > > -		dev_err(&card->func->dev, "ks7010 : Unable to alloc new net device\n");
> > > > +		dev_err(&func->dev, "Unable to alloc new net device\n");
> > > >  		goto err_release_irq;
> > > >  	}
> > > >  	if (dev_alloc_name(netdev, "wlan%d") < 0) {
> > > > -		dev_err(&card->func->dev,
> > > > -			"ks7010 :  Couldn't get name!\n");
> > > > +		dev_err(&func->dev, "Couldn't get name!\n");
> > > >  		goto err_free_netdev;
> > > >  	}
> > > >  
> > > > @@ -1000,9 +999,9 @@ static int ks7010_sdio_probe(struct sdio_func *func,
> > > >  	/* Upload firmware */
> > > >  	ret = ks7010_upload_firmware(priv, card);	/* firmware load */
> > > >  	if (ret) {
> > > > -		dev_err(&card->func->dev,
> > > > -			"ks7010: firmware load failed !! return code = %d\n",
> > > > -			 ret);
> > > > +		dev_err(&func->dev,
> > > > +			"firmware load failed! return code = %d\n",
> > > > +			ret);
> > > >  		goto err_free_read_buf;
> > > >  	}
> > > 
> > > This patch does not apply to Greg's staging-testing branch. Sorry
> > > Markus a patch was merged the same day you submitted this one that
> > > refactored this code.
> > 
> > Note, Markus is in almost all maintainers kill-file, so we don't even
> > see their emails, and I'd recommend you not even worry about them
> > either.
> 
> I've never heard of a kill-file, it sounds awesome. I hope to some day
> have one of those myself. I settled for a incoming mail rule deleting his
> email.

Ah, you now have implemented your own, nice work!

	https://en.wikipedia.org/wiki/Kill_file

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web