All of lore.kernel.org
 help / color / mirror / Atom feed
From: Lourdes Pedrajas <lu@pplo.net>
To: Stefano Brivio <sbrivio@redhat.com>
Cc: outreachy-kernel@googlegroups.com, gregkh@linuxfoundation.org,
	julia.lawall@inria.fr
Subject: Re: [Outreachy kernel] [PATCH v2] staging: rtl8192u: r8192U_wx: use netdev_warn() instead of printk()
Date: Tue, 10 Mar 2020 23:28:44 +0100	[thread overview]
Message-ID: <20200310222844.GC2925@supernova> (raw)
In-Reply-To: <20200310231505.5dfcdbbf@elisabeth>

On Tue, Mar 10, 2020 at 11:15:05PM +0100, Stefano Brivio wrote:
> On Tue, 10 Mar 2020 23:10:18 +0100
> Lourdes Pedrajas <lu@pplo.net> wrote:
> 
> > On Tue, Mar 10, 2020 at 10:43:17PM +0100, Stefano Brivio wrote:
> > > On Tue, 10 Mar 2020 22:26:58 +0100
> > > Lourdes Pedrajas <lu@pplo.net> wrote:
> > >   
> > > > printk() is deprecated, use netdev_warn() instead, which is a message printing
> > > > function for network devices, defined in include/linux/netdevice.h.
> > > > Issue found by checkpatch.
> > > > 
> > > > Signed-off-by: Lourdes Pedrajas <lu@pplo.net>
> > > > ---
> > > > Changes since v1:
> > > >  - Replace message printing function pr_warn with network devices
> > > >    specific, netdev_warn()
> > > > 
> > > >  drivers/staging/rtl8192u/r8192U_wx.c | 2 +-
> > > >  1 file changed, 1 insertion(+), 1 deletion(-)
> > > > 
> > > > diff --git a/drivers/staging/rtl8192u/r8192U_wx.c b/drivers/staging/rtl8192u/r8192U_wx.c
> > > > index 0118edb0b9ab..58c1a8da7a8d 100644
> > > > --- a/drivers/staging/rtl8192u/r8192U_wx.c
> > > > +++ b/drivers/staging/rtl8192u/r8192U_wx.c
> > > > @@ -588,7 +588,7 @@ static int r8192_wx_set_enc(struct net_device *dev,
> > > >  				hwkey);                 /* KeyContent */
> > > >  
> > > >  		} else {
> > > > -			printk("wrong type in WEP, not WEP40 and WEP104\n");
> > > > +			netdev_warn("wrong type in WEP, not WEP40 and WEP104\n");  
> > > 
> > > Err, wait, did you try to compile this? :)
> > > 
> > > The idea of netdev_warn() is that it prefixes the error message by a
> > > reference to the specific network device, so that one knows what device
> > > is actually giving the problem (let's say you have two of these
> > > adapters on a system, or that you have virtual interfaces, etc.).
> > > 
> > > But for that to happen, it needs a pointer to the appropriate struct
> > > net_device.
> > > 
> > > -- 
> > > Stefano
> > >   
> > Stefano, Julia: oh my bad, I did the worst error: break the compilation! :(
> > It won't happen again!
> > 
> > Will search wich function is correct here.
> 
> The one you already found, that part was correct. :)
> 
> -- 
> Stefano
> 
Indeed, also found dev_warn and dev_printk functions, but they are
similar, they expect a pointer to a network device. Also thank for your
explanation, I re-read those functions and now makes me sense.

Lourdes


  reply	other threads:[~2020-03-10 22:28 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-10 21:26 [PATCH v2] staging: rtl8192u: r8192U_wx: use netdev_warn() instead of printk() Lourdes Pedrajas
2020-03-10 21:40 ` [Outreachy kernel] " Julia Lawall
2020-03-10 21:43 ` Stefano Brivio
2020-03-10 22:10   ` Lourdes Pedrajas
2020-03-10 22:15     ` Stefano Brivio
2020-03-10 22:28       ` Lourdes Pedrajas [this message]
2020-03-11 11:22         ` Stefano Brivio
2020-03-11 18:15           ` Lourdes Pedrajas

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200310222844.GC2925@supernova \
    --to=lu@pplo.net \
    --cc=gregkh@linuxfoundation.org \
    --cc=julia.lawall@inria.fr \
    --cc=outreachy-kernel@googlegroups.com \
    --cc=sbrivio@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.