Re: [PATCH net-next 4/5] net: phy: broadcom: Add support for WAKE_FILTER

From: Vincent MAILHOL
Date: Thu Oct 26 2023 - 22:51:42 EST


On Fri. 27 Oct. 2023 at 02:55, Florian Fainelli
<florian.fainelli@xxxxxxxxxxxx> wrote:
> Hi Vincent,
>
> On 10/25/23 19:13, Vincent MAILHOL wrote:
> [snip]
> >>
> >> This looks like an endianness conversion (I can not tell if this is
> >> big to little or the opposite)...
> >
> > Oopsy! On second look, this is an open coded cpu to big endian
> > conversion. So the question I should have asked is:
> >
> > why not use the put_unaligned_be16() helper here?
>
> Because this is consistent with the existing code, though I will keep
> that suggestion in mind as a subsequent patch. I personally find it
> clearer expressed that way, but can update.

Fair enough. I agree that this is not something to be fixed in this series.

For your future consideration, I would have done it as:

__be16 da[ETH_ALEN / sizeof(__be16)];
/* ... */
da[i] = cpu_to_be16(~ret);

da[] can eventually be casted back to u8 * once populated.

(...)