nfp: bpf: use the power of sparse to check we encode registers right
authorJakub Kicinski <jakub.kicinski@netronome.com>
Mon, 9 Oct 2017 04:04:05 +0000 (21:04 -0700)
committerDavid S. Miller <davem@davemloft.net>
Mon, 9 Oct 2017 16:51:02 +0000 (09:51 -0700)
commitb3f868df3c8904e964d7b257b47d7d90d93375e0
tree75712f0fc786c1b5e15786212a27c2e9bdbbb96f
parenta52b35c39ec6f33592df634ef2d1afae23401fdd
nfp: bpf: use the power of sparse to check we encode registers right

Define a new __bitwise type for software representation of registers.
This will allow us to catch incorrect parameter types using sparse.

Accessors we define also allow us to return correct enum type and
therefore ensure all switches handle all register types.

Signed-off-by: Jakub Kicinski <jakub.kicinski@netronome.com>
Reviewed-by: Simon Horman <simon.horman@netronome.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/netronome/nfp/bpf/jit.c
drivers/net/ethernet/netronome/nfp/bpf/main.h
drivers/net/ethernet/netronome/nfp/nfp_asm.h