Skip to content

Commit

Permalink
net: sched: cls_u32: use hash_ptr() for tc_u_hash
Browse files Browse the repository at this point in the history
After the change to the tp hash, we now get a build warning
on 32-bit architectures:

net/sched/cls_u32.c: In function 'tc_u_hash':
net/sched/cls_u32.c:338:17: error: cast from pointer to integer of different size [-Werror=pointer-to-int-cast]
  return hash_64((u64) tp->chain->block, U32_HASH_SHIFT);

Using hash_ptr() instead of hash_64() lets us drop the cast
and fixes the warning while still resulting in the same hash
value.

Fixes: 7fa9d97 ("net: sched: cls_u32: use block instead of q in tc_u_common")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Acked-by: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Arnd Bergmann authored and David S. Miller committed Oct 20, 2017
1 parent c75e427 commit d18b4b3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion net/sched/cls_u32.c
Original file line number Diff line number Diff line change
Expand Up @@ -335,7 +335,7 @@ static struct hlist_head *tc_u_common_hash;

static unsigned int tc_u_hash(const struct tcf_proto *tp)
{
return hash_64((u64) tp->chain->block, U32_HASH_SHIFT);
return hash_ptr(tp->chain->block, U32_HASH_SHIFT);
}

static struct tc_u_common *tc_u_common_find(const struct tcf_proto *tp)
Expand Down

0 comments on commit d18b4b3

Please sign in to comment.