[ofa-general] RE: [PATCH/RFC] RDMA/nes: Use print_mac() to format ethernet addresses for printing
Glenn Streiff
gstreiff at NetEffect.com
Wed Apr 23 11:49:37 PDT 2008
Acked-by: Glenn Streiff <gstreiff at neteffect.com>
thanks!
> Removing open-coded MAC formats shrinks the source and the generated
> code too, eg on x86-64:
>
> add/remove: 0/0 grow/shrink: 0/4 up/down: 0/-103 (-103)
> function old new delta
> make_cm_node 932 912 -20
> nes_netdev_set_mac_address 427 406 -21
> nes_netdev_set_multicast_list 1148 1124 -24
> nes_probe 2349 2311 -38
>
> Signed-off-by: Roland Dreier <rolandd at cisco.com>
> ---
> drivers/infiniband/hw/nes/nes.c | 10 ++++------
> drivers/infiniband/hw/nes/nes_cm.c | 8 +++-----
> drivers/infiniband/hw/nes/nes_nic.c | 18 ++++++++----------
> 3 files changed, 15 insertions(+), 21 deletions(-)
>
> diff --git a/drivers/infiniband/hw/nes/nes.c
> b/drivers/infiniband/hw/nes/nes.c
> index b046262..c0671ad 100644
> --- a/drivers/infiniband/hw/nes/nes.c
> +++ b/drivers/infiniband/hw/nes/nes.c
> @@ -353,13 +353,11 @@ struct ib_qp *nes_get_qp(struct
> ib_device *device, int qpn)
> */
> static void nes_print_macaddr(struct net_device *netdev)
> {
> - nes_debug(NES_DBG_INIT, "%s: MAC %02X:%02X:%02X:%02X:%02X:%02X, IRQ %u\n",
> - netdev->name,
> - netdev->dev_addr[0], netdev->dev_addr[1], netdev->dev_addr[2],
> - netdev->dev_addr[3], netdev->dev_addr[4], netdev->dev_addr[5],
> - netdev->irq);
> -}
> + DECLARE_MAC_BUF(mac);
>
> + nes_debug(NES_DBG_INIT, "%s: %s, IRQ %u\n",
> + netdev->name, print_mac(mac, netdev->dev_addr), netdev->irq);
> +}
>
> ...
More information about the general
mailing list