@@ -51,13 +51,15 @@ struct rmnet_map_header {
struct rmnet_map_dl_csum_trailer {
u8 reserved1;
- u8 valid:1;
- u8 reserved2:7;
+ u8 flags; /* RMNET_MAP_DL_* */
u16 csum_start_offset;
u16 csum_length;
__be16 csum_value;
} __aligned(1);
+#define RMNET_MAP_DL_CSUM_VALID_FMASK GENMASK(0, 0)
+#define RMNET_MAP_DL_RESERVED_FMASK GENMASK(7, 1)
+
struct rmnet_map_ul_csum_header {
__be16 csum_start_offset;
__be16 csum_info; /* RMNET_MAP_UL_* */
@@ -362,7 +362,7 @@ int rmnet_map_checksum_downlink_packet(struct sk_buff *skb, u16 len)
csum_trailer = (struct rmnet_map_dl_csum_trailer *)(skb->data + len);
- if (!csum_trailer->valid) {
+ if (!u8_get_bits(csum_trailer->flags, RMNET_MAP_DL_CSUM_VALID_FMASK)) {
priv->stats.csum_valid_unset++;
return -EINVAL;
}
Replace the use of C bit-fields in the rmnet_map_dl_csum_trailer structure with a single integral field, using field masks to encode or get at sub-field values. Signed-off-by: Alex Elder <elder@linaro.org> --- drivers/net/ethernet/qualcomm/rmnet/rmnet_map.h | 6 ++++-- drivers/net/ethernet/qualcomm/rmnet/rmnet_map_data.c | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) -- 2.20.1