All of lore.kernel.org
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: "Ville Syrjälä " <ville.syrjala@linux.intel.com>
Cc: oe-kbuild-all@lists.linux.dev
Subject: [vsyrjala:bclm_bcm_backlight_remap_2 5/5] drivers/gpu/drm/i915/display/intel_opregion.c:956:63: sparse: sparse: incorrect type in initializer (different address spaces)
Date: Sat, 28 Nov 2026 04:38:48 +0100	[thread overview]
Message-ID: <20261128042930.hZvsBgnT-lkp@intel.com> (raw)

tree:   https://github.com/vsyrjala/linux.git bclm_bcm_backlight_remap_2
head:   7794d41e18611b7a934d3ac2677c47432bf18ef9
commit: 7794d41e18611b7a934d3ac2677c47432bf18ef9 [5/5] drm/i915: Use OpRegion BCLM/BCM to remap the backlight levels
config: x86_64-randconfig-r2304-20261127 (https://download.01.org/0day-ci/archive/20261128/20261128042930.hZvsBgnT-lkp@intel.com/config)
compiler: clang version 22.1.8 (https://github.com/llvm/llvm-project ca7933e47d3a3451d81e72ac174dcb5aa28b59d1)
sparse: v0.6.5-rc1-21-g84ec0658
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20261128/20261128042930.hZvsBgnT-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/20261128042930.hZvsBgnT-lkp@intel.com/

sparse warnings: (new ones prefixed by >>)
>> drivers/gpu/drm/i915/display/intel_opregion.c:956:63: sparse: sparse: incorrect type in initializer (different address spaces) @@     expected struct opregion_asle [noderef] __iomem *asle @@     got struct opregion_asle *asle @@
   drivers/gpu/drm/i915/display/intel_opregion.c:956:63: sparse:     expected struct opregion_asle [noderef] __iomem *asle
   drivers/gpu/drm/i915/display/intel_opregion.c:956:63: sparse:     got struct opregion_asle *asle
>> drivers/gpu/drm/i915/display/intel_opregion.c:992:73: sparse: sparse: incorrect type in initializer (different address spaces) @@     expected struct opregion_backlight [noderef] __iomem *backlight @@     got struct opregion_backlight *backlight @@
   drivers/gpu/drm/i915/display/intel_opregion.c:992:73: sparse:     expected struct opregion_backlight [noderef] __iomem *backlight
   drivers/gpu/drm/i915/display/intel_opregion.c:992:73: sparse:     got struct opregion_backlight *backlight

vim +956 drivers/gpu/drm/i915/display/intel_opregion.c

   953	
   954	static struct intel_backlight_map *build_backlight_map_bclm(struct intel_display *display)
   955	{
 > 956		struct opregion_asle __iomem *asle = display->opregion->asle;
   957		struct intel_backlight_map *map;
   958	
   959		/* BCLM may or may not not include min/max entries */
   960		map = kzalloc_flex(*map, entries, ARRAY_SIZE(asle->bclm) + 2);
   961		if (!map)
   962			return NULL;
   963	
   964		for (int i = 0; i < ARRAY_SIZE(asle->bclm); i++) {
   965			uint16_t bclm = ioread16(&asle->bclm[i]);
   966			int percent, duty_cycle;
   967	
   968			if ((bclm & BCLM_VALID) == 0)
   969				continue;
   970	
   971			percent = FIELD_GET(BCLM_PERCENTAGE_MASK, bclm);
   972			duty_cycle = FIELD_GET(BCLM_DUTY_CYCLE_MASK, bclm);
   973	
   974			if (drm_WARN_ON(display->drm, percent > 100))
   975				continue;
   976	
   977			backlight_map_add(map, percent, duty_cycle);
   978		}
   979	
   980		fixup_backlight_map(map, 0xff);
   981	
   982		return map;
   983	}
   984	
   985	#define BCM_VALID		BIT(31)
   986	#define BCM_PERCENTAGE_MASK	GENMASK(22, 16)
   987	#define BCM_DUTY_CYCLE_MASK	GENMASK(15, 0)
   988	
   989	static struct intel_backlight_map *build_backlight_map_bcm(struct intel_display *display,
   990								   int lfp_index)
   991	{
 > 992		struct opregion_backlight __iomem *backlight = display->opregion->backlight;
   993		struct intel_backlight_map *map;
   994	
   995		/* BCM may or may not not include min/max entries */
   996		map = kzalloc_flex(*map, entries, ARRAY_SIZE(backlight->bcm1) + 2);
   997		if (!map)
   998			return NULL;
   999	
  1000		for (int i = 0; i < ARRAY_SIZE(backlight->bcm1); i++) {
  1001			uint32_t bcm = ioread32(lfp_index ?
  1002						&backlight->bcm2[i] :
  1003						&backlight->bcm1[i]);
  1004			int percent, duty_cycle;
  1005	
  1006			if ((bcm & BCM_VALID) == 0)
  1007				continue;
  1008	
  1009			percent = FIELD_GET(BCM_PERCENTAGE_MASK, bcm);
  1010			duty_cycle = FIELD_GET(BCM_DUTY_CYCLE_MASK, bcm);
  1011	
  1012			if (drm_WARN_ON(display->drm, percent > 100))
  1013				continue;
  1014	
  1015			backlight_map_add(map, percent, duty_cycle);
  1016		}
  1017	
  1018		fixup_backlight_map(map, 0xffff);
  1019	
  1020		return map;
  1021	}
  1022	

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

                 reply	other threads:[~2026-11-28  3:39 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=20261128042930.hZvsBgnT-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=oe-kbuild-all@lists.linux.dev \
    --cc=ville.syrjala@linux.intel.com \
    /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 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.