* [linux-next:master 6157/11436] drivers/gpu/drm/i915/soc/intel_gmch.c:41:13: warning: variable 'mchbar_addr' set but not used
@ 2023-06-21 13:41 kernel test robot
0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2023-06-21 13:41 UTC (permalink / raw)
To: Jani Nikula
Cc: oe-kbuild-all, Linux Memory Management List, Jouni Högander
tree: https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
head: 15e71592dbae49a674429c618a10401d7f992ac3
commit: 3fecd469da9aa0b24bd965f05a8bf44f9d8e2a2e [6157/11436] drm/i915: re-enable -Wunused-but-set-variable
config: x86_64-buildonly-randconfig-r003-20230621 (https://download.01.org/0day-ci/archive/20230621/202306212119.fBNByIyn-lkp@intel.com/config)
compiler: gcc-12 (Debian 12.2.0-14) 12.2.0
reproduce: (https://download.01.org/0day-ci/archive/20230621/202306212119.fBNByIyn-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/202306212119.fBNByIyn-lkp@intel.com/
All warnings (new ones prefixed by >>):
drivers/gpu/drm/i915/soc/intel_gmch.c: In function 'intel_alloc_mchbar_resource':
>> drivers/gpu/drm/i915/soc/intel_gmch.c:41:13: warning: variable 'mchbar_addr' set but not used [-Wunused-but-set-variable]
41 | u64 mchbar_addr;
| ^~~~~~~~~~~
vim +/mchbar_addr +41 drivers/gpu/drm/i915/soc/intel_gmch.c
a13144e2286b0f Jani Nikula 2023-01-17 34
a13144e2286b0f Jani Nikula 2023-01-17 35 /* Allocate space for the MCH regs if needed, return nonzero on error */
a13144e2286b0f Jani Nikula 2023-01-17 36 static int
b1e7d8b0084396 Jani Nikula 2023-01-17 37 intel_alloc_mchbar_resource(struct drm_i915_private *i915)
a13144e2286b0f Jani Nikula 2023-01-17 38 {
b1e7d8b0084396 Jani Nikula 2023-01-17 39 int reg = GRAPHICS_VER(i915) >= 4 ? MCHBAR_I965 : MCHBAR_I915;
a13144e2286b0f Jani Nikula 2023-01-17 40 u32 temp_lo, temp_hi = 0;
a13144e2286b0f Jani Nikula 2023-01-17 @41 u64 mchbar_addr;
a13144e2286b0f Jani Nikula 2023-01-17 42 int ret;
a13144e2286b0f Jani Nikula 2023-01-17 43
b1e7d8b0084396 Jani Nikula 2023-01-17 44 if (GRAPHICS_VER(i915) >= 4)
b1e7d8b0084396 Jani Nikula 2023-01-17 45 pci_read_config_dword(i915->gmch.pdev, reg + 4, &temp_hi);
b1e7d8b0084396 Jani Nikula 2023-01-17 46 pci_read_config_dword(i915->gmch.pdev, reg, &temp_lo);
a13144e2286b0f Jani Nikula 2023-01-17 47 mchbar_addr = ((u64)temp_hi << 32) | temp_lo;
a13144e2286b0f Jani Nikula 2023-01-17 48
a13144e2286b0f Jani Nikula 2023-01-17 49 /* If ACPI doesn't have it, assume we need to allocate it ourselves */
a13144e2286b0f Jani Nikula 2023-01-17 50 #ifdef CONFIG_PNP
a13144e2286b0f Jani Nikula 2023-01-17 51 if (mchbar_addr &&
a13144e2286b0f Jani Nikula 2023-01-17 52 pnp_range_reserved(mchbar_addr, mchbar_addr + MCHBAR_SIZE))
a13144e2286b0f Jani Nikula 2023-01-17 53 return 0;
a13144e2286b0f Jani Nikula 2023-01-17 54 #endif
a13144e2286b0f Jani Nikula 2023-01-17 55
a13144e2286b0f Jani Nikula 2023-01-17 56 /* Get some space for it */
b1e7d8b0084396 Jani Nikula 2023-01-17 57 i915->gmch.mch_res.name = "i915 MCHBAR";
b1e7d8b0084396 Jani Nikula 2023-01-17 58 i915->gmch.mch_res.flags = IORESOURCE_MEM;
b1e7d8b0084396 Jani Nikula 2023-01-17 59 ret = pci_bus_alloc_resource(i915->gmch.pdev->bus,
b1e7d8b0084396 Jani Nikula 2023-01-17 60 &i915->gmch.mch_res,
a13144e2286b0f Jani Nikula 2023-01-17 61 MCHBAR_SIZE, MCHBAR_SIZE,
a13144e2286b0f Jani Nikula 2023-01-17 62 PCIBIOS_MIN_MEM,
a13144e2286b0f Jani Nikula 2023-01-17 63 0, pcibios_align_resource,
b1e7d8b0084396 Jani Nikula 2023-01-17 64 i915->gmch.pdev);
a13144e2286b0f Jani Nikula 2023-01-17 65 if (ret) {
b1e7d8b0084396 Jani Nikula 2023-01-17 66 drm_dbg(&i915->drm, "failed bus alloc: %d\n", ret);
b1e7d8b0084396 Jani Nikula 2023-01-17 67 i915->gmch.mch_res.start = 0;
a13144e2286b0f Jani Nikula 2023-01-17 68 return ret;
a13144e2286b0f Jani Nikula 2023-01-17 69 }
a13144e2286b0f Jani Nikula 2023-01-17 70
b1e7d8b0084396 Jani Nikula 2023-01-17 71 if (GRAPHICS_VER(i915) >= 4)
b1e7d8b0084396 Jani Nikula 2023-01-17 72 pci_write_config_dword(i915->gmch.pdev, reg + 4,
b1e7d8b0084396 Jani Nikula 2023-01-17 73 upper_32_bits(i915->gmch.mch_res.start));
a13144e2286b0f Jani Nikula 2023-01-17 74
b1e7d8b0084396 Jani Nikula 2023-01-17 75 pci_write_config_dword(i915->gmch.pdev, reg,
b1e7d8b0084396 Jani Nikula 2023-01-17 76 lower_32_bits(i915->gmch.mch_res.start));
a13144e2286b0f Jani Nikula 2023-01-17 77 return 0;
a13144e2286b0f Jani Nikula 2023-01-17 78 }
a13144e2286b0f Jani Nikula 2023-01-17 79
:::::: The code at line 41 was first introduced by commit
:::::: a13144e2286b0fbabd0794218ee699e37a8d4210 drm/i915/gmch: split out soc/intel_gmch
:::::: TO: Jani Nikula <jani.nikula@intel.com>
:::::: CC: Jani Nikula <jani.nikula@intel.com>
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2023-06-21 13:42 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-06-21 13:41 [linux-next:master 6157/11436] drivers/gpu/drm/i915/soc/intel_gmch.c:41:13: warning: variable 'mchbar_addr' set but not used kernel test robot
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox