[<prev] [next>] [day] [month] [year] [list]
Message-ID: <AANLkTikP1T9XXPVNHnmPnamjwyF5nNn+hVvpovAxTx69@mail.gmail.com>
Date: Fri, 14 Jan 2011 14:49:45 +0800
From: Po-Yu Chuang <ratbert.chuang@...il.com>
To: Joe Perches <joe@...ches.com>
Cc: netdev@...r.kernel.org, linux-kernel@...r.kernel.org,
Po-Yu Chuang <ratbert@...aday-tech.com>
Subject: Re: [PATCH] net: add Faraday FTMAC100 10/100 Ethernet driver
Dear Joe,
On Fri, Jan 14, 2011 at 7:05 AM, Joe Perches <joe@...ches.com> wrote:
> On Thu, 2011-01-13 at 19:49 +0800, Po-Yu Chuang wrote:
>> From: Po-Yu Chuang <ratbert@...aday-tech.com>
> []
>> + if (is_zero_ether_addr(netdev->dev_addr)) {
>> + random_ether_addr(netdev->dev_addr);
>> + dev_info(&netdev->dev, "generated random MAC address "
>> + "%.2x:%.2x:%.2x:%.2x:%.2x:%.2x.\n",
>> + netdev->dev_addr[0], netdev->dev_addr[1],
>> + netdev->dev_addr[2], netdev->dev_addr[3],
>> + netdev->dev_addr[4], netdev->dev_addr[5]);
>
> Sorry, one other thing.
> There are kernel specific printf extensions for pointer types.
> (look at lib/vsprintf.c) There's one for mac addresses: "%pM".
> This could be done as:
>
> netdev_info(netdev, "Generated random MAC address: %pM\n",
> netdev->dev_addr);
Wow, this is pretty beautiful. Thanks.
best regards,
Po-Yu Chuang
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists