Re: [PATCH v1] staging: fieldbus: Use %pM format specifier for MAC addresses

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Andy, thank you for the patch ! See below.

On Thu, Jul 30, 2020 at 11:27 AM Andy Shevchenko
<andriy.shevchenko@xxxxxxxxxxxxxxx> wrote:
>
> -struct msg_mac_addr {
> -       u8 addr[6];
> -};

I would prefer to keep this structure. It's conceptually important,
because it describes the binary layout of a message going to a
peripheral.

Perhaps you can still print using %pM by doing:
printf("%pM\n", response.addr) ?

> @@ -59,17 +55,13 @@ static int profi_id_get(struct fieldbus_dev *fbdev, char *buf,
>                         size_t max_size)
>  {
>         struct profi_priv *priv = container_of(fbdev, struct profi_priv, fbdev);
> -       struct msg_mac_addr response;
> +       u8 mac[ETH_ALEN];
>         int ret;
>
> -       ret = anybuss_recv_msg(priv->client, 0x0010, &response,
> -                              sizeof(response));
> +       ret = anybuss_recv_msg(priv->client, 0x0010, &mac, sizeof(mac));

Should the address-of operator (&) be present in &mac ?
_______________________________________________
devel mailing list
devel@xxxxxxxxxxxxxxxxxxxxxx
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel



[Index of Archives]     [Linux Driver Backports]     [DMA Engine]     [Linux GPIO]     [Linux SPI]     [Video for Linux]     [Linux USB Devel]     [Linux Coverity]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux