[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-Id: <20200724.172814.1839512305996345802.davem@davemloft.net>
Date: Fri, 24 Jul 2020 17:28:14 -0700 (PDT)
From: David Miller <davem@...emloft.net>
To: vadym.kochan@...ision.eu
Cc: kuba@...nel.org, jiri@...lanox.com, idosch@...lanox.com,
andrew@...n.ch, oleksandr.mazur@...ision.eu,
serhiy.boiko@...ision.eu, serhiy.pshyk@...ision.eu,
volodymyr.mytnyk@...ision.eu, taras.chornyi@...ision.eu,
andrii.savka@...ision.eu, netdev@...r.kernel.org,
linux-kernel@...r.kernel.org, mickeyr@...vell.com
Subject: Re: [net-next v2 1/6] net: marvell: prestera: Add driver for
Prestera family ASIC devices
From: Vadym Kochan <vadym.kochan@...ision.eu>
Date: Fri, 24 Jul 2020 17:19:52 +0300
> +int prestera_dsa_parse(struct prestera_dsa *dsa, const u8 *dsa_buf)
> +{
> + u32 *dsa_words = (u32 *)dsa_buf;
...
> + words[0] = ntohl((__force __be32)dsa_words[0]);
> + words[1] = ntohl((__force __be32)dsa_words[1]);
> + words[2] = ntohl((__force __be32)dsa_words[2]);
> + words[3] = ntohl((__force __be32)dsa_words[3]);
Isn't is much easier to declare dsa_words as a "__be32 *" instead of
cast after cast after cast?
> +int prestera_dsa_build(const struct prestera_dsa *dsa, u8 *dsa_buf)
> +{
> + __be32 *dsa_words = (__be32 *)dsa_buf;
Which you did properly here.
Powered by blists - more mailing lists