Skip to contentSkip to conversation

netfilter: xt_quota: Don't use aligned attribute in sizeof

PATCH Applied Nathan Chancellor 2 participants 2 messages Oct 6, 2018 – Oct 8, 2018

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

PATCH 1/1 netfilter: xt_quota: Don't use aligned attribute in sizeof

Clang warns:

net/netfilter/xt_quota.c:47:44: warning: 'aligned' attribute ignored when parsing type [-Wignored-attributes]

        BUILD_BUG_ON(sizeof(atomic64_t) != sizeof(__aligned_u64));
                                                  ^~~~~~~~~~~~~

Use 'sizeof(__u64)' instead, as the alignment doesn't affect the size of the type.

Fixes e9837e55b020 ("netfilter: xt_quota: fix the behavior of xt_quota module")
---
 net/netfilter/xt_quota.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
net/netfilter/xt_quota.c +1 -1
index 6afa7f468a73..fceae245eb03 100644
@@ -44,7 +44,7 @@ static int quota_mt_check(const struct xt_mtchk_param *par)
 {
 	struct xt_quota_info *q = par->matchinfo;
 
-	BUILD_BUG_ON(sizeof(atomic64_t) != sizeof(__aligned_u64));
+	BUILD_BUG_ON(sizeof(atomic64_t) != sizeof(__u64));
 
 	if (q->flags & ~XT_QUOTA_MASK)
 		return -EINVAL;
Signature · 1 line
2.19.0
maintainer Applied
#1 lore raw
Quoted 9 lines · Nathan Chancellor

Clang warns:

net/netfilter/xt_quota.c:47:44: warning: 'aligned' attribute ignored when parsing type [-Wignored-attributes]

        BUILD_BUG_ON(sizeof(atomic64_t) != sizeof(__aligned_u64));
                                                  ^~~~~~~~~~~~~

Use 'sizeof(__u64)' instead, as the alignment doesn't affect the size of the type.

Applied, thanks.