From mboxrd@z Thu Jan 1 00:00:00 1970 X-GM-THRID: 9903208923136 X-Received: by 10.182.129.166 with SMTP id nx6mr14705477obb.35.1427372415778; Thu, 26 Mar 2015 05:20:15 -0700 (PDT) X-BeenThere: outreachy-kernel@googlegroups.com Received: by 10.50.28.8 with SMTP id x8ls648224igg.11.gmail; Thu, 26 Mar 2015 05:20:15 -0700 (PDT) X-Received: by 10.50.254.161 with SMTP id aj1mr29757539igd.6.1427372415419; Thu, 26 Mar 2015 05:20:15 -0700 (PDT) Return-Path: Received: from mail-ig0-x22b.google.com (mail-ig0-x22b.google.com. [2607:f8b0:4001:c05::22b]) by gmr-mx.google.com with ESMTPS id d4si1423396igl.1.2015.03.26.05.20.15 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 26 Mar 2015 05:20:15 -0700 (PDT) Received-SPF: pass (google.com: domain of helen.fornazier@gmail.com designates 2607:f8b0:4001:c05::22b as permitted sender) client-ip=2607:f8b0:4001:c05::22b; Authentication-Results: gmr-mx.google.com; spf=pass (google.com: domain of helen.fornazier@gmail.com designates 2607:f8b0:4001:c05::22b as permitted sender) smtp.mail=helen.fornazier@gmail.com; dkim=pass header.i=@gmail.com; dmarc=pass (p=NONE dis=NONE) header.from=gmail.com Received: by mail-ig0-x22b.google.com with SMTP id xg11so51940753igc.0 for ; Thu, 26 Mar 2015 05:20:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type; bh=p7s2SZQ0GTNewIEdcbXCRT1ZL2SvCPOoT7Odowk4wHA=; b=Fpk/gNQ9BSzGG3BBV2WDE3hzgciT6WE7Oc31edM/r9x7pHOJ8YCTdIuSsXSEIYrR9i b3tH/XoeDwA1rKId2MVeWbhOrImwS98wjy7l33w0t1X9E4QwE51B125MX90/rCPwtIK/ z5Blg7u4hSClV4P8T13PSyjuwnJevMfPQ/Y5LOVdHp/qfiVlMUAJ2QFKfKIxguQsbCI+ kjYbdpHtawCPekWE6/DpZ8Z/8c2ZAH3KQyxGB5/Q0eQQiejJtb6sTCMlvjSeJPO/K6rr U4QX4VH+pyuP2gM7DWPVDFtMIyVuq5i5PhgOEVZUyjrrtkmkjeiM+xqOCHP2aXSmVN3L CuhA== X-Received: by 10.43.29.208 with SMTP id rz16mr38643083icb.89.1427372415284; Thu, 26 Mar 2015 05:20:15 -0700 (PDT) MIME-Version: 1.0 Received: by 10.36.82.85 with HTTP; Thu, 26 Mar 2015 05:19:54 -0700 (PDT) In-Reply-To: References: <1427328593-6576-1-git-send-email-helen.fornazier@gmail.com> From: Helen Fornazier Date: Thu, 26 Mar 2015 09:19:54 -0300 Message-ID: Subject: Re: [Outreachy kernel] [PATCH] Staging: dgnc: Replace printk with pr_err To: Julia Lawall Cc: outreachy-kernel@googlegroups.com Content-Type: multipart/alternative; boundary=bcaec5186582c678e60512300969 --bcaec5186582c678e60512300969 Content-Type: text/plain; charset=UTF-8 On Thu, Mar 26, 2015 at 3:31 AM, Julia Lawall 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 > > --- > > 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 --bcaec5186582c678e60512300969 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable


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 de= v_err(dev, ... then pr_err(...=C2=A0 to printk(KERN_ERR ...
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0printk(KERN_ER= R "DGNC: sysfs driver_create_file failed!\n");
>
> Signed-off-by: Helen Fornazier <helen.fornazier@gmail.com>
> ---
>=C2=A0 drivers/staging/dgnc/dgnc_sysfs.c | 2 +-
>=C2=A0 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)
>=C2=A0 =C2=A0 =C2=A0 =C2=A0rc |=3D driver_create_file(driverfs, &dr= iver_attr_maxboards);
>=C2=A0 =C2=A0 =C2=A0 =C2=A0rc |=3D driver_create_file(driverfs, &dr= iver_attr_pollrate);
>=C2=A0 =C2=A0 =C2=A0 =C2=A0if (rc)
> -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0printk(KERN_ERR "= ;DGNC: sysfs driver_create_file failed!\n");
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0pr_err("DGNC: sy= sfs 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 oth= er parts of the code uses dev_err, but inside the=C2=A0dgnc_create_driver_s= ysfiles function I couldn't figure it out how to get the "structur= e device" object to use inside the dev_err function.
=C2=A0<= /div>
>=C2=A0 }
>
>
> --
> 1.9.1
>
> --
> You received this message because you are subscribed to the Google Gro= ups "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/out= reachy-kernel/1427328593-6576-1-git-send-email-helen.fornazier%40gmail.com<= /a>.
> For more options, visit
https://groups.google.com/d/optout.
>



--
Helen Fornazier
--bcaec5186582c678e60512300969--