From: kernel test robot <lkp@intel.com>
To: Pablo Neira Ayuso <pablo@netfilter.org>
Cc: kbuild-all@lists.01.org, clang-built-linux@googlegroups.com,
netfilter-devel@vger.kernel.org, coreteam@netfilter.org
Subject: [nf:master 7/7] net/netfilter/nf_tables_api.c:920:15: warning: converting the enum constant to a boolean
Date: Tue, 2 Mar 2021 21:17:37 +0800 [thread overview]
Message-ID: <202103022132.6FiROxhQ-lkp@intel.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 3271 bytes --]
tree: https://git.kernel.org/pub/scm/linux/kernel/git/pablo/nf.git master
head: 64d075d0d3770d761018500d59dbca37b1867017
commit: 64d075d0d3770d761018500d59dbca37b1867017 [7/7] netfilter: nftables: disallow updates on table ownership
config: powerpc64-randconfig-r022-20210302 (attached as .config)
compiler: clang version 13.0.0 (https://github.com/llvm/llvm-project 5de09ef02e24d234d9fc0cd1c6dfe18a1bb784b0)
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# install powerpc64 cross compiling tool for clang build
# apt-get install binutils-powerpc64-linux-gnu
# https://git.kernel.org/pub/scm/linux/kernel/git/pablo/nf.git/commit/?id=64d075d0d3770d761018500d59dbca37b1867017
git remote add nf https://git.kernel.org/pub/scm/linux/kernel/git/pablo/nf.git
git fetch --no-tags nf master
git checkout 64d075d0d3770d761018500d59dbca37b1867017
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=powerpc64
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
All warnings (new ones prefixed by >>):
>> net/netfilter/nf_tables_api.c:920:15: warning: converting the enum constant to a boolean [-Wint-in-bool-context]
!(flags && NFT_TABLE_F_OWNER)) ||
^
1 warning generated.
vim +920 net/netfilter/nf_tables_api.c
902
903 static int nf_tables_updtable(struct nft_ctx *ctx)
904 {
905 struct nft_trans *trans;
906 u32 flags;
907 int ret = 0;
908
909 if (!ctx->nla[NFTA_TABLE_FLAGS])
910 return 0;
911
912 flags = ntohl(nla_get_be32(ctx->nla[NFTA_TABLE_FLAGS]));
913 if (flags & ~NFT_TABLE_F_MASK)
914 return -EOPNOTSUPP;
915
916 if (flags == ctx->table->flags)
917 return 0;
918
919 if ((nft_table_has_owner(ctx->table) &&
> 920 !(flags && NFT_TABLE_F_OWNER)) ||
921 (!nft_table_has_owner(ctx->table) &&
922 flags & NFT_TABLE_F_OWNER))
923 return -EOPNOTSUPP;
924
925 trans = nft_trans_alloc(ctx, NFT_MSG_NEWTABLE,
926 sizeof(struct nft_trans_table));
927 if (trans == NULL)
928 return -ENOMEM;
929
930 if ((flags & NFT_TABLE_F_DORMANT) &&
931 !(ctx->table->flags & NFT_TABLE_F_DORMANT)) {
932 nft_trans_table_enable(trans) = false;
933 } else if (!(flags & NFT_TABLE_F_DORMANT) &&
934 ctx->table->flags & NFT_TABLE_F_DORMANT) {
935 ctx->table->flags &= ~NFT_TABLE_F_DORMANT;
936 ret = nf_tables_table_enable(ctx->net, ctx->table);
937 if (ret >= 0)
938 nft_trans_table_enable(trans) = true;
939 else
940 ctx->table->flags |= NFT_TABLE_F_DORMANT;
941 }
942 if (ret < 0)
943 goto err;
944
945 nft_trans_table_update(trans) = true;
946 list_add_tail(&trans->list, &ctx->net->nft.commit_list);
947 return 0;
948 err:
949 nft_trans_destroy(trans);
950 return ret;
951 }
952
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 32895 bytes --]
next reply other threads:[~2021-03-02 23:39 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-03-02 13:17 kernel test robot [this message]
2021-03-02 15:38 ` [nf:master 7/7] net/netfilter/nf_tables_api.c:920:15: warning: converting the enum constant to a boolean Pablo Neira Ayuso
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=202103022132.6FiROxhQ-lkp@intel.com \
--to=lkp@intel.com \
--cc=clang-built-linux@googlegroups.com \
--cc=coreteam@netfilter.org \
--cc=kbuild-all@lists.01.org \
--cc=netfilter-devel@vger.kernel.org \
--cc=pablo@netfilter.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).