lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Tue, 8 Jan 2019 19:23:34 +0800
From:   kbuild test robot <lkp@...el.com>
To:     Moritz Fischer <moritz.fischer@...us.com>
Cc:     kbuild-all@...org, linux-kernel@...r.kernel.org,
        bleung@...omium.org, enric.balletbo@...labora.com,
        groeck@...omium.org, lee.jones@...aro.org, moritz@...us.com,
        Moritz Fischer <mdf@...nel.org>
Subject: Re: [PATCH v2] platform/chrome: Add cros_ec_readmem() helpers for
 I2C/SPI based ECs

Hi Moritz,

I love your patch! Perhaps something to improve:

[auto build test WARNING on linus/master]
[also build test WARNING on v5.0-rc1 next-20190108]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]

url:    https://github.com/0day-ci/linux/commits/Moritz-Fischer/platform-chrome-Add-cros_ec_readmem-helpers-for-I2C-SPI-based-ECs/20190108-184758
config: x86_64-randconfig-x005-201901 (attached as .config)
compiler: gcc-7 (Debian 7.3.0-1) 7.3.0
reproduce:
        # save the attached .config to linux build tree
        make ARCH=x86_64 

All warnings (new ones prefixed by >>):

   In file included from include/linux/list.h:9:0,
                    from include/linux/kobject.h:19,
                    from include/linux/cdev.h:5,
                    from include/linux/mfd/cros_ec.h:19,
                    from drivers/platform/chrome/cros_ec_proto.c:17:
   drivers/platform/chrome/cros_ec_proto.c: In function 'cros_ec_readmem':
   include/linux/kernel.h:846:29: warning: comparison of distinct pointer types lacks a cast
      (!!(sizeof((typeof(x) *)1 == (typeof(y) *)1)))
                                ^
   include/linux/kernel.h:860:4: note: in expansion of macro '__typecheck'
      (__typecheck(x, y) && __no_side_effects(x, y))
       ^~~~~~~~~~~
   include/linux/kernel.h:870:24: note: in expansion of macro '__safe_cmp'
     __builtin_choose_expr(__safe_cmp(x, y), \
                           ^~~~~~~~~~
   include/linux/kernel.h:886:19: note: in expansion of macro '__careful_cmp'
    #define max(x, y) __careful_cmp(x, y, >)
                      ^~~~~~~~~~~~~
>> drivers/platform/chrome/cros_ec_proto.c:650:31: note: in expansion of macro 'max'
     msg = kzalloc(sizeof(*msg) + max(sizeof(*params), bytes), GFP_KERNEL);
                                  ^~~

vim +/max +650 drivers/platform/chrome/cros_ec_proto.c

   639	
   640	int cros_ec_readmem(struct cros_ec_device *ec, unsigned int offset,
   641			    unsigned int bytes, void *dest)
   642	{
   643		int ret;
   644		struct ec_params_read_memmap *params;
   645		struct cros_ec_command *msg;
   646	
   647		if (offset >= EC_MEMMAP_SIZE - bytes)
   648			return -EINVAL;
   649	
 > 650		msg = kzalloc(sizeof(*msg) + max(sizeof(*params), bytes), GFP_KERNEL);

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation

Download attachment ".config.gz" of type "application/gzip" (28176 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ