[firefly] [PATCH v2] staging: dgnc: Fix checkpatch warnings

Roberta Dobrescu roberta.dobrescu at gmail.com
Sun Sep 14 21:28:03 EEST 2014


Thank you for the clarification about dev_info vs. dev_dbg.

struct tty_struct has a member struct device *dev.
If I use  dev_dbg(&tty->dev, .....), I`ll get the following warning:
note: expected ‘const struct device *’ but argument is of type ‘struct
device **’.

Shoudn`t I use dev_dbg(tty->dev, .....)?

2014-09-14 21:15 GMT+03:00 Daniel Baluta <daniel.baluta at gmail.com>:

> On Sun, Sep 14, 2014 at 6:15 PM, Roberta Dobrescu
> <roberta.dobrescu at gmail.com> wrote:
> > This fixes the following checkpatch.pl warnings:
> > WARNING: printk() should include KERN_ facility level
> >
> > Signed-off-by: Roberta Dobrescu <roberta.dobrescu at gmail.com>
> > ---
> > Changes since v1:
> > Used dev_info instead of netdev_dbg
> >
> >  drivers/staging/dgnc/dgnc_tty.c | 4 ++--
> >  1 file changed, 2 insertions(+), 2 deletions(-)
> >
> > diff --git a/drivers/staging/dgnc/dgnc_tty.c
> b/drivers/staging/dgnc/dgnc_tty.c
> > index 8920ae0..27589ab 100644
> > --- a/drivers/staging/dgnc/dgnc_tty.c
> > +++ b/drivers/staging/dgnc/dgnc_tty.c
> > @@ -2233,13 +2233,13 @@ static void dgnc_tty_send_xchar(struct
> tty_struct *tty, char c)
> >         if (!bd || bd->magic != DGNC_BOARD_MAGIC)
> >                 return;
> >
> > -       printk("dgnc_tty_send_xchar start\n");
> > +       dev_info(tty->dev, "dgnc_tty_send_xchar start\n");
>
> This is too verbose. Please use dev_dbg instead of dev_info.
> First argument should be a pointer to the device:
>
> dev_dbg(&tty->dev, .....);
>
> >
> >         DGNC_LOCK(ch->ch_lock, lock_flags);
> >         bd->bd_ops->send_immediate_char(ch, c);
> >         DGNC_UNLOCK(ch->ch_lock, lock_flags);
> >
> > -       printk("dgnc_tty_send_xchar finish\n");
> > +       dev_info(tty->dev, "dgnc_tty_send_xchar finish\n");
> The same here.
> >         return;
> >  }
>
> thanks,
> Daniel.
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rosedu.org/pipermail/firefly/attachments/20140914/a09579cf/attachment.html>


More information about the firefly mailing list