All of lore.kernel.org
 help / color / mirror / Atom feed
* [linux-review:UPDATE-20191027-161609/Michal-Suchanek/Fix-cdrom-autoclose/20191025-101637 7/8] drivers//scsi/scsi_devinfo.c:458:4: note: in expansion of macro 'if'
@ 2019-10-27 11:40 kbuild test robot
  0 siblings, 0 replies; only message in thread
From: kbuild test robot @ 2019-10-27 11:40 UTC (permalink / raw)
  To: kbuild-all

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

tree:   https://github.com/0day-ci/linux/commits/UPDATE-20191027-161609/Michal-Suchanek/Fix-cdrom-autoclose/20191025-101637
head:   8ebc37a465cccfa1f297f976e1bd8b36ede36db3
commit: 6bb0f3478cfa38409ec750b5c99dda95acf6fdc8 [7/8] scsi: blacklist: add VMware ESXi cdrom - broken tray emulation.
config: x86_64-randconfig-f002-201943 (attached as .config)
compiler: gcc-7 (Debian 7.4.0-14) 7.4.0
reproduce:
        git checkout 6bb0f3478cfa38409ec750b5c99dda95acf6fdc8
        # save the attached .config to linux build tree
        make ARCH=x86_64 

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

All warnings (new ones prefixed by >>):

   In file included from arch/x86/include/asm/current.h:5:0,
                    from include/linux/sched.h:12,
                    from include/linux/blkdev.h:5,
                    from drivers//scsi/scsi_devinfo.c:3:
   drivers//scsi/scsi_devinfo.c: In function 'scsi_dev_info_list_find':
   drivers//scsi/scsi_devinfo.c:458:8: warning: suggest parentheses around operand of '!' or change '&' to '&&' or '!' to '~' [-Wparentheses]
       if (!devinfo->flags & BLIST_MATCH_VENDOR)
           ^~~~~~~~~~~
   include/linux/compiler.h:58:52: note: in definition of macro '__trace_if_var'
    #define __trace_if_var(cond) (__builtin_constant_p(cond) ? (cond) : __trace_if_value(cond))
                                                       ^~~~
>> drivers//scsi/scsi_devinfo.c:458:4: note: in expansion of macro 'if'
       if (!devinfo->flags & BLIST_MATCH_VENDOR)
       ^~
   drivers//scsi/scsi_devinfo.c:458:8: warning: suggest parentheses around operand of '!' or change '&' to '&&' or '!' to '~' [-Wparentheses]
       if (!devinfo->flags & BLIST_MATCH_VENDOR)
           ^~~~~~~~~~~
   include/linux/compiler.h:58:61: note: in definition of macro '__trace_if_var'
    #define __trace_if_var(cond) (__builtin_constant_p(cond) ? (cond) : __trace_if_value(cond))
                                                                ^~~~
>> drivers//scsi/scsi_devinfo.c:458:4: note: in expansion of macro 'if'
       if (!devinfo->flags & BLIST_MATCH_VENDOR)
       ^~
   drivers//scsi/scsi_devinfo.c:458:8: warning: suggest parentheses around operand of '!' or change '&' to '&&' or '!' to '~' [-Wparentheses]
       if (!devinfo->flags & BLIST_MATCH_VENDOR)
           ^~~~~~~~~~~
   include/linux/compiler.h:69:3: note: in definition of macro '__trace_if_value'
     (cond) ?     \
      ^~~~
   include/linux/compiler.h:56:28: note: in expansion of macro '__trace_if_var'
    #define if(cond, ...) if ( __trace_if_var( !!(cond , ## __VA_ARGS__) ) )
                               ^~~~~~~~~~~~~~
>> drivers//scsi/scsi_devinfo.c:458:4: note: in expansion of macro 'if'
       if (!devinfo->flags & BLIST_MATCH_VENDOR)
       ^~

vim +/if +458 drivers//scsi/scsi_devinfo.c

   398	
   399	/**
   400	 * scsi_dev_info_list_find - find a matching dev_info list entry.
   401	 * @vendor:	full vendor string
   402	 * @model:	full model (product) string
   403	 * @key:	specify list to use
   404	 *
   405	 * Description:
   406	 *	Finds the first dev_info entry matching @vendor, @model
   407	 *	in list specified by @key.
   408	 *
   409	 * Returns: pointer to matching entry, or ERR_PTR on failure.
   410	 **/
   411	static struct scsi_dev_info_list *scsi_dev_info_list_find(const char *vendor,
   412			const char *model, enum scsi_devinfo_key key)
   413	{
   414		struct scsi_dev_info_list *devinfo;
   415		struct scsi_dev_info_list_table *devinfo_table =
   416			scsi_devinfo_lookup_by_key(key);
   417		size_t vmax, mmax, mlen;
   418		const char *vskip, *mskip;
   419	
   420		if (IS_ERR(devinfo_table))
   421			return (struct scsi_dev_info_list *) devinfo_table;
   422	
   423		/* Prepare for "compatible" matches */
   424	
   425		/*
   426		 * XXX why skip leading spaces? If an odd INQUIRY
   427		 * value, that should have been part of the
   428		 * scsi_static_device_list[] entry, such as "  FOO"
   429		 * rather than "FOO". Since this code is already
   430		 * here, and we don't know what device it is
   431		 * trying to work with, leave it as-is.
   432		 */
   433		vmax = sizeof(devinfo->vendor);
   434		vskip = vendor;
   435		while (vmax > 0 && *vskip == ' ') {
   436			vmax--;
   437			vskip++;
   438		}
   439		/* Also skip trailing spaces */
   440		while (vmax > 0 && vskip[vmax - 1] == ' ')
   441			--vmax;
   442	
   443		mmax = sizeof(devinfo->model);
   444		mskip = model;
   445		while (mmax > 0 && *mskip == ' ') {
   446			mmax--;
   447			mskip++;
   448		}
   449		while (mmax > 0 && mskip[mmax - 1] == ' ')
   450			--mmax;
   451	
   452		list_for_each_entry(devinfo, &devinfo_table->scsi_dev_info_list,
   453				    dev_info_list) {
   454			if (devinfo->compatible) {
   455				/*
   456				 * vendor strings must be an exact match
   457				 */
 > 458				if (!devinfo->flags & BLIST_MATCH_VENDOR)
   459					if (vmax != strnlen(devinfo->vendor,
   460							    sizeof(devinfo->vendor)) ||
   461					    memcmp(devinfo->vendor, vskip, vmax))
   462						continue;
   463	
   464				/*
   465				 * @model specifies the full string, and
   466				 * must be larger or equal to devinfo->model
   467				 */
   468				mlen = strnlen(devinfo->model, sizeof(devinfo->model));
   469				if (mmax < mlen || memcmp(devinfo->model, mskip, mlen))
   470					continue;
   471				return devinfo;
   472			} else {
   473				if ((!memcmp(devinfo->vendor, vendor,
   474					    sizeof(devinfo->vendor))
   475				       || (devinfo->flags & BLIST_MATCH_VENDOR)) &&
   476				    !memcmp(devinfo->model, model,
   477					    sizeof(devinfo->model)))
   478					return devinfo;
   479			}
   480		}
   481	
   482		return ERR_PTR(-ENOENT);
   483	}
   484	

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

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

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

only message in thread, other threads:[~2019-10-27 11:40 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-10-27 11:40 [linux-review:UPDATE-20191027-161609/Michal-Suchanek/Fix-cdrom-autoclose/20191025-101637 7/8] drivers//scsi/scsi_devinfo.c:458:4: note: in expansion of macro 'if' kbuild test robot

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.