summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTobias Klauser <tklauser@distanz.ch>2016-10-21 12:03:35 +0200
committerTobias Klauser <tklauser@distanz.ch>2016-10-21 12:03:35 +0200
commit7ca8017e5abf4400d0e19c05633d4553092a4c3c (patch)
treee63620375adfed0ec1b3a3e0ccc8ba59d72adda1
parent8368a551382bfa3a50b393873be341cd3c17f6df (diff)
trafgen: proto: Don't drop const qualifier during cast
Don't drop const qualifier during cast to uint32_t * Found by compiling with -Wcast-qual. Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
-rw-r--r--trafgen_proto.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/trafgen_proto.c b/trafgen_proto.c
index 0b791f7..316fa97 100644
--- a/trafgen_proto.c
+++ b/trafgen_proto.c
@@ -213,7 +213,7 @@ static void __proto_field_set_bytes(struct proto_hdr *hdr, uint32_t fid,
*p16 = be16_to_cpu(*p16);
*p16 = cpu_to_be16(field->mask ? *p16 & ~field->mask : *p16);
- v16 = field_shift_and_mask(field, *(uint16_t *)bytes);
+ v16 = field_shift_and_mask(field, *(const uint16_t *)bytes);
v16 = is_be ? cpu_to_be16(v16) : v16;
v16 = field->mask ? (v16 | *p16) : v16;
@@ -223,7 +223,7 @@ static void __proto_field_set_bytes(struct proto_hdr *hdr, uint32_t fid,
*p32 = be32_to_cpu(*p32);
*p32 = cpu_to_be32(field->mask ? *p32 & ~field->mask : *p32);
- v32 = field_shift_and_mask(field, *(uint32_t *)bytes);
+ v32 = field_shift_and_mask(field, *(const uint32_t *)bytes);
v32 = is_be ? cpu_to_be32(v32) : v32;
v32 = field->mask ? (v32 | *p32) : v32;