Re: [PATCH] net: add new QCA alx ethernet driver

From: Stephen Hemminger
Date: Wed Aug 15 2012 - 11:02:31 EST


On Wed, 15 Aug 2012 05:39:11 +0000
"Ren, Cloud" <cjren@xxxxxxxxxxxxxxxx> wrote:

> From: David Miller [mailto:davem@xxxxxxxxxxxxx]
> Sent: Wednesday, August 15, 2012 1:33 PM
>
> >From: "Ren, Cloud" <cjren@xxxxxxxxxxxxxxxx>
> >Date: Wed, 15 Aug 2012 03:29:26 +0000
> >
> >>>> + strncpy(netdev->name, pci_name(pdev), sizeof(netdev->name) - 1);
> >>>> ...
> >>>> + strcpy(netdev->name, "eth%d");
> >>>> + retval = register_netdev(netdev);
> >>>
> >>>The strcpy is unnecessary, alloc_etherdev already sets that.
> >>
> >> The strcpy is useful. netdev->name is set as pci_name in front. So the strcpy
> >restores it.
> >
> >Are you doing this just to influence the initial driver log messages?
>
> Yes.
>
> >
> >Don't do that, it's gross.
>
> Ok, I will remove it.

Before the driver is registered, use dev_info() type of logging.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/