driverdev-devel.linuxdriverproject.org archive mirror
 help / color / mirror / Atom feed
From: Sven Van Asbroeck <thesven73@gmail.com>
To: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Cc: devel@driverdev.osuosl.org,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Subject: Re: [PATCH v1] staging: fieldbus: Use %pM format specifier for MAC addresses
Date: Thu, 30 Jul 2020 21:32:49 -0400	[thread overview]
Message-ID: <CAGngYiW6+-bcOH-_K7U3b1uVisHy4bbFX5CM9iA265GAzOLayw@mail.gmail.com> (raw)
In-Reply-To: <20200730152724.39250-1-andriy.shevchenko@linux.intel.com>

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

On Thu, Jul 30, 2020 at 11:27 AM Andy Shevchenko
<andriy.shevchenko@linux.intel.com> 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@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

      parent reply	other threads:[~2020-07-31  1:33 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-30 15:27 [PATCH v1] staging: fieldbus: Use %pM format specifier for MAC addresses Andy Shevchenko
2020-07-30 17:34 ` kernel test robot
2020-07-31  1:32 ` Sven Van Asbroeck [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAGngYiW6+-bcOH-_K7U3b1uVisHy4bbFX5CM9iA265GAzOLayw@mail.gmail.com \
    --to=thesven73@gmail.com \
    --cc=andriy.shevchenko@linux.intel.com \
    --cc=devel@driverdev.osuosl.org \
    --cc=gregkh@linuxfoundation.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).