Skip to contentSkip to conversation

netfilter: nft_redir: fix sparse warnings: cast to restricted __be32

PATCH In review Arturo Borrero Gonzalez 2 participants 3 messages Nov 12, 2014

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 netfilter: nft_redir: fix sparse warnings: cast to restricted __be32

This patch fixes some sparse warnings:

net/netfilter/nft_redir.c:39:26: sparse: incorrect type in assignment (different base types)
net/netfilter/nft_redir.c:39:26: expected unsigned int [unsigned] [usertype] nla_be32
net/netfilter/nft_redir.c:39:26: got restricted __be32
net/netfilter/nft_redir.c:40:40: sparse: cast to restricted __be32 net/netfilter/nft_redir.c:40:40: sparse: cast to restricted __be32 net/netfilter/nft_redir.c:40:40: sparse: cast to restricted __be32 net/netfilter/nft_redir.c:40:40: sparse: cast to restricted __be32 net/netfilter/nft_redir.c:40:40: sparse: cast to restricted __be32 net/netfilter/nft_redir.c:40:40: sparse: cast to restricted __be32 net/netfilter/nft_redir.c:46:34: sparse: incorrect type in assignment (different base types)
net/netfilter/nft_redir.c:46:34: expected unsigned int [unsigned] [usertype] nla_be32
net/netfilter/nft_redir.c:46:34: got restricted __be32
net/netfilter/nft_redir.c:47:48: sparse: cast to restricted __be32 net/netfilter/nft_redir.c:47:48: sparse: cast to restricted __be32 net/netfilter/nft_redir.c:47:48: sparse: cast to restricted __be32 net/netfilter/nft_redir.c:47:48: sparse: cast to restricted __be32 net/netfilter/nft_redir.c:47:48: sparse: cast to restricted __be32 net/netfilter/nft_redir.c:47:48: sparse: cast to restricted __be32

---
 net/netfilter/nft_redir.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
net/netfilter/nft_redir.c +1 -1
index e27b4e3..dd2aa78 100644
@@ -28,7 +28,7 @@ int nft_redir_init(const struct nft_ctx *ctx,
 		   const struct nlattr * const tb[])
 {
 	struct nft_redir *priv = nft_expr_priv(expr);
-	u32 nla_be32;
+	__be32 nla_be32;
 	int err;
 
 	err = nft_chain_validate_dependency(ctx->chain, NFT_CHAIN_T_NAT);
#1 lore raw
Quoted 32 lines · Arturo Borrero Gonzalez

This patch fixes some sparse warnings:

net/netfilter/nft_redir.c:39:26: sparse: incorrect type in assignment (different base types)
net/netfilter/nft_redir.c:39:26: expected unsigned int [unsigned] [usertype] nla_be32
net/netfilter/nft_redir.c:39:26: got restricted __be32
net/netfilter/nft_redir.c:40:40: sparse: cast to restricted __be32 net/netfilter/nft_redir.c:40:40: sparse: cast to restricted __be32 net/netfilter/nft_redir.c:40:40: sparse: cast to restricted __be32 net/netfilter/nft_redir.c:40:40: sparse: cast to restricted __be32 net/netfilter/nft_redir.c:40:40: sparse: cast to restricted __be32 net/netfilter/nft_redir.c:40:40: sparse: cast to restricted __be32 net/netfilter/nft_redir.c:46:34: sparse: incorrect type in assignment (different base types)
net/netfilter/nft_redir.c:46:34: expected unsigned int [unsigned] [usertype] nla_be32
net/netfilter/nft_redir.c:46:34: got restricted __be32
net/netfilter/nft_redir.c:47:48: sparse: cast to restricted __be32 net/netfilter/nft_redir.c:47:48: sparse: cast to restricted __be32 net/netfilter/nft_redir.c:47:48: sparse: cast to restricted __be32 net/netfilter/nft_redir.c:47:48: sparse: cast to restricted __be32 net/netfilter/nft_redir.c:47:48: sparse: cast to restricted __be32 net/netfilter/nft_redir.c:47:48: sparse: cast to restricted __be32

---
 net/netfilter/nft_redir.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
net/netfilter/nft_redir.c +0 -0
index e27b4e3..dd2aa78 100644

net/netfilter/nft_redir.c int nft_redir_init(const struct nft_ctx *ctx, · line 31

Quoted 5 lines
net/netfilter/nft_redir.c +1 -1
@@ -28,7 +28,7 @@ int nft_redir_init(const struct nft_ctx *ctx,
 		   const struct nlattr * const tb[])
 {
 	struct nft_redir *priv = nft_expr_priv(expr);
-	u32 nla_be32;
+	__be32 nla_be32;

Thanks Arturo.

I already sent a patch, I prefer to get rid of this variable for consistency with other nft nat-like expressions.

#2 lore raw
Quoted 5 lines · Pablo Neira Ayuso

Thanks Arturo.

I already sent a patch, I prefer to get rid of this variable for consistency with other nft nat-like expressions.

Sure, I just wasn't aware of your patch when sending mine.

Signature · 5 lines
Arturo Borrero González
--
To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html