public inbox for llvm@lists.linux.dev
 help / color / mirror / Atom feed
* Re: [PATCH] soc/qcom: use struct_size over open coded arithmetic
       [not found] <20220216030759.1839582-1-chi.minghao@zte.com.cn>
@ 2022-02-16  7:53 ` kernel test robot
  0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2022-02-16  7:53 UTC (permalink / raw)
  To: cgel.zte; +Cc: llvm, kbuild-all

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

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2022-02-16  7:54 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <20220216030759.1839582-1-chi.minghao@zte.com.cn>
2022-02-16  7:53 ` [PATCH] soc/qcom: use struct_size over open coded arithmetic kernel test robot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox