All of lore.kernel.org
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: kbuild@lists.01.org
Subject: Re: [PATCH V1 3/3] rpmsg: char: Add TIOCMGET/TIOCMSET ioctl support
Date: Mon, 08 Nov 2021 19:59:03 +0800	[thread overview]
Message-ID: <202111081917.zPNurV3x-lkp@intel.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 17545 bytes --]

CC: llvm(a)lists.linux.dev
CC: kbuild-all(a)lists.01.org
In-Reply-To: <1633015924-881-5-git-send-email-deesin@codeaurora.org>
References: <1633015924-881-5-git-send-email-deesin@codeaurora.org>
TO: Deepak Kumar Singh <deesin@codeaurora.org>
TO: bjorn.andersson(a)linaro.org
TO: swboyd(a)chromium.org
TO: clew(a)codeaurora.org
TO: mathieu.poirier(a)linaro.org
CC: linux-kernel(a)vger.kernel.org
CC: linux-arm-msm(a)vger.kernel.org
CC: linux-remoteproc(a)vger.kernel.org
CC: Deepak Kumar Singh <deesin@codeaurora.org>
CC: "Ohad Ben-Cohen" <ohad@wizery.com>

Hi Deepak,

Thank you for the patch! Perhaps something to improve:

[auto build test WARNING on linus/master]
[also build test WARNING on v5.15]
[cannot apply to next-20211108]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]

url:    https://github.com/0day-ci/linux/commits/Deepak-Kumar-Singh/rpmsg-core-Add-signal-API-support/20211001-003225
base:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git 02d5e016800d082058b3d3b7c3ede136cdc6ddcb
:::::: branch date: 6 weeks ago
:::::: commit date: 6 weeks ago
config: x86_64-randconfig-c007-20211001 (attached as .config)
compiler: clang version 14.0.0 (https://github.com/llvm/llvm-project 962e503cc8bc411f7523cc393acae8aae425b1c4)
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
        # https://github.com/0day-ci/linux/commit/706239528659b90d79d28e52fcd0538747e66a86
        git remote add linux-review https://github.com/0day-ci/linux
        git fetch --no-tags linux-review Deepak-Kumar-Singh/rpmsg-core-Add-signal-API-support/20211001-003225
        git checkout 706239528659b90d79d28e52fcd0538747e66a86
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=x86_64 clang-analyzer 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>


clang-analyzer warnings: (new ones prefixed by >>)
                   ^               ~~~~~~~~~~~
   net/netfilter/ipvs/ip_vs_core.c:2016:29: warning: The left operand of '==' is a garbage value [clang-analyzer-core.UndefinedBinaryOperatorResult]
                   if (unlikely(iph.protocol == IPPROTO_ICMP)) {
                                             ^
   include/linux/compiler.h:78:42: note: expanded from macro 'unlikely'
   # define unlikely(x)    __builtin_expect(!!(x), 0)
                                               ^
   net/netfilter/ipvs/ip_vs_core.c:1971:6: note: Assuming field 'ipvs_property' is 0
           if (skb->ipvs_property)
               ^~~~~~~~~~~~~~~~~~
   net/netfilter/ipvs/ip_vs_core.c:1971:2: note: Taking false branch
           if (skb->ipvs_property)
           ^
   net/netfilter/ipvs/ip_vs_core.c:1979:16: note: Assuming field 'pkt_type' is equal to 0
           if (unlikely((skb->pkt_type != PACKET_HOST &&
                         ^
   include/linux/compiler.h:78:42: note: expanded from macro 'unlikely'
   # define unlikely(x)    __builtin_expect(!!(x), 0)
                                               ^
   net/netfilter/ipvs/ip_vs_core.c:1979:45: note: Left side of '&&' is false
           if (unlikely((skb->pkt_type != PACKET_HOST &&
                                                      ^
   net/netfilter/ipvs/ip_vs_core.c:1979:6: note: Assuming the condition is false
           if (unlikely((skb->pkt_type != PACKET_HOST &&
               ^
   include/linux/compiler.h:78:22: note: expanded from macro 'unlikely'
   # define unlikely(x)    __builtin_expect(!!(x), 0)
                           ^~~~~~~~~~~~~~~~~~~~~~~~~~
   net/netfilter/ipvs/ip_vs_core.c:1979:2: note: Taking false branch
           if (unlikely((skb->pkt_type != PACKET_HOST &&
           ^
   net/netfilter/ipvs/ip_vs_core.c:1990:15: note: Left side of '||' is false
           if (unlikely(sysctl_backup_only(ipvs) || !ipvs->enable))
                        ^
   net/netfilter/ipvs/ip_vs_core.c:1990:43: note: Assuming field 'enable' is not equal to 0
           if (unlikely(sysctl_backup_only(ipvs) || !ipvs->enable))
                                                    ^
   include/linux/compiler.h:78:42: note: expanded from macro 'unlikely'
   # define unlikely(x)    __builtin_expect(!!(x), 0)
                                               ^
   net/netfilter/ipvs/ip_vs_core.c:1990:2: note: Taking false branch
           if (unlikely(sysctl_backup_only(ipvs) || !ipvs->enable))
           ^
   net/netfilter/ipvs/ip_vs_core.c:1993:2: note: Calling 'ip_vs_fill_iph_skb'
           ip_vs_fill_iph_skb(af, skb, false, &iph);
           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/net/ip_vs.h:129:6: note: 'inverse' is false
           if (inverse)
               ^~~~~~~
   include/net/ip_vs.h:129:2: note: Taking false branch
           if (inverse)
           ^
   include/net/ip_vs.h:132:9: note: Calling 'ip_vs_fill_iph_skb_off'
           return ip_vs_fill_iph_skb_off(af, skb, skb_network_offset(skb),
                  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/net/ip_vs.h:98:7: note: Assuming 'iph' is null
                   if (!iph)
                       ^~~~
   include/net/ip_vs.h:98:3: note: Taking true branch
                   if (!iph)
                   ^
   include/net/ip_vs.h:99:4: note: Returning without writing to 'iphdr->protocol'
                           return 0;
                           ^
   include/net/ip_vs.h:132:9: note: Returning from 'ip_vs_fill_iph_skb_off'
           return ip_vs_fill_iph_skb_off(af, skb, skb_network_offset(skb),
                  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/net/ip_vs.h:132:2: note: Returning without writing to 'iphdr->protocol'
           return ip_vs_fill_iph_skb_off(af, skb, skb_network_offset(skb),
           ^
   net/netfilter/ipvs/ip_vs_core.c:1993:2: note: Returning from 'ip_vs_fill_iph_skb'
           ip_vs_fill_iph_skb(af, skb, false, &iph);
           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   net/netfilter/ipvs/ip_vs_core.c:1997:15: note: 'sk' is null
           if (unlikely(sk && hooknum == NF_INET_LOCAL_OUT &&
                        ^
   include/linux/compiler.h:78:42: note: expanded from macro 'unlikely'
   # define unlikely(x)    __builtin_expect(!!(x), 0)
                                               ^
   net/netfilter/ipvs/ip_vs_core.c:1997:18: note: Left side of '&&' is false
           if (unlikely(sk && hooknum == NF_INET_LOCAL_OUT &&
                           ^
   net/netfilter/ipvs/ip_vs_core.c:1997:2: note: Taking false branch
           if (unlikely(sk && hooknum == NF_INET_LOCAL_OUT &&
           ^
   net/netfilter/ipvs/ip_vs_core.c:2016:29: note: The left operand of '==' is a garbage value
                   if (unlikely(iph.protocol == IPPROTO_ICMP)) {
                                             ^
   include/linux/compiler.h:78:42: note: expanded from macro 'unlikely'
   # define unlikely(x)    __builtin_expect(!!(x), 0)
                                               ^
   Suppressed 3 warnings (3 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
   3 warnings generated.
   Suppressed 3 warnings (3 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
   3 warnings generated.
   Suppressed 3 warnings (3 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
   7 warnings generated.
>> drivers/rpmsg/rpmsg_char.c:310:3: warning: Value stored to 'ret' is never read [clang-analyzer-deadcode.DeadStores]
                   ret = put_user(eptdev->rsigs, (int __user *)arg);
                   ^
   drivers/rpmsg/rpmsg_char.c:310:3: note: Value stored to 'ret' is never read
   drivers/rpmsg/rpmsg_char.c:317:3: warning: Value stored to 'ret' is never read [clang-analyzer-deadcode.DeadStores]
                   ret = rpmsg_set_flow_control(eptdev->ept, set);
                   ^     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/rpmsg/rpmsg_char.c:317:3: note: Value stored to 'ret' is never read
                   ret = rpmsg_set_flow_control(eptdev->ept, set);
                   ^     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/rpmsg/rpmsg_char.c:320:3: warning: Value stored to 'ret' is never read [clang-analyzer-deadcode.DeadStores]
                   ret = rpmsg_eptdev_destroy(&eptdev->dev, NULL);
                   ^     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/rpmsg/rpmsg_char.c:320:3: note: Value stored to 'ret' is never read
                   ret = rpmsg_eptdev_destroy(&eptdev->dev, NULL);
                   ^     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/rpmsg/rpmsg_char.c:323:3: warning: Value stored to 'ret' is never read [clang-analyzer-deadcode.DeadStores]
                   ret = -EINVAL;
                   ^     ~~~~~~~
   drivers/rpmsg/rpmsg_char.c:323:3: note: Value stored to 'ret' is never read
                   ret = -EINVAL;
                   ^     ~~~~~~~
   Suppressed 3 warnings (3 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
   3 warnings generated.
   Suppressed 3 warnings (3 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
   3 warnings generated.
   Suppressed 3 warnings (3 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
   4 warnings generated.
   net/sched/cls_u32.c:242:3: warning: Value stored to 'ht' is never read [clang-analyzer-deadcode.DeadStores]
                   ht = rcu_dereference_bh(n->ht_up);
                   ^
   net/sched/cls_u32.c:242:3: note: Value stored to 'ht' is never read
   Suppressed 3 warnings (3 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
   4 warnings generated.
   net/sched/cls_fw.c:292:32: warning: Access to field 'next' results in a dereference of a null pointer (loaded from variable 'pfp') [clang-analyzer-core.NullDereference]
                   RCU_INIT_POINTER(fnew->next, rtnl_dereference(pfp->next));
                                                ^
   include/linux/rtnetlink.h:81:2: note: expanded from macro 'rtnl_dereference'
           rcu_dereference_protected(p, lockdep_rtnl_is_held())
           ^                         ~
   include/linux/rcupdate.h:587:2: note: expanded from macro 'rcu_dereference_protected'
           __rcu_dereference_protected((p), (c), __rcu)
           ^                            ~
   include/linux/rcupdate.h:398:34: note: expanded from macro '__rcu_dereference_protected'
           ((typeof(*p) __force __kernel *)(p)); \
                                           ^~
   note: (skipping 1 expansions in backtrace; use -fmacro-backtrace-limit=0 to see all)
   include/linux/rcupdate.h:411:59: note: expanded from macro 'RCU_INITIALIZER'
   #define RCU_INITIALIZER(v) (typeof(*(v)) __force __rcu *)(v)
                                                             ^
   include/asm-generic/rwonce.h:61:18: note: expanded from macro 'WRITE_ONCE'
           __WRITE_ONCE(x, val);                                           \
                           ^~~
   include/asm-generic/rwonce.h:55:33: note: expanded from macro '__WRITE_ONCE'
           *(volatile typeof(x) *)&(x) = (val);                            \
                                          ^~~
   net/sched/cls_fw.c:242:25: note: Assuming the condition is false
           struct fw_head *head = rtnl_dereference(tp->root);
                                  ^
   include/linux/rtnetlink.h:81:2: note: expanded from macro 'rtnl_dereference'
           rcu_dereference_protected(p, lockdep_rtnl_is_held())
           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/linux/rcupdate.h:587:2: note: expanded from macro 'rcu_dereference_protected'
           __rcu_dereference_protected((p), (c), __rcu)
           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/linux/rcupdate.h:396:19: note: expanded from macro '__rcu_dereference_protected'
           RCU_LOCKDEP_WARN(!(c), "suspicious rcu_dereference_protected() usage"); \
           ~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/linux/rcupdate.h:318:8: note: expanded from macro 'RCU_LOCKDEP_WARN'
                   if ((c) && debug_lockdep_rcu_enabled() && !__warned) {  \
                        ^
   net/sched/cls_fw.c:242:25: note: Left side of '&&' is false
           struct fw_head *head = rtnl_dereference(tp->root);
                                  ^
   include/linux/rtnetlink.h:81:2: note: expanded from macro 'rtnl_dereference'
           rcu_dereference_protected(p, lockdep_rtnl_is_held())
           ^
   include/linux/rcupdate.h:587:2: note: expanded from macro 'rcu_dereference_protected'
           __rcu_dereference_protected((p), (c), __rcu)
           ^
   include/linux/rcupdate.h:396:2: note: expanded from macro '__rcu_dereference_protected'
           RCU_LOCKDEP_WARN(!(c), "suspicious rcu_dereference_protected() usage"); \
           ^
   include/linux/rcupdate.h:318:11: note: expanded from macro 'RCU_LOCKDEP_WARN'
                   if ((c) && debug_lockdep_rcu_enabled() && !__warned) {  \
                           ^
   net/sched/cls_fw.c:242:25: note: Loop condition is false.  Exiting loop
           struct fw_head *head = rtnl_dereference(tp->root);
                                  ^
   include/linux/rtnetlink.h:81:2: note: expanded from macro 'rtnl_dereference'
           rcu_dereference_protected(p, lockdep_rtnl_is_held())
           ^
   include/linux/rcupdate.h:587:2: note: expanded from macro 'rcu_dereference_protected'
           __rcu_dereference_protected((p), (c), __rcu)
           ^
   include/linux/rcupdate.h:396:2: note: expanded from macro '__rcu_dereference_protected'
           RCU_LOCKDEP_WARN(!(c), "suspicious rcu_dereference_protected() usage"); \

vim +/ret +310 drivers/rpmsg/rpmsg_char.c

c0cdc19f84a4712 Bjorn Andersson    2017-01-11  295  
c0cdc19f84a4712 Bjorn Andersson    2017-01-11  296  static long rpmsg_eptdev_ioctl(struct file *fp, unsigned int cmd,
c0cdc19f84a4712 Bjorn Andersson    2017-01-11  297  			       unsigned long arg)
c0cdc19f84a4712 Bjorn Andersson    2017-01-11  298  {
c0cdc19f84a4712 Bjorn Andersson    2017-01-11  299  	struct rpmsg_eptdev *eptdev = fp->private_data;
706239528659b90 Deepak Kumar Singh 2021-09-30  300  	bool set;
706239528659b90 Deepak Kumar Singh 2021-09-30  301  	u32 val;
706239528659b90 Deepak Kumar Singh 2021-09-30  302  	int ret;
c0cdc19f84a4712 Bjorn Andersson    2017-01-11  303  
c0cdc19f84a4712 Bjorn Andersson    2017-01-11  304  	if (cmd != RPMSG_DESTROY_EPT_IOCTL)
c0cdc19f84a4712 Bjorn Andersson    2017-01-11  305  		return -EINVAL;
c0cdc19f84a4712 Bjorn Andersson    2017-01-11  306  
706239528659b90 Deepak Kumar Singh 2021-09-30  307  	switch (cmd) {
706239528659b90 Deepak Kumar Singh 2021-09-30  308  	case TIOCMGET:
706239528659b90 Deepak Kumar Singh 2021-09-30  309  		eptdev->sig_pending = false;
706239528659b90 Deepak Kumar Singh 2021-09-30 @310  		ret = put_user(eptdev->rsigs, (int __user *)arg);
706239528659b90 Deepak Kumar Singh 2021-09-30  311  		break;
706239528659b90 Deepak Kumar Singh 2021-09-30  312  	case TIOCMSET:
706239528659b90 Deepak Kumar Singh 2021-09-30  313  		ret = get_user(val, (int __user *)arg);
706239528659b90 Deepak Kumar Singh 2021-09-30  314  		if (ret)
706239528659b90 Deepak Kumar Singh 2021-09-30  315  			break;
706239528659b90 Deepak Kumar Singh 2021-09-30  316  		set = (val & TIOCM_DTR) ? true : false;
706239528659b90 Deepak Kumar Singh 2021-09-30  317  		ret = rpmsg_set_flow_control(eptdev->ept, set);
706239528659b90 Deepak Kumar Singh 2021-09-30  318  		break;
706239528659b90 Deepak Kumar Singh 2021-09-30  319  	case RPMSG_DESTROY_EPT_IOCTL:
706239528659b90 Deepak Kumar Singh 2021-09-30  320  		ret = rpmsg_eptdev_destroy(&eptdev->dev, NULL);
706239528659b90 Deepak Kumar Singh 2021-09-30  321  		break;
706239528659b90 Deepak Kumar Singh 2021-09-30  322  	default:
706239528659b90 Deepak Kumar Singh 2021-09-30  323  		ret = -EINVAL;
706239528659b90 Deepak Kumar Singh 2021-09-30  324  	}
706239528659b90 Deepak Kumar Singh 2021-09-30  325  
c0cdc19f84a4712 Bjorn Andersson    2017-01-11  326  	return rpmsg_eptdev_destroy(&eptdev->dev, NULL);
c0cdc19f84a4712 Bjorn Andersson    2017-01-11  327  }
c0cdc19f84a4712 Bjorn Andersson    2017-01-11  328  

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org

[-- Attachment #2: config.gz --]
[-- Type: application/gzip, Size: 37761 bytes --]

             reply	other threads:[~2021-11-08 11:59 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-08 11:59 kernel test robot [this message]
2021-11-12  2:50 ` [PATCH V1 3/3] rpmsg: char: Add TIOCMGET/TIOCMSET ioctl support kernel test robot
2021-11-12  2:50   ` kernel test robot
  -- strict thread matches above, loose matches on Subject: below --
2021-09-30 15:32 [PATCH V1 0/3] rpmsg and glink signaling api support Deepak Kumar Singh
2021-09-30 15:32 ` [PATCH V1 3/3] rpmsg: char: Add TIOCMGET/TIOCMSET ioctl support Deepak Kumar Singh
2021-09-30 16:36   ` Stephen Boyd
2021-10-11 18:22   ` Mathieu Poirier

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=202111081917.zPNurV3x-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=kbuild@lists.01.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.