]> granicus.if.org Git - libnl/commitdiff
lib/route/cls/u32.c: let the compiler do pointer arithmetic
authorRasmus Villemoes <linux@rasmusvillemoes.dk>
Thu, 8 Jun 2017 08:59:25 +0000 (10:59 +0200)
committerRasmus Villemoes <linux@rasmusvillemoes.dk>
Thu, 8 Jun 2017 08:59:25 +0000 (10:59 +0200)
This is what ->, [] and & are for.

lib/route/cls/u32.c

index 2ea9bd4cdde7a853d3286c83ac2af0faeb2fc7d8..82b56652093fefb1f47b2c7c660eb8cc91e2d2bf 100644 (file)
@@ -264,7 +264,7 @@ static void print_selector(struct nl_dump_params *p, struct tc_u32_sel *sel,
 
 
        for (i = 0; i < sel->nkeys; i++) {
-               key = (struct tc_u32_key *) ((char *) sel + sizeof(*sel)) + i;
+               key = &sel->keys[i];
 
                nl_dump(p, "\n");
                nl_dump_line(p, "      match key at %s%u ",