public inbox for llvm@lists.linux.dev
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: cgel.zte@gmail.com
Cc: llvm@lists.linux.dev, kbuild-all@lists.01.org
Subject: Re: [PATCH] soc/qcom: use struct_size over open coded arithmetic
Date: Wed, 16 Feb 2022 15:53:59 +0800	[thread overview]
Message-ID: <202202161548.Pvcgszt3-lkp@intel.com> (raw)
In-Reply-To: <20220216030759.1839582-1-chi.minghao@zte.com.cn>

Hi,

Thank you for the patch! Yet something to improve:

[auto build test ERROR on linus/master]
[also build test ERROR on v5.17-rc4 next-20220215]
[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/cgel-zte-gmail-com/soc-qcom-use-struct_size-over-open-coded-arithmetic/20220216-111200
base:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git c5d9ae265b105d9a67575fb67bd4650a6fc08e25
config: hexagon-randconfig-r045-20220216 (https://download.01.org/0day-ci/archive/20220216/202202161548.Pvcgszt3-lkp@intel.com/config)
compiler: clang version 15.0.0 (https://github.com/llvm/llvm-project 0e628a783b935c70c80815db6c061ec84f884af5)
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/51dde142db132ac922a62df2932acb6f27528e99
        git remote add linux-review https://github.com/0day-ci/linux
        git fetch --no-tags linux-review cgel-zte-gmail-com/soc-qcom-use-struct_size-over-open-coded-arithmetic/20220216-111200
        git checkout 51dde142db132ac922a62df2932acb6f27528e99
        # save the config file to linux build tree
        mkdir build_dir
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=hexagon SHELL=/bin/bash drivers/soc/qcom/

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

All error/warnings (new ones prefixed by >>):

>> drivers/soc/qcom/apr.c:174:18: warning: ignoring return value of function declared with 'warn_unused_result' attribute [-Wunused-result]
           abuf = kzalloc((struct_size(abuf, buf, len), GFP_ATOMIC);
                           ^~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/linux/overflow.h:193:2: note: expanded from macro 'struct_size'
           __ab_c_size(count,                                              \
           ^~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>> drivers/soc/qcom/apr.c:174:58: error: expected ')'
           abuf = kzalloc((struct_size(abuf, buf, len), GFP_ATOMIC);
                                                                   ^
   drivers/soc/qcom/apr.c:174:16: note: to match this '('
           abuf = kzalloc((struct_size(abuf, buf, len), GFP_ATOMIC);
                         ^
   1 warning and 1 error generated.


vim +174 drivers/soc/qcom/apr.c

   160	
   161	static int apr_callback(struct rpmsg_device *rpdev, void *buf,
   162					  int len, void *priv, u32 addr)
   163	{
   164		struct packet_router *apr = dev_get_drvdata(&rpdev->dev);
   165		struct apr_rx_buf *abuf;
   166		unsigned long flags;
   167	
   168		if (len <= APR_HDR_SIZE) {
   169			dev_err(apr->dev, "APR: Improper apr pkt received:%p %d\n",
   170				buf, len);
   171			return -EINVAL;
   172		}
   173	
 > 174		abuf = kzalloc((struct_size(abuf, buf, len), GFP_ATOMIC);
   175		if (!abuf)
   176			return -ENOMEM;
   177	
   178		abuf->len = len;
   179		memcpy(abuf->buf, buf, len);
   180	
   181		spin_lock_irqsave(&apr->rx_lock, flags);
   182		list_add_tail(&abuf->node, &apr->rx_list);
   183		spin_unlock_irqrestore(&apr->rx_lock, flags);
   184	
   185		queue_work(apr->rxwq, &apr->rx_work);
   186	
   187		return 0;
   188	}
   189	

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

           reply	other threads:[~2022-02-16  7:54 UTC|newest]

Thread overview: expand[flat|nested]  mbox.gz  Atom feed
 [parent not found: <20220216030759.1839582-1-chi.minghao@zte.com.cn>]

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=202202161548.Pvcgszt3-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=cgel.zte@gmail.com \
    --cc=kbuild-all@lists.01.org \
    --cc=llvm@lists.linux.dev \
    /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