Re: [PATCH 7/8] net: qualcomm: rmnet: mark endianness of struct rmnet_map_dl_csum_trailer fields

From: Bjorn Andersson
Date: Mon May 20 2019 - 13:19:56 EST


On Mon 20 May 06:53 PDT 2019, Alex Elder wrote:

> Two 16-bit fields (csum_start_offset and csum_length) in the
> rmnet_map_dl_csum_trailer structure are currently defined to have
> type u16. But they are in fact big endian values, so should be
> properly represented as __be16 values.
>
> No existing code actually references these fields (they're ignored by
> rmnet_map_ipv4_dl_csum_trailer() and rmnet_map_ipv6_dl_csum_trailer()).
> Changing their type therefore causes no harm, so just fix them.
>
> Signed-off-by: Alex Elder <elder@xxxxxxxxxx>

Reviewed-by: Bjorn Andersson <bjorn.andersson@xxxxxxxxxx>

> ---
> drivers/net/ethernet/qualcomm/rmnet/rmnet_map.h | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/net/ethernet/qualcomm/rmnet/rmnet_map.h b/drivers/net/ethernet/qualcomm/rmnet/rmnet_map.h
> index fb1cdb4ec41f..775b98d34e94 100644
> --- a/drivers/net/ethernet/qualcomm/rmnet/rmnet_map.h
> +++ b/drivers/net/ethernet/qualcomm/rmnet/rmnet_map.h
> @@ -52,8 +52,8 @@ struct rmnet_map_header {
> struct rmnet_map_dl_csum_trailer {
> u8 reserved1;
> u8 flags; /* RMNET_MAP_DL_* */
> - u16 csum_start_offset;
> - u16 csum_length;
> + __be16 csum_start_offset;
> + __be16 csum_length;
> __be16 csum_value;
> } __aligned(1);
>
> --
> 2.20.1
>