[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20141205102547.GH1866@nanopsycho.orion>
Date: Fri, 5 Dec 2014 11:25:47 +0100
From: Jiri Pirko <jiri@...nulli.us>
To: David Laight <David.Laight@...LAB.COM>
Cc: 'Scott Feldman' <sfeldma@...il.com>,
Netdev <netdev@...r.kernel.org>,
"David S. Miller" <davem@...emloft.net>
Subject: Re: [patch net-next v2 1/2] rocker: introduce be put/get variants
and use it when appropriate
Fri, Dec 05, 2014 at 10:57:43AM CET, David.Laight@...LAB.COM wrote:
>From: Scott Feldman
>> Signed-off-by: Scott Feldman <sfeldma@...il.com>
>>
>> On Wed, Dec 3, 2014 at 5:14 AM, Jiri Pirko <jiri@...nulli.us> wrote:
>> > This kills the sparse warnings.
>> >
>> > Signed-off-by: Jiri Pirko <jiri@...nulli.us>
>> > ---
>> > v1->v2:
>> > -no change
>> > ---
>> > drivers/net/ethernet/rocker/rocker.c | 79 ++++++++++++++++++++++--------------
>> > 1 file changed, 48 insertions(+), 31 deletions(-)
>> >
>> > diff --git a/drivers/net/ethernet/rocker/rocker.c b/drivers/net/ethernet/rocker/rocker.c
>> > index fded127..4b060fb 100644
>> > --- a/drivers/net/ethernet/rocker/rocker.c
>> > +++ b/drivers/net/ethernet/rocker/rocker.c
>> > @@ -648,6 +648,11 @@ static u16 rocker_tlv_get_u16(const struct rocker_tlv *tlv)
>> > return *(u16 *) rocker_tlv_data(tlv);
>> > }
>> >
>> > +static __be16 rocker_tlv_get_be16(const struct rocker_tlv *tlv)
>> > +{
>> > + return *(__be16 *) rocker_tlv_data(tlv);
>> > +}
>
>*(int_type *)foo always rings alarm bells.....
>
>That looks dubious on systems where misaligned transfers fault.
This is common use:
for example nla_get_be16
but when you grep kernel, you see many more.
Also, rocker has all accesses like these aligned.
>
> David
>
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists