lkml.org 
[lkml]   [2006]   [Sep]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    From
    SubjectRe: Tiny error in printk output for clocksource : a3:<6>Time: acpi_pm clocksource has been installed.
    Date
    On Wednesday 27 September 2006 07:17, Randy Dunlap wrote:
    > On Tue, 26 Sep 2006 22:10:43 -0700 Joe Perches wrote:
    >
    > > On Tue, 2006-09-26 at 21:56 -0700, Randy Dunlap wrote:
    > > > > Nope, that's part of the NIC's MAC address. It was split up.
    > > >
    > > > Sorry. In this case, it was via-rhine.c:
    > > >
    > > > for (i = 0; i < 5; i++)
    > > > printk("%2.2x:", dev->dev_addr[i]);
    > > > printk("%2.2x, IRQ %d.\n", dev->dev_addr[i], pdev->irq);
    > > >
    > > > so it does break the printk()s up itself.
    > >
    > > Changing all of those MAC address printks to a single function
    > > could prevent this.
    > >
    > > http://www.uwsg.iu.edu/hypermail/linux/net/0602.1/0002.html
    >
    > True enough. Thanks for the patch.
    > However, in this case, the single-printed MAC address still needs
    > a \n, with the IRQ on a separate line (wasting vertical screen space),
    > or it needs a custom printk() that is all done at one time.

    Custom print_mac worked very nice for me in acx driver.
    In order to accomodate arbitrary text before/after mac addres,
    I did it this way:

    #define MACSTR "%02X:%02X:%02X:%02X:%02X:%02X"
    #define MAC(bytevector) \
    ((unsigned char *)bytevector)[0], \
    ((unsigned char *)bytevector)[1], \
    ((unsigned char *)bytevector)[2], \
    ((unsigned char *)bytevector)[3], \
    ((unsigned char *)bytevector)[4], \
    ((unsigned char *)bytevector)[5]

    void print_mac(const char *head, const unsigned char *mac, const char *tail)
    {
    printk("%s"MACSTR"%s", head, MAC(mac), tail);
    }


    Usage: print_mac("adev->bssid: ", adev->bssid, "\n");
    --
    vda
    -
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at http://www.tux.org/lkml/

    \
     
     \ /
      Last update: 2006-09-28 13:05    [W:4.368 / U:0.688 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site