Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id A7647C64EC7 for ; Tue, 28 Feb 2023 20:40:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229866AbjB1UkI (ORCPT ); Tue, 28 Feb 2023 15:40:08 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58614 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229652AbjB1UkF (ORCPT ); Tue, 28 Feb 2023 15:40:05 -0500 Received: from mga06.intel.com (mga06b.intel.com [134.134.136.31]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 82CA513523 for ; Tue, 28 Feb 2023 12:39:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1677616798; x=1709152798; h=date:from:to:cc:subject:message-id:mime-version; bh=/6ZAfLTx1tPZhDVDXGq8De+9d0VpF/AMNil0X8i8ADA=; b=hYcDyrVro6IIgpR3Z1wM13JBSA65HZeLFRf8y/xpfiyIhx1py0272hmj Oo8DJw76+UI2rJWKLPeqE7FWue4miuDLGjvDPp/kdE+PuW4QAtSeX1jYs hrjCIdcK9chiKbIap53K8W/ZUJ23jpoe3FFEijtTzqcW54PbIacABHecn g/sQDMN7CSIqJ/743brnANhFhgGzGkLVjZ3qCLBKRUpKieREOgpgeh+zU H6OJjzeIz7BNY+vfGNg3zZE193EPyiVboh8tOYMc9W5Ll+kdo0l3YdzeS vndOPrx2TPersW81zOHV+tacdC4sm9OpBuoewaO0O5JKNwdz8xCll6GTE w==; X-IronPort-AV: E=McAfee;i="6500,9779,10635"; a="396811520" X-IronPort-AV: E=Sophos;i="5.98,222,1673942400"; d="scan'208";a="396811520" Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 28 Feb 2023 12:39:58 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10635"; a="743121465" X-IronPort-AV: E=Sophos;i="5.98,222,1673942400"; d="scan'208";a="743121465" Received: from lkp-server01.sh.intel.com (HELO 3895f5c55ead) ([10.239.97.150]) by fmsmga004.fm.intel.com with ESMTP; 28 Feb 2023 12:39:56 -0800 Received: from kbuild by 3895f5c55ead with local (Exim 4.96) (envelope-from ) id 1pX6lL-0005dV-06; Tue, 28 Feb 2023 20:39:51 +0000 Date: Wed, 1 Mar 2023 04:39:24 +0800 From: kernel test robot To: Lukas Wunner Cc: oe-kbuild-all@lists.linux.dev, linux-kernel@vger.kernel.org, Bjorn Helgaas Subject: drivers/pci/pcie/../pci.h:325:17: sparse: sparse: cast from restricted pci_channel_state_t Message-ID: <202303010454.jI5Jg2sT-lkp@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master head: e492250d5252635b6c97d52eddf2792ec26f1ec1 commit: 74ff8864cc842be994853095dba6db48e716400a PCI: hotplug: Allow marking devices as disconnected during bind/unbind date: 13 days ago config: loongarch-randconfig-s042-20230226 (https://download.01.org/0day-ci/archive/20230301/202303010454.jI5Jg2sT-lkp@intel.com/config) compiler: loongarch64-linux-gcc (GCC) 12.1.0 reproduce: wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross chmod +x ~/bin/make.cross # apt-get install sparse # sparse version: v0.6.4-39-gce1a6720-dirty # https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=74ff8864cc842be994853095dba6db48e716400a git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git git fetch --no-tags linus master git checkout 74ff8864cc842be994853095dba6db48e716400a # save the config file mkdir build_dir && cp config build_dir/.config COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-12.1.0 make.cross C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' O=build_dir ARCH=loongarch olddefconfig COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-12.1.0 make.cross C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' O=build_dir ARCH=loongarch SHELL=/bin/bash drivers/ If you fix the issue, kindly add following tag where applicable | Reported-by: kernel test robot | Link: https://lore.kernel.org/oe-kbuild-all/202303010454.jI5Jg2sT-lkp@intel.com/ sparse warnings: (new ones prefixed by >>) drivers/pci/pcie/err.c: note: in included file: >> drivers/pci/pcie/../pci.h:325:17: sparse: sparse: cast from restricted pci_channel_state_t >> drivers/pci/pcie/../pci.h:325:17: sparse: sparse: cast to restricted pci_channel_state_t drivers/pci/pcie/../pci.h:328:23: sparse: sparse: cast from restricted pci_channel_state_t drivers/pci/pcie/../pci.h:328:23: sparse: sparse: cast from restricted pci_channel_state_t drivers/pci/pcie/../pci.h:328:23: sparse: sparse: cast to restricted pci_channel_state_t drivers/pci/pcie/../pci.h:332:23: sparse: sparse: cast from restricted pci_channel_state_t drivers/pci/pcie/../pci.h:332:23: sparse: sparse: cast from restricted pci_channel_state_t drivers/pci/pcie/../pci.h:332:23: sparse: sparse: cast to restricted pci_channel_state_t >> drivers/pci/pcie/../pci.h:325:17: sparse: sparse: cast to restricted pci_channel_state_t drivers/pci/pcie/../pci.h:328:23: sparse: sparse: cast to restricted pci_channel_state_t drivers/pci/pcie/../pci.h:332:23: sparse: sparse: cast to restricted pci_channel_state_t vim +325 drivers/pci/pcie/../pci.h 306 307 /** 308 * pci_dev_set_io_state - Set the new error state if possible. 309 * 310 * @dev: PCI device to set new error_state 311 * @new: the state we want dev to be in 312 * 313 * If the device is experiencing perm_failure, it has to remain in that state. 314 * Any other transition is allowed. 315 * 316 * Returns true if state has been changed to the requested state. 317 */ 318 static inline bool pci_dev_set_io_state(struct pci_dev *dev, 319 pci_channel_state_t new) 320 { 321 pci_channel_state_t old; 322 323 switch (new) { 324 case pci_channel_io_perm_failure: > 325 xchg(&dev->error_state, pci_channel_io_perm_failure); 326 return true; 327 case pci_channel_io_frozen: 328 old = cmpxchg(&dev->error_state, pci_channel_io_normal, 329 pci_channel_io_frozen); 330 return old != pci_channel_io_perm_failure; 331 case pci_channel_io_normal: 332 old = cmpxchg(&dev->error_state, pci_channel_io_frozen, 333 pci_channel_io_normal); 334 return old != pci_channel_io_perm_failure; 335 default: 336 return false; 337 } 338 } 339 -- 0-DAY CI Kernel Test Service https://github.com/intel/lkp-tests