All of lore.kernel.org
 help / color / mirror / Atom feed
* [pci:pci/error 2/8] drivers/pci/hotplug/../pci.h:348 pci_dev_set_io_state() warn: statement has no effect 22
@ 2021-02-10 14:49 kernel test robot
  0 siblings, 0 replies; 2+ messages in thread
From: kernel test robot @ 2021-02-10 14:49 UTC (permalink / raw)
  To: kbuild

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

CC: kbuild-all(a)lists.01.org
CC: linux-pci(a)vger.kernel.org
TO: Bjorn Helgaas <helgaas@kernel.org>

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci.git pci/error
head:   5692817fc88f347328e35cd7b19bd04f4400652e
commit: 8fae7d8809b8151488969d6cfad2f6dd2c69d311 [2/8] PCI/ERR: Simplify pci_dev_set_io_state()
:::::: branch date: 16 hours ago
:::::: commit date: 2 weeks ago
config: i386-randconfig-m021-20210209 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-15) 9.3.0

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

New smatch warnings:
drivers/pci/hotplug/../pci.h:348 pci_dev_set_io_state() warn: statement has no effect 22

Old smatch warnings:
drivers/pci/hotplug/acpiphp_glue.c:141 acpiphp_grab_context() warn: returning freed memory 'context'

vim +348 drivers/pci/hotplug/../pci.h

d1b054da8f59990 Yu Zhao       2009-03-20  330  
a6bd101b8f84f9b Keith Busch   2018-09-20  331  /**
a6bd101b8f84f9b Keith Busch   2018-09-20  332   * pci_dev_set_io_state - Set the new error state if possible.
a6bd101b8f84f9b Keith Busch   2018-09-20  333   *
a6bd101b8f84f9b Keith Busch   2018-09-20  334   * @dev - pci device to set new error_state
a6bd101b8f84f9b Keith Busch   2018-09-20  335   * @new - the state we want dev to be in
a6bd101b8f84f9b Keith Busch   2018-09-20  336   *
a6bd101b8f84f9b Keith Busch   2018-09-20  337   * Must be called with device_lock held.
a6bd101b8f84f9b Keith Busch   2018-09-20  338   *
a6bd101b8f84f9b Keith Busch   2018-09-20  339   * Returns true if state has been changed to the requested state.
a6bd101b8f84f9b Keith Busch   2018-09-20  340   */
a6bd101b8f84f9b Keith Busch   2018-09-20  341  static inline bool pci_dev_set_io_state(struct pci_dev *dev,
a6bd101b8f84f9b Keith Busch   2018-09-20  342  					pci_channel_state_t new)
a6bd101b8f84f9b Keith Busch   2018-09-20  343  {
a6bd101b8f84f9b Keith Busch   2018-09-20  344  	device_lock_assert(&dev->dev);
8fae7d8809b8151 Bjorn Helgaas 2020-05-19  345  
8fae7d8809b8151 Bjorn Helgaas 2020-05-19  346  	/* Can always put a device in perm_failure state */
8fae7d8809b8151 Bjorn Helgaas 2020-05-19  347  	if (new == pci_channel_io_perm_failure) {
8fae7d8809b8151 Bjorn Helgaas 2020-05-19 @348  		dev->error_state == pci_channel_io_perm_failure;
8fae7d8809b8151 Bjorn Helgaas 2020-05-19  349  		return true;
a6bd101b8f84f9b Keith Busch   2018-09-20  350  	}
8fae7d8809b8151 Bjorn Helgaas 2020-05-19  351  
8fae7d8809b8151 Bjorn Helgaas 2020-05-19  352  	/* If already in perm_failure, can't set to normal or frozen */
8fae7d8809b8151 Bjorn Helgaas 2020-05-19  353  	if (dev->error_state == pci_channel_io_perm_failure)
8fae7d8809b8151 Bjorn Helgaas 2020-05-19  354  		return false;
8fae7d8809b8151 Bjorn Helgaas 2020-05-19  355  
8fae7d8809b8151 Bjorn Helgaas 2020-05-19  356  	/* Can always change normal to frozen or vice versa */
a6bd101b8f84f9b Keith Busch   2018-09-20  357  	dev->error_state = new;
8fae7d8809b8151 Bjorn Helgaas 2020-05-19  358  	return true;
a6bd101b8f84f9b Keith Busch   2018-09-20  359  }
89ee9f7680031d7 Keith Busch   2017-03-29  360  

---
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: 37152 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

* [pci:pci/error 2/8] drivers/pci/hotplug/../pci.h:348 pci_dev_set_io_state() warn: statement has no effect 22
@ 2021-02-10 15:24 Dan Carpenter
  0 siblings, 0 replies; 2+ messages in thread
From: Dan Carpenter @ 2021-02-10 15:24 UTC (permalink / raw)
  To: kbuild

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

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci.git  pci/error
head:   5692817fc88f347328e35cd7b19bd04f4400652e
commit: 8fae7d8809b8151488969d6cfad2f6dd2c69d311 [2/8] PCI/ERR: Simplify pci_dev_set_io_state()
config: i386-randconfig-m021-20210209 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-15) 9.3.0

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

New smatch warnings:
drivers/pci/hotplug/../pci.h:348 pci_dev_set_io_state() warn: statement has no effect 22

vim +348 drivers/pci/hotplug/../pci.h

a6bd101b8f84f9b Keith Busch   2018-09-20  341  static inline bool pci_dev_set_io_state(struct pci_dev *dev,
a6bd101b8f84f9b Keith Busch   2018-09-20  342  					pci_channel_state_t new)
a6bd101b8f84f9b Keith Busch   2018-09-20  343  {
a6bd101b8f84f9b Keith Busch   2018-09-20  344  	device_lock_assert(&dev->dev);
8fae7d8809b8151 Bjorn Helgaas 2020-05-19  345  
8fae7d8809b8151 Bjorn Helgaas 2020-05-19  346  	/* Can always put a device in perm_failure state */
8fae7d8809b8151 Bjorn Helgaas 2020-05-19  347  	if (new == pci_channel_io_perm_failure) {
8fae7d8809b8151 Bjorn Helgaas 2020-05-19 @348  		dev->error_state == pci_channel_io_perm_failure;

This should be = instead of ==.

8fae7d8809b8151 Bjorn Helgaas 2020-05-19  349  		return true;
a6bd101b8f84f9b Keith Busch   2018-09-20  350  	}
8fae7d8809b8151 Bjorn Helgaas 2020-05-19  351  
8fae7d8809b8151 Bjorn Helgaas 2020-05-19  352  	/* If already in perm_failure, can't set to normal or frozen */
8fae7d8809b8151 Bjorn Helgaas 2020-05-19  353  	if (dev->error_state == pci_channel_io_perm_failure)
8fae7d8809b8151 Bjorn Helgaas 2020-05-19  354  		return false;
8fae7d8809b8151 Bjorn Helgaas 2020-05-19  355  
8fae7d8809b8151 Bjorn Helgaas 2020-05-19  356  	/* Can always change normal to frozen or vice versa */
a6bd101b8f84f9b Keith Busch   2018-09-20  357  	dev->error_state = new;
8fae7d8809b8151 Bjorn Helgaas 2020-05-19  358  	return true;
a6bd101b8f84f9b Keith Busch   2018-09-20  359  }

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

_______________________________________________
kbuild mailing list -- kbuild(a)lists.01.org
To unsubscribe send an email to kbuild-leave(a)lists.01.org

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-02-10 15:24 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-02-10 14:49 [pci:pci/error 2/8] drivers/pci/hotplug/../pci.h:348 pci_dev_set_io_state() warn: statement has no effect 22 kernel test robot
  -- strict thread matches above, loose matches on Subject: below --
2021-02-10 15:24 Dan Carpenter

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.