Building the Linux kernel with Clang and LLVM
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: Chengwen Feng <fengchengwen@huawei.com>
Cc: llvm@lists.linux.dev, oe-kbuild-all@lists.linux.dev,
	0day robot <lkp@intel.com>
Subject: drivers/vfio/pci/vfio_pci_config.c:1166:9: error: call to undeclared function 'FIELD_GET'; ISO C99 and later do not support implicit function declarations
Date: Fri, 05 Jun 2026 07:12:09 +0200	[thread overview]
Message-ID: <202606050731.hnLOapOi-lkp@intel.com> (raw)

tree:   https://github.com/intel-lab-lkp/linux/commits/Chengwen-Feng/PCI-TPH-Fix-pcie_tph_get_st_table_loc-field-extraction/20260604-214853
head:   345c2b0902fb86eb32cf8fadfdfb114490531b81
commit: 345c2b0902fb86eb32cf8fadfdfb114490531b81 vfio/pci: Virtualize PCIe TPH capability registers
date:   15 hours ago
config: x86_64-rhel-9.4-rust (https://download.01.org/0day-ci/archive/20260605/202606050731.hnLOapOi-lkp@intel.com/config)
compiler: clang version 22.0.0git (https://github.com/llvm/llvm-project f43d6834093b19baf79beda8c0337ab020ac5f17)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260605/202606050731.hnLOapOi-lkp@intel.com/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202606050731.hnLOapOi-lkp@intel.com/

All errors (new ones prefixed by >>):

>> drivers/vfio/pci/vfio_pci_config.c:1166:9: error: call to undeclared function 'FIELD_GET'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
    1166 |         mode = FIELD_GET(PCI_TPH_CTRL_MODE_SEL_MASK, data);
         |                ^
   1 error generated.


vim +/FIELD_GET +1166 drivers/vfio/pci/vfio_pci_config.c

  1127	
  1128	static int vfio_find_cap_start(struct vfio_pci_core_device *vdev, int pos);
  1129	static int vfio_tph_config_write(struct vfio_pci_core_device *vdev, int pos,
  1130					 int count, struct perm_bits *perm,
  1131					 int offset, __le32 val)
  1132	{
  1133		int req_en_byte = PCI_TPH_CTRL + 1;
  1134		struct pci_dev *pdev = vdev->pdev;
  1135		__le32 org_val = 0;
  1136		bool extended;
  1137		u8 mode, req;
  1138		int i, ret;
  1139		u16 start;
  1140		u32 data;
  1141	
  1142		if (!vdev->tph_permit)
  1143			return count;
  1144	
  1145		/* Back up the original values in order rollback when fail */
  1146		if (offset <= req_en_byte && offset + count > req_en_byte)
  1147			vfio_default_config_read(vdev, pos, count, perm, offset,
  1148						 &org_val);
  1149	
  1150		ret = vfio_default_config_write(vdev, pos, count, perm, offset, val);
  1151		if (ret != count)
  1152			return ret;
  1153	
  1154		/* Skip if write range does not cover Requester Enable byte */
  1155		if (offset > req_en_byte || offset + count <= req_en_byte)
  1156			return count;
  1157	
  1158		ret = vfio_pci_set_power_state(vdev, PCI_D0);
  1159		if (ret)
  1160			return count;
  1161	
  1162		mutex_lock(&vdev->tph_lock);
  1163	
  1164		start = vfio_find_cap_start(vdev, pos);
  1165		data = le32_to_cpu(*(__le32 *)&vdev->vconfig[start + PCI_TPH_CTRL]);
> 1166		mode = FIELD_GET(PCI_TPH_CTRL_MODE_SEL_MASK, data);
  1167		req = FIELD_GET(PCI_TPH_CTRL_REQ_EN_MASK, data);
  1168	
  1169		if (req == PCI_TPH_REQ_TPH_ONLY || req == PCI_TPH_REQ_EXT_TPH) {
  1170			extended = !!(req == PCI_TPH_REQ_EXT_TPH);
  1171			ret = pcie_enable_tph_explicit(pdev, mode, extended);
  1172			if (!ret && vdev->tph_st_shadow) {
  1173				for (i = 0; i < vdev->tph_st_entries; i++)
  1174					pcie_tph_set_st_entry(pdev, i,
  1175							      vdev->tph_st_shadow[i]);
  1176			}
  1177			if (ret)
  1178				vfio_default_config_write(vdev, pos, count, perm,
  1179							  offset, org_val);
  1180		} else if (req == PCI_TPH_REQ_DISABLE) {
  1181			pcie_disable_tph(vdev->pdev);
  1182		} else {
  1183			vfio_default_config_write(vdev, pos, count, perm, offset,
  1184						  org_val);
  1185		}
  1186	
  1187		mutex_unlock(&vdev->tph_lock);
  1188	
  1189		return count;
  1190	}
  1191	

--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

                 reply	other threads:[~2026-06-05  5:13 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=202606050731.hnLOapOi-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=fengchengwen@huawei.com \
    --cc=llvm@lists.linux.dev \
    --cc=oe-kbuild-all@lists.linux.dev \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox