[linux-next:master 9156/15478] drivers/gpu/drm/mediatek/mtk_disp_gamma.c:78:6: warning: variable 'cfg_val' set but not used

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi AngeloGioacchino,

FYI, the error/warning was bisected to this commit, please ignore it if it's irrelevant.

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
head:   66f1e1ea3548378ff6387b1ce0b40955d54e86aa
commit: a6b39cd248f3321dbf066f95f95a9841f891229e [9156/15478] drm/mediatek: De-commonize disp_aal/disp_gamma gamma_set functions
config: arm64-allmodconfig (https://download.01.org/0day-ci/archive/20231030/202310301338.pB7KCZxs-lkp@xxxxxxxxx/config)
compiler: clang version 17.0.0 (https://github.com/llvm/llvm-project.git 4a5ac14ee968ff0ad5d2cc1ffa0299048db4c88a)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20231030/202310301338.pB7KCZxs-lkp@xxxxxxxxx/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@xxxxxxxxx>
| Closes: https://lore.kernel.org/oe-kbuild-all/202310301338.pB7KCZxs-lkp@xxxxxxxxx/

All warnings (new ones prefixed by >>):

>> drivers/gpu/drm/mediatek/mtk_disp_gamma.c:78:6: warning: variable 'cfg_val' set but not used [-Wunused-but-set-variable]
      78 |         u32 cfg_val, word;
         |             ^
   1 warning generated.


vim +/cfg_val +78 drivers/gpu/drm/mediatek/mtk_disp_gamma.c

d243907bb42f66 AngeloGioacchino Del Regno 2023-10-12   71  
a6b39cd248f332 AngeloGioacchino Del Regno 2023-10-12   72  void mtk_gamma_set(struct device *dev, struct drm_crtc_state *state)
69a4237ab1d13a Yongqiang Niu              2021-01-29   73  {
a6b39cd248f332 AngeloGioacchino Del Regno 2023-10-12   74  	struct mtk_disp_gamma *gamma = dev_get_drvdata(dev);
0d4caaaf61ce05 AngeloGioacchino Del Regno 2023-10-12   75  	unsigned int i;
69a4237ab1d13a Yongqiang Niu              2021-01-29   76  	struct drm_color_lut *lut;
69a4237ab1d13a Yongqiang Niu              2021-01-29   77  	void __iomem *lut_base;
0d4caaaf61ce05 AngeloGioacchino Del Regno 2023-10-12  @78  	u32 cfg_val, word;
69a4237ab1d13a Yongqiang Niu              2021-01-29   79  
aa5fb24f971dd4 AngeloGioacchino Del Regno 2023-10-12   80  	/* If there's no gamma lut there's nothing to do here. */
aa5fb24f971dd4 AngeloGioacchino Del Regno 2023-10-12   81  	if (!state->gamma_lut)
aa5fb24f971dd4 AngeloGioacchino Del Regno 2023-10-12   82  		return;
aa5fb24f971dd4 AngeloGioacchino Del Regno 2023-10-12   83  
a6b39cd248f332 AngeloGioacchino Del Regno 2023-10-12   84  	lut_base = gamma->regs + DISP_GAMMA_LUT;
69a4237ab1d13a Yongqiang Niu              2021-01-29   85  	lut = (struct drm_color_lut *)state->gamma_lut->data;
a6b39cd248f332 AngeloGioacchino Del Regno 2023-10-12   86  	for (i = 0; i < gamma->data->lut_size; i++) {
c18119dee1919c AngeloGioacchino Del Regno 2023-10-12   87  		struct drm_color_lut diff, hwlut;
c18119dee1919c AngeloGioacchino Del Regno 2023-10-12   88  
c18119dee1919c AngeloGioacchino Del Regno 2023-10-12   89  		hwlut.red = drm_color_lut_extract(lut[i].red, 10);
c18119dee1919c AngeloGioacchino Del Regno 2023-10-12   90  		hwlut.green = drm_color_lut_extract(lut[i].green, 10);
c18119dee1919c AngeloGioacchino Del Regno 2023-10-12   91  		hwlut.blue = drm_color_lut_extract(lut[i].blue, 10);
c18119dee1919c AngeloGioacchino Del Regno 2023-10-12   92  
a6b39cd248f332 AngeloGioacchino Del Regno 2023-10-12   93  		if (!gamma->data->lut_diff || (i % 2 == 0)) {
6e46998c13f123 AngeloGioacchino Del Regno 2023-10-12   94  			word = FIELD_PREP(DISP_GAMMA_LUT_10BIT_R, hwlut.red);
6e46998c13f123 AngeloGioacchino Del Regno 2023-10-12   95  			word |= FIELD_PREP(DISP_GAMMA_LUT_10BIT_G, hwlut.green);
6e46998c13f123 AngeloGioacchino Del Regno 2023-10-12   96  			word |= FIELD_PREP(DISP_GAMMA_LUT_10BIT_B, hwlut.blue);
ba99d08da6adec Yongqiang Niu              2022-04-28   97  		} else {
c18119dee1919c AngeloGioacchino Del Regno 2023-10-12   98  			diff.red = lut[i].red - lut[i - 1].red;
c18119dee1919c AngeloGioacchino Del Regno 2023-10-12   99  			diff.red = drm_color_lut_extract(diff.red, 10);
c18119dee1919c AngeloGioacchino Del Regno 2023-10-12  100  
c18119dee1919c AngeloGioacchino Del Regno 2023-10-12  101  			diff.green = lut[i].green - lut[i - 1].green;
c18119dee1919c AngeloGioacchino Del Regno 2023-10-12  102  			diff.green = drm_color_lut_extract(diff.green, 10);
c18119dee1919c AngeloGioacchino Del Regno 2023-10-12  103  
c18119dee1919c AngeloGioacchino Del Regno 2023-10-12  104  			diff.blue = lut[i].blue - lut[i - 1].blue;
c18119dee1919c AngeloGioacchino Del Regno 2023-10-12  105  			diff.blue = drm_color_lut_extract(diff.blue, 10);
ba99d08da6adec Yongqiang Niu              2022-04-28  106  
6e46998c13f123 AngeloGioacchino Del Regno 2023-10-12  107  			word = FIELD_PREP(DISP_GAMMA_LUT_10BIT_R, diff.red);
6e46998c13f123 AngeloGioacchino Del Regno 2023-10-12  108  			word |= FIELD_PREP(DISP_GAMMA_LUT_10BIT_G, diff.green);
6e46998c13f123 AngeloGioacchino Del Regno 2023-10-12  109  			word |= FIELD_PREP(DISP_GAMMA_LUT_10BIT_B, diff.blue);
ba99d08da6adec Yongqiang Niu              2022-04-28  110  		}
c18119dee1919c AngeloGioacchino Del Regno 2023-10-12  111  		writel(word, lut_base + i * 4);
69a4237ab1d13a Yongqiang Niu              2021-01-29  112  	}
0d4caaaf61ce05 AngeloGioacchino Del Regno 2023-10-12  113  
a6b39cd248f332 AngeloGioacchino Del Regno 2023-10-12  114  	cfg_val = readl(gamma->regs + DISP_GAMMA_CFG);
0d4caaaf61ce05 AngeloGioacchino Del Regno 2023-10-12  115  
0d4caaaf61ce05 AngeloGioacchino Del Regno 2023-10-12  116  	/* Enable the gamma table */
6e46998c13f123 AngeloGioacchino Del Regno 2023-10-12  117  	cfg_val |= FIELD_PREP(GAMMA_LUT_EN, 1);
0d4caaaf61ce05 AngeloGioacchino Del Regno 2023-10-12  118  
a6b39cd248f332 AngeloGioacchino Del Regno 2023-10-12  119  	cfg_val = readl(gamma->regs + DISP_GAMMA_CFG);
69a4237ab1d13a Yongqiang Niu              2021-01-29  120  }
69a4237ab1d13a Yongqiang Niu              2021-01-29  121  

:::::: The code at line 78 was first introduced by commit
:::::: 0d4caaaf61ce0556843e2fa9d41ec65962b51c14 drm/mediatek: gamma: Enable the Gamma LUT table only after programming

:::::: TO: AngeloGioacchino Del Regno <angelogioacchino.delregno@xxxxxxxxxxxxx>
:::::: CC: Chun-Kuang Hu <chunkuang.hu@xxxxxxxxxx>

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




[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux