public inbox for netdev@vger.kernel.org
 help / color / mirror / Atom feed
From: Oliver Neukum <oneukum@suse.com>
To: Ethan Nelson-Moore <enelsonmoore@gmail.com>,
	netdev@vger.kernel.org, linux-usb@vger.kernel.org
Cc: Andrew Lunn <andrew+netdev@lunn.ch>,
	"David S. Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@google.com>,
	Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>
Subject: Re: [PATCH net-next 3/3] net: usb: kaweth: remove eth_addr_t typedef and bcast_addr definition
Date: Mon, 26 Jan 2026 12:49:35 +0100	[thread overview]
Message-ID: <9239ddef-c197-4fbd-8e88-691766bda3e2@suse.com> (raw)
In-Reply-To: <20260125083501.34513-4-enelsonmoore@gmail.com>

Hi,

unfortunately I must NACK this patch. Let me explain:

On 25.01.26 09:34, Ethan Nelson-Moore wrote:

>   /****************************************************************
>    *     usb_eth_dev
>    ****************************************************************/
> @@ -185,7 +183,7 @@ struct kaweth_ethernet_configuration
>   	__u8 size;
>   	__u8 reserved1;
>   	__u8 reserved2;
> -	eth_addr_t hw_addr;
> +	u8 hw_addr[ETH_ALEN];

You may note that this data structure is declared __packed
and the member hw_addr is preceded by three members of type __u8.
That means that it is located on a _three_ byte alignment.

>   	__u32 statistics_mask;
>   	__le16 segment_size;
>   	__u16 max_multicast_filters;
> @@ -882,7 +880,6 @@ static int kaweth_probe(

[..]
   
> @@ -991,9 +988,7 @@ static int kaweth_probe(
>   	dev_info(dev, "MTU: %d\n", le16_to_cpu(kaweth->configuration.segment_size));
>   	dev_info(dev, "Read MAC address %pM\n", kaweth->configuration.hw_addr);
>   
> -	if(!memcmp(&kaweth->configuration.hw_addr,
> -                   &bcast_addr,
> -		   sizeof(bcast_addr))) {
> +	if (is_broadcast_ether_addr((const u8 *)&kaweth->configuration.hw_addr)) {

Here you are using is_broadcast_ether_addr(). Let me quote
from the documentation on this helper:

/**
  * is_broadcast_ether_addr - Determine if the Ethernet address is broadcast
  * @addr: Pointer to a six-byte array containing the Ethernet address
  *
  * Return: true if the address is the broadcast address.
  *
  * Please note: addr must be aligned to u16.
  */

That requirement is not met. This code will bomb on ARM for example.

	HTH
		Oliver

NACKED-BY: Oliver Neukum <oneukum@suse.com>


  reply	other threads:[~2026-01-26 11:49 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-01-25  8:34 [PATCH net-next 0/3] net: usb: adhere to style by removing typedefs Ethan Nelson-Moore
2026-01-25  8:34 ` [PATCH net-next 1/3] net: usb: rtl8150: remove rtl8150_t typedef for struct rtl8150 Ethan Nelson-Moore
2026-01-25 16:40   ` Andrew Lunn
2026-01-25 21:49     ` Ethan Nelson-Moore
2026-01-25  8:34 ` [PATCH net-next 2/3] net: usb: pegasus: remove pegasus_t typedef for struct pegasus Ethan Nelson-Moore
2026-01-25  8:34 ` [PATCH net-next 3/3] net: usb: kaweth: remove eth_addr_t typedef and bcast_addr definition Ethan Nelson-Moore
2026-01-26 11:49   ` Oliver Neukum [this message]
2026-01-27  4:38     ` Ethan Nelson-Moore
2026-01-27  9:23       ` Oliver Neukum
2026-01-29  3:41         ` Ethan Nelson-Moore
2026-01-29  9:13           ` Oliver Neukum

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=9239ddef-c197-4fbd-8e88-691766bda3e2@suse.com \
    --to=oneukum@suse.com \
    --cc=andrew+netdev@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=enelsonmoore@gmail.com \
    --cc=kuba@kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    /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