All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Staging: dgnc: Replace printk with pr_err
@ 2015-03-26  0:09 Helen Fornazier
  2015-03-26  6:31 ` [Outreachy kernel] " Julia Lawall
  0 siblings, 1 reply; 4+ messages in thread
From: Helen Fornazier @ 2015-03-26  0:09 UTC (permalink / raw)
  To: outreachy-kernel; +Cc: Helen Fornazier

This patch fixes the following checkpatch.pl warning:

WARNING: Prefer [subsystem eg: netdev]_err([subsystem]dev, ... then dev_err(dev, ... then pr_err(...  to printk(KERN_ERR ...
+               printk(KERN_ERR "DGNC: sysfs driver_create_file failed!\n");

Signed-off-by: Helen Fornazier <helen.fornazier@gmail.com>
---
 drivers/staging/dgnc/dgnc_sysfs.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/dgnc/dgnc_sysfs.c b/drivers/staging/dgnc/dgnc_sysfs.c
index 2df889e..65551d1 100644
--- a/drivers/staging/dgnc/dgnc_sysfs.c
+++ b/drivers/staging/dgnc/dgnc_sysfs.c
@@ -75,7 +75,7 @@ void dgnc_create_driver_sysfiles(struct pci_driver *dgnc_driver)
 	rc |= driver_create_file(driverfs, &driver_attr_maxboards);
 	rc |= driver_create_file(driverfs, &driver_attr_pollrate);
 	if (rc)
-		printk(KERN_ERR "DGNC: sysfs driver_create_file failed!\n");
+		pr_err("DGNC: sysfs driver_create_file failed!\n");
 }
 
 
-- 
1.9.1



^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [Outreachy kernel] [PATCH] Staging: dgnc: Replace printk with pr_err
  2015-03-26  0:09 [PATCH] Staging: dgnc: Replace printk with pr_err Helen Fornazier
@ 2015-03-26  6:31 ` Julia Lawall
  2015-03-26 12:19   ` Helen Fornazier
  0 siblings, 1 reply; 4+ messages in thread
From: Julia Lawall @ 2015-03-26  6:31 UTC (permalink / raw)
  To: Helen Fornazier; +Cc: outreachy-kernel



On Wed, 25 Mar 2015, Helen Fornazier wrote:

> This patch fixes the following checkpatch.pl warning:
> 
> WARNING: Prefer [subsystem eg: netdev]_err([subsystem]dev, ... then dev_err(dev, ... then pr_err(...  to printk(KERN_ERR ...
> +               printk(KERN_ERR "DGNC: sysfs driver_create_file failed!\n");
> 
> Signed-off-by: Helen Fornazier <helen.fornazier@gmail.com>
> ---
>  drivers/staging/dgnc/dgnc_sysfs.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/staging/dgnc/dgnc_sysfs.c b/drivers/staging/dgnc/dgnc_sysfs.c
> index 2df889e..65551d1 100644
> --- a/drivers/staging/dgnc/dgnc_sysfs.c
> +++ b/drivers/staging/dgnc/dgnc_sysfs.c
> @@ -75,7 +75,7 @@ void dgnc_create_driver_sysfiles(struct pci_driver *dgnc_driver)
>  	rc |= driver_create_file(driverfs, &driver_attr_maxboards);
>  	rc |= driver_create_file(driverfs, &driver_attr_pollrate);
>  	if (rc)
> -		printk(KERN_ERR "DGNC: sysfs driver_create_file failed!\n");
> +		pr_err("DGNC: sysfs driver_create_file failed!\n");

The dgnc_driver should give you access to a device-typed field so you can 
use dev_err.

julia

>  }
>  
>  
> -- 
> 1.9.1
> 
> -- 
> You received this message because you are subscribed to the Google Groups "outreachy-kernel" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to outreachy-kernel+unsubscribe@googlegroups.com.
> To post to this group, send email to outreachy-kernel@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/outreachy-kernel/1427328593-6576-1-git-send-email-helen.fornazier%40gmail.com.
> For more options, visit https://groups.google.com/d/optout.
> 


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [Outreachy kernel] [PATCH] Staging: dgnc: Replace printk with pr_err
  2015-03-26  6:31 ` [Outreachy kernel] " Julia Lawall
@ 2015-03-26 12:19   ` Helen Fornazier
  2015-03-26 16:01     ` Julia Lawall
  0 siblings, 1 reply; 4+ messages in thread
From: Helen Fornazier @ 2015-03-26 12:19 UTC (permalink / raw)
  To: Julia Lawall; +Cc: outreachy-kernel

[-- Attachment #1: Type: text/plain, Size: 2142 bytes --]

On Thu, Mar 26, 2015 at 3:31 AM, Julia Lawall <julia.lawall@lip6.fr> wrote:

>
>
> On Wed, 25 Mar 2015, Helen Fornazier wrote:
>
> > This patch fixes the following checkpatch.pl warning:
> >
> > WARNING: Prefer [subsystem eg: netdev]_err([subsystem]dev, ... then
> dev_err(dev, ... then pr_err(...  to printk(KERN_ERR ...
> > +               printk(KERN_ERR "DGNC: sysfs driver_create_file
> failed!\n");
> >
> > Signed-off-by: Helen Fornazier <helen.fornazier@gmail.com>
> > ---
> >  drivers/staging/dgnc/dgnc_sysfs.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/drivers/staging/dgnc/dgnc_sysfs.c
> b/drivers/staging/dgnc/dgnc_sysfs.c
> > index 2df889e..65551d1 100644
> > --- a/drivers/staging/dgnc/dgnc_sysfs.c
> > +++ b/drivers/staging/dgnc/dgnc_sysfs.c
> > @@ -75,7 +75,7 @@ void dgnc_create_driver_sysfiles(struct pci_driver
> *dgnc_driver)
> >       rc |= driver_create_file(driverfs, &driver_attr_maxboards);
> >       rc |= driver_create_file(driverfs, &driver_attr_pollrate);
> >       if (rc)
> > -             printk(KERN_ERR "DGNC: sysfs driver_create_file
> failed!\n");
> > +             pr_err("DGNC: sysfs driver_create_file failed!\n");
>
> The dgnc_driver should give you access to a device-typed field so you can
> use dev_err.
>
> julia
>
>
I though about that and I saw that other parts of the code uses dev_err,
but inside the dgnc_create_driver_sysfiles function I couldn't figure it
out how to get the "structure device" object to use inside the dev_err
function.


> >  }
> >
> >
> > --
> > 1.9.1
> >
> > --
> > You received this message because you are subscribed to the Google
> Groups "outreachy-kernel" group.
> > To unsubscribe from this group and stop receiving emails from it, send
> an email to outreachy-kernel+unsubscribe@googlegroups.com.
> > To post to this group, send email to outreachy-kernel@googlegroups.com.
> > To view this discussion on the web visit
> https://groups.google.com/d/msgid/outreachy-kernel/1427328593-6576-1-git-send-email-helen.fornazier%40gmail.com
> .
> > For more options, visit https://groups.google.com/d/optout.
> >
>



-- 
Helen Fornazier

[-- Attachment #2: Type: text/html, Size: 3627 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [Outreachy kernel] [PATCH] Staging: dgnc: Replace printk with pr_err
  2015-03-26 12:19   ` Helen Fornazier
@ 2015-03-26 16:01     ` Julia Lawall
  0 siblings, 0 replies; 4+ messages in thread
From: Julia Lawall @ 2015-03-26 16:01 UTC (permalink / raw)
  To: Helen Fornazier; +Cc: outreachy-kernel

[-- Attachment #1: Type: TEXT/PLAIN, Size: 3366 bytes --]



On Thu, 26 Mar 2015, Helen Fornazier wrote:

>
>
> On Thu, Mar 26, 2015 at 3:31 AM, Julia Lawall <julia.lawall@lip6.fr> wrote:
>
>
>       On Wed, 25 Mar 2015, Helen Fornazier wrote:
>
>       > This patch fixes the following checkpatch.pl warning:
>       >
>       > WARNING: Prefer [subsystem eg: netdev]_err([subsystem]dev, ...
>       then dev_err(dev, ... then pr_err(...  to printk(KERN_ERR ...
>       > +               printk(KERN_ERR "DGNC: sysfs
>       driver_create_file failed!\n");
>       >
>       > Signed-off-by: Helen Fornazier <helen.fornazier@gmail.com>
>       > ---
>       >  drivers/staging/dgnc/dgnc_sysfs.c | 2 +-
>       >  1 file changed, 1 insertion(+), 1 deletion(-)
>       >
>       > diff --git a/drivers/staging/dgnc/dgnc_sysfs.c
>       b/drivers/staging/dgnc/dgnc_sysfs.c
>       > index 2df889e..65551d1 100644
>       > --- a/drivers/staging/dgnc/dgnc_sysfs.c
>       > +++ b/drivers/staging/dgnc/dgnc_sysfs.c
>       > @@ -75,7 +75,7 @@ void dgnc_create_driver_sysfiles(struct
>       pci_driver *dgnc_driver)
>       >       rc |= driver_create_file(driverfs,
>       &driver_attr_maxboards);
>       >       rc |= driver_create_file(driverfs,
>       &driver_attr_pollrate);
>       >       if (rc)
>       > -             printk(KERN_ERR "DGNC: sysfs driver_create_file
>       failed!\n");
>       > +             pr_err("DGNC: sysfs driver_create_file
>       failed!\n");
>
> The dgnc_driver should give you access to a device-typed field so you
> can
> use dev_err.

Ah, indeed it does not seem to be possible.  In another case, Greg
suggested to add an argument with the device information.  I see that some
functions in the same file have struct device *p.  Perhaps that is
possible here too, if you can change all the call sites.

julia

>
> julia
>
>
> I though about that and I saw that other parts of the code uses dev_err, but
> inside the dgnc_create_driver_sysfiles function I couldn't figure it out how
> to get the "structure device" object to use inside the dev_err function.
>  
>       >  }
>       >
>       >
>       > --
>       > 1.9.1
>       >
>       > --
>       > You received this message because you are subscribed to the
>       Google Groups "outreachy-kernel" group.
>       > To unsubscribe from this group and stop receiving emails from
>       it, send an email to
>       outreachy-kernel+unsubscribe@googlegroups.com.
>       > To post to this group, send email to
>       outreachy-kernel@googlegroups.com.
>       > To view this discussion on the web visithttps://groups.google.com/d/msgid/outreachy-kernel/1427328593-6576-1-git-se
>       nd-email-helen.fornazier%40gmail.com.
>       > For more options, visit https://groups.google.com/d/optout.
>       >
>
>
>
>
> --
> Helen Fornazier
>
> --
> You received this message because you are subscribed to the Google Groups
> "outreachy-kernel" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to outreachy-kernel+unsubscribe@googlegroups.com.
> To post to this group, send email to outreachy-kernel@googlegroups.com.
> To view this discussion on the web visithttps://groups.google.com/d/msgid/outreachy-kernel/CAPW4XYbbeESj6tyXdzXp4pv
> c%3DgRr-7DShOrfXYns4Y6KB5YRJA%40mail.gmail.com.
> For more options, visit https://groups.google.com/d/optout.
>
>

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2015-03-26 16:01 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-03-26  0:09 [PATCH] Staging: dgnc: Replace printk with pr_err Helen Fornazier
2015-03-26  6:31 ` [Outreachy kernel] " Julia Lawall
2015-03-26 12:19   ` Helen Fornazier
2015-03-26 16:01     ` Julia Lawall

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.