All of lore.kernel.org
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: Arnd Bergmann <arnd@kernel.org>,
	Philipp Zabel <p.zabel@pengutronix.de>,
	David Airlie <airlied@linux.ie>, Daniel Vetter <daniel@ffwll.ch>
Cc: kbuild-all@lists.01.org, Arnd Bergmann <arnd@arndb.de>,
	Liu Ying <victor.liu@nxp.com>,
	Sascha Hauer <s.hauer@pengutronix.de>,
	Marco Felsch <m.felsch@pengutronix.de>,
	dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org,
	Shawn Guo <shawnguo@kernel.org>
Subject: Re: [PATCH] [v2] drm/imx: imx-ldb: fix out of bounds array access warning
Date: Thu, 25 Mar 2021 00:14:56 +0800	[thread overview]
Message-ID: <202103250034.UQ7D4AFT-lkp@intel.com> (raw)
In-Reply-To: <20210324121832.3714570-1-arnd@kernel.org>

[-- Attachment #1: Type: text/plain, Size: 7629 bytes --]

Hi Arnd,

I love your patch! Perhaps something to improve:

[auto build test WARNING on shawnguo/for-next]
[also build test WARNING on pza/reset/next drm-intel/for-linux-next drm-tip/drm-tip v5.12-rc4 next-20210324]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]

url:    https://github.com/0day-ci/linux/commits/Arnd-Bergmann/drm-imx-imx-ldb-fix-out-of-bounds-array-access-warning/20210324-202112
base:   https://git.kernel.org/pub/scm/linux/kernel/git/shawnguo/linux.git for-next
config: ia64-randconfig-r021-20210323 (attached as .config)
compiler: ia64-linux-gcc (GCC) 9.3.0
reproduce (this is a W=1 build):
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # https://github.com/0day-ci/linux/commit/1921451dcfc3ce8072884c286da96759e18ad102
        git remote add linux-review https://github.com/0day-ci/linux
        git fetch --no-tags linux-review Arnd-Bergmann/drm-imx-imx-ldb-fix-out-of-bounds-array-access-warning/20210324-202112
        git checkout 1921451dcfc3ce8072884c286da96759e18ad102
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=ia64 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>

All warnings (new ones prefixed by >>):

   In file included from arch/ia64/include/asm/pgtable.h:154,
                    from include/linux/pgtable.h:6,
                    from arch/ia64/include/asm/uaccess.h:40,
                    from include/linux/uaccess.h:11,
                    from arch/ia64/include/asm/sections.h:11,
                    from include/linux/interrupt.h:20,
                    from include/linux/trace_recursion.h:5,
                    from include/linux/ftrace.h:10,
                    from include/linux/kprobes.h:29,
                    from include/linux/kgdb.h:19,
                    from include/linux/fb.h:5,
                    from include/drm/drm_crtc.h:31,
                    from include/drm/drm_atomic.h:31,
                    from drivers/gpu/drm/imx/imx-ldb.c:21:
   arch/ia64/include/asm/mmu_context.h: In function 'reload_context':
   arch/ia64/include/asm/mmu_context.h:127:41: warning: variable 'old_rr4' set but not used [-Wunused-but-set-variable]
     127 |  unsigned long rr0, rr1, rr2, rr3, rr4, old_rr4;
         |                                         ^~~~~~~
   In file included from include/linux/device.h:15,
                    from include/linux/node.h:18,
                    from include/linux/cpu.h:17,
                    from include/linux/of_device.h:5,
                    from drivers/gpu/drm/imx/imx-ldb.c:13:
   drivers/gpu/drm/imx/imx-ldb.c: In function 'imx_ldb_encoder_enable':
>> drivers/gpu/drm/imx/imx-ldb.c:201:22: warning: format '%d' expects argument of type 'int', but argument 4 has type 'void *' [-Wformat=]
     201 |   dev_warn(ldb->dev, "%s: invalid mux %d\n",
         |                      ^~~~~~~~~~~~~~~~~~~~~~
   include/linux/dev_printk.h:19:22: note: in definition of macro 'dev_fmt'
      19 | #define dev_fmt(fmt) fmt
         |                      ^~~
   drivers/gpu/drm/imx/imx-ldb.c:201:3: note: in expansion of macro 'dev_warn'
     201 |   dev_warn(ldb->dev, "%s: invalid mux %d\n",
         |   ^~~~~~~~
   drivers/gpu/drm/imx/imx-ldb.c:201:40: note: format string is defined here
     201 |   dev_warn(ldb->dev, "%s: invalid mux %d\n",
         |                                       ~^
         |                                        |
         |                                        int
         |                                       %p
   In file included from include/linux/device.h:15,
                    from include/linux/node.h:18,
                    from include/linux/cpu.h:17,
                    from include/linux/of_device.h:5,
                    from drivers/gpu/drm/imx/imx-ldb.c:13:
   drivers/gpu/drm/imx/imx-ldb.c: In function 'imx_ldb_encoder_atomic_mode_set':
   drivers/gpu/drm/imx/imx-ldb.c:265:22: warning: format '%d' expects argument of type 'int', but argument 4 has type 'void *' [-Wformat=]
     265 |   dev_warn(ldb->dev, "%s: invalid mux %d\n",
         |                      ^~~~~~~~~~~~~~~~~~~~~~
   include/linux/dev_printk.h:19:22: note: in definition of macro 'dev_fmt'
      19 | #define dev_fmt(fmt) fmt
         |                      ^~~
   drivers/gpu/drm/imx/imx-ldb.c:265:3: note: in expansion of macro 'dev_warn'
     265 |   dev_warn(ldb->dev, "%s: invalid mux %d\n",
         |   ^~~~~~~~
   drivers/gpu/drm/imx/imx-ldb.c:265:40: note: format string is defined here
     265 |   dev_warn(ldb->dev, "%s: invalid mux %d\n",
         |                                       ~^
         |                                        |
         |                                        int
         |                                       %p

Kconfig warnings: (for reference only)
   WARNING: unmet direct dependencies detected for FRAME_POINTER
   Depends on DEBUG_KERNEL && (M68K || UML || SUPERH) || ARCH_WANT_FRAME_POINTERS
   Selected by
   - FAULT_INJECTION_STACKTRACE_FILTER && FAULT_INJECTION_DEBUG_FS && STACKTRACE_SUPPORT && !X86_64 && !MIPS && !PPC && !S390 && !MICROBLAZE && !ARM && !ARC && !X86


vim +201 drivers/gpu/drm/imx/imx-ldb.c

   192	
   193	static void imx_ldb_encoder_enable(struct drm_encoder *encoder)
   194	{
   195		struct imx_ldb_channel *imx_ldb_ch = enc_to_imx_ldb_ch(encoder);
   196		struct imx_ldb *ldb = imx_ldb_ch->ldb;
   197		int dual = ldb->ldb_ctrl & LDB_SPLIT_MODE_EN;
   198		int mux = drm_of_encoder_active_port_id(imx_ldb_ch->child, encoder);
   199	
   200		if (mux < 0 || mux >= ARRAY_SIZE(ldb->clk_sel)) {
 > 201			dev_warn(ldb->dev, "%s: invalid mux %d\n",
   202				 __func__, ERR_PTR(mux));
   203			return;
   204		}
   205	
   206		drm_panel_prepare(imx_ldb_ch->panel);
   207	
   208		if (dual) {
   209			clk_set_parent(ldb->clk_sel[mux], ldb->clk[0]);
   210			clk_set_parent(ldb->clk_sel[mux], ldb->clk[1]);
   211	
   212			clk_prepare_enable(ldb->clk[0]);
   213			clk_prepare_enable(ldb->clk[1]);
   214		} else {
   215			clk_set_parent(ldb->clk_sel[mux], ldb->clk[imx_ldb_ch->chno]);
   216		}
   217	
   218		if (imx_ldb_ch == &ldb->channel[0] || dual) {
   219			ldb->ldb_ctrl &= ~LDB_CH0_MODE_EN_MASK;
   220			if (mux == 0 || ldb->lvds_mux)
   221				ldb->ldb_ctrl |= LDB_CH0_MODE_EN_TO_DI0;
   222			else if (mux == 1)
   223				ldb->ldb_ctrl |= LDB_CH0_MODE_EN_TO_DI1;
   224		}
   225		if (imx_ldb_ch == &ldb->channel[1] || dual) {
   226			ldb->ldb_ctrl &= ~LDB_CH1_MODE_EN_MASK;
   227			if (mux == 1 || ldb->lvds_mux)
   228				ldb->ldb_ctrl |= LDB_CH1_MODE_EN_TO_DI1;
   229			else if (mux == 0)
   230				ldb->ldb_ctrl |= LDB_CH1_MODE_EN_TO_DI0;
   231		}
   232	
   233		if (ldb->lvds_mux) {
   234			const struct bus_mux *lvds_mux = NULL;
   235	
   236			if (imx_ldb_ch == &ldb->channel[0])
   237				lvds_mux = &ldb->lvds_mux[0];
   238			else if (imx_ldb_ch == &ldb->channel[1])
   239				lvds_mux = &ldb->lvds_mux[1];
   240	
   241			regmap_update_bits(ldb->regmap, lvds_mux->reg, lvds_mux->mask,
   242					   mux << lvds_mux->shift);
   243		}
   244	
   245		regmap_write(ldb->regmap, IOMUXC_GPR2, ldb->ldb_ctrl);
   246	
   247		drm_panel_enable(imx_ldb_ch->panel);
   248	}
   249	

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 36278 bytes --]

[-- Attachment #3: Type: text/plain, Size: 160 bytes --]

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

WARNING: multiple messages have this Message-ID (diff)
From: kernel test robot <lkp@intel.com>
To: kbuild-all@lists.01.org
Subject: Re: [PATCH] [v2] drm/imx: imx-ldb: fix out of bounds array access warning
Date: Thu, 25 Mar 2021 00:14:56 +0800	[thread overview]
Message-ID: <202103250034.UQ7D4AFT-lkp@intel.com> (raw)
In-Reply-To: <20210324121832.3714570-1-arnd@kernel.org>

[-- Attachment #1: Type: text/plain, Size: 7792 bytes --]

Hi Arnd,

I love your patch! Perhaps something to improve:

[auto build test WARNING on shawnguo/for-next]
[also build test WARNING on pza/reset/next drm-intel/for-linux-next drm-tip/drm-tip v5.12-rc4 next-20210324]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]

url:    https://github.com/0day-ci/linux/commits/Arnd-Bergmann/drm-imx-imx-ldb-fix-out-of-bounds-array-access-warning/20210324-202112
base:   https://git.kernel.org/pub/scm/linux/kernel/git/shawnguo/linux.git for-next
config: ia64-randconfig-r021-20210323 (attached as .config)
compiler: ia64-linux-gcc (GCC) 9.3.0
reproduce (this is a W=1 build):
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # https://github.com/0day-ci/linux/commit/1921451dcfc3ce8072884c286da96759e18ad102
        git remote add linux-review https://github.com/0day-ci/linux
        git fetch --no-tags linux-review Arnd-Bergmann/drm-imx-imx-ldb-fix-out-of-bounds-array-access-warning/20210324-202112
        git checkout 1921451dcfc3ce8072884c286da96759e18ad102
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=ia64 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>

All warnings (new ones prefixed by >>):

   In file included from arch/ia64/include/asm/pgtable.h:154,
                    from include/linux/pgtable.h:6,
                    from arch/ia64/include/asm/uaccess.h:40,
                    from include/linux/uaccess.h:11,
                    from arch/ia64/include/asm/sections.h:11,
                    from include/linux/interrupt.h:20,
                    from include/linux/trace_recursion.h:5,
                    from include/linux/ftrace.h:10,
                    from include/linux/kprobes.h:29,
                    from include/linux/kgdb.h:19,
                    from include/linux/fb.h:5,
                    from include/drm/drm_crtc.h:31,
                    from include/drm/drm_atomic.h:31,
                    from drivers/gpu/drm/imx/imx-ldb.c:21:
   arch/ia64/include/asm/mmu_context.h: In function 'reload_context':
   arch/ia64/include/asm/mmu_context.h:127:41: warning: variable 'old_rr4' set but not used [-Wunused-but-set-variable]
     127 |  unsigned long rr0, rr1, rr2, rr3, rr4, old_rr4;
         |                                         ^~~~~~~
   In file included from include/linux/device.h:15,
                    from include/linux/node.h:18,
                    from include/linux/cpu.h:17,
                    from include/linux/of_device.h:5,
                    from drivers/gpu/drm/imx/imx-ldb.c:13:
   drivers/gpu/drm/imx/imx-ldb.c: In function 'imx_ldb_encoder_enable':
>> drivers/gpu/drm/imx/imx-ldb.c:201:22: warning: format '%d' expects argument of type 'int', but argument 4 has type 'void *' [-Wformat=]
     201 |   dev_warn(ldb->dev, "%s: invalid mux %d\n",
         |                      ^~~~~~~~~~~~~~~~~~~~~~
   include/linux/dev_printk.h:19:22: note: in definition of macro 'dev_fmt'
      19 | #define dev_fmt(fmt) fmt
         |                      ^~~
   drivers/gpu/drm/imx/imx-ldb.c:201:3: note: in expansion of macro 'dev_warn'
     201 |   dev_warn(ldb->dev, "%s: invalid mux %d\n",
         |   ^~~~~~~~
   drivers/gpu/drm/imx/imx-ldb.c:201:40: note: format string is defined here
     201 |   dev_warn(ldb->dev, "%s: invalid mux %d\n",
         |                                       ~^
         |                                        |
         |                                        int
         |                                       %p
   In file included from include/linux/device.h:15,
                    from include/linux/node.h:18,
                    from include/linux/cpu.h:17,
                    from include/linux/of_device.h:5,
                    from drivers/gpu/drm/imx/imx-ldb.c:13:
   drivers/gpu/drm/imx/imx-ldb.c: In function 'imx_ldb_encoder_atomic_mode_set':
   drivers/gpu/drm/imx/imx-ldb.c:265:22: warning: format '%d' expects argument of type 'int', but argument 4 has type 'void *' [-Wformat=]
     265 |   dev_warn(ldb->dev, "%s: invalid mux %d\n",
         |                      ^~~~~~~~~~~~~~~~~~~~~~
   include/linux/dev_printk.h:19:22: note: in definition of macro 'dev_fmt'
      19 | #define dev_fmt(fmt) fmt
         |                      ^~~
   drivers/gpu/drm/imx/imx-ldb.c:265:3: note: in expansion of macro 'dev_warn'
     265 |   dev_warn(ldb->dev, "%s: invalid mux %d\n",
         |   ^~~~~~~~
   drivers/gpu/drm/imx/imx-ldb.c:265:40: note: format string is defined here
     265 |   dev_warn(ldb->dev, "%s: invalid mux %d\n",
         |                                       ~^
         |                                        |
         |                                        int
         |                                       %p

Kconfig warnings: (for reference only)
   WARNING: unmet direct dependencies detected for FRAME_POINTER
   Depends on DEBUG_KERNEL && (M68K || UML || SUPERH) || ARCH_WANT_FRAME_POINTERS
   Selected by
   - FAULT_INJECTION_STACKTRACE_FILTER && FAULT_INJECTION_DEBUG_FS && STACKTRACE_SUPPORT && !X86_64 && !MIPS && !PPC && !S390 && !MICROBLAZE && !ARM && !ARC && !X86


vim +201 drivers/gpu/drm/imx/imx-ldb.c

   192	
   193	static void imx_ldb_encoder_enable(struct drm_encoder *encoder)
   194	{
   195		struct imx_ldb_channel *imx_ldb_ch = enc_to_imx_ldb_ch(encoder);
   196		struct imx_ldb *ldb = imx_ldb_ch->ldb;
   197		int dual = ldb->ldb_ctrl & LDB_SPLIT_MODE_EN;
   198		int mux = drm_of_encoder_active_port_id(imx_ldb_ch->child, encoder);
   199	
   200		if (mux < 0 || mux >= ARRAY_SIZE(ldb->clk_sel)) {
 > 201			dev_warn(ldb->dev, "%s: invalid mux %d\n",
   202				 __func__, ERR_PTR(mux));
   203			return;
   204		}
   205	
   206		drm_panel_prepare(imx_ldb_ch->panel);
   207	
   208		if (dual) {
   209			clk_set_parent(ldb->clk_sel[mux], ldb->clk[0]);
   210			clk_set_parent(ldb->clk_sel[mux], ldb->clk[1]);
   211	
   212			clk_prepare_enable(ldb->clk[0]);
   213			clk_prepare_enable(ldb->clk[1]);
   214		} else {
   215			clk_set_parent(ldb->clk_sel[mux], ldb->clk[imx_ldb_ch->chno]);
   216		}
   217	
   218		if (imx_ldb_ch == &ldb->channel[0] || dual) {
   219			ldb->ldb_ctrl &= ~LDB_CH0_MODE_EN_MASK;
   220			if (mux == 0 || ldb->lvds_mux)
   221				ldb->ldb_ctrl |= LDB_CH0_MODE_EN_TO_DI0;
   222			else if (mux == 1)
   223				ldb->ldb_ctrl |= LDB_CH0_MODE_EN_TO_DI1;
   224		}
   225		if (imx_ldb_ch == &ldb->channel[1] || dual) {
   226			ldb->ldb_ctrl &= ~LDB_CH1_MODE_EN_MASK;
   227			if (mux == 1 || ldb->lvds_mux)
   228				ldb->ldb_ctrl |= LDB_CH1_MODE_EN_TO_DI1;
   229			else if (mux == 0)
   230				ldb->ldb_ctrl |= LDB_CH1_MODE_EN_TO_DI0;
   231		}
   232	
   233		if (ldb->lvds_mux) {
   234			const struct bus_mux *lvds_mux = NULL;
   235	
   236			if (imx_ldb_ch == &ldb->channel[0])
   237				lvds_mux = &ldb->lvds_mux[0];
   238			else if (imx_ldb_ch == &ldb->channel[1])
   239				lvds_mux = &ldb->lvds_mux[1];
   240	
   241			regmap_update_bits(ldb->regmap, lvds_mux->reg, lvds_mux->mask,
   242					   mux << lvds_mux->shift);
   243		}
   244	
   245		regmap_write(ldb->regmap, IOMUXC_GPR2, ldb->ldb_ctrl);
   246	
   247		drm_panel_enable(imx_ldb_ch->panel);
   248	}
   249	

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org

[-- Attachment #2: config.gz --]
[-- Type: application/gzip, Size: 36278 bytes --]

WARNING: multiple messages have this Message-ID (diff)
From: kernel test robot <lkp@intel.com>
To: Arnd Bergmann <arnd@kernel.org>,
	Philipp Zabel <p.zabel@pengutronix.de>,
	David Airlie <airlied@linux.ie>, Daniel Vetter <daniel@ffwll.ch>
Cc: kbuild-all@lists.01.org, Arnd Bergmann <arnd@arndb.de>,
	Liu Ying <victor.liu@nxp.com>, Shawn Guo <shawnguo@kernel.org>,
	Sascha Hauer <s.hauer@pengutronix.de>,
	Marco Felsch <m.felsch@pengutronix.de>,
	dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] [v2] drm/imx: imx-ldb: fix out of bounds array access warning
Date: Thu, 25 Mar 2021 00:14:56 +0800	[thread overview]
Message-ID: <202103250034.UQ7D4AFT-lkp@intel.com> (raw)
In-Reply-To: <20210324121832.3714570-1-arnd@kernel.org>

[-- Attachment #1: Type: text/plain, Size: 7629 bytes --]

Hi Arnd,

I love your patch! Perhaps something to improve:

[auto build test WARNING on shawnguo/for-next]
[also build test WARNING on pza/reset/next drm-intel/for-linux-next drm-tip/drm-tip v5.12-rc4 next-20210324]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]

url:    https://github.com/0day-ci/linux/commits/Arnd-Bergmann/drm-imx-imx-ldb-fix-out-of-bounds-array-access-warning/20210324-202112
base:   https://git.kernel.org/pub/scm/linux/kernel/git/shawnguo/linux.git for-next
config: ia64-randconfig-r021-20210323 (attached as .config)
compiler: ia64-linux-gcc (GCC) 9.3.0
reproduce (this is a W=1 build):
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # https://github.com/0day-ci/linux/commit/1921451dcfc3ce8072884c286da96759e18ad102
        git remote add linux-review https://github.com/0day-ci/linux
        git fetch --no-tags linux-review Arnd-Bergmann/drm-imx-imx-ldb-fix-out-of-bounds-array-access-warning/20210324-202112
        git checkout 1921451dcfc3ce8072884c286da96759e18ad102
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=ia64 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>

All warnings (new ones prefixed by >>):

   In file included from arch/ia64/include/asm/pgtable.h:154,
                    from include/linux/pgtable.h:6,
                    from arch/ia64/include/asm/uaccess.h:40,
                    from include/linux/uaccess.h:11,
                    from arch/ia64/include/asm/sections.h:11,
                    from include/linux/interrupt.h:20,
                    from include/linux/trace_recursion.h:5,
                    from include/linux/ftrace.h:10,
                    from include/linux/kprobes.h:29,
                    from include/linux/kgdb.h:19,
                    from include/linux/fb.h:5,
                    from include/drm/drm_crtc.h:31,
                    from include/drm/drm_atomic.h:31,
                    from drivers/gpu/drm/imx/imx-ldb.c:21:
   arch/ia64/include/asm/mmu_context.h: In function 'reload_context':
   arch/ia64/include/asm/mmu_context.h:127:41: warning: variable 'old_rr4' set but not used [-Wunused-but-set-variable]
     127 |  unsigned long rr0, rr1, rr2, rr3, rr4, old_rr4;
         |                                         ^~~~~~~
   In file included from include/linux/device.h:15,
                    from include/linux/node.h:18,
                    from include/linux/cpu.h:17,
                    from include/linux/of_device.h:5,
                    from drivers/gpu/drm/imx/imx-ldb.c:13:
   drivers/gpu/drm/imx/imx-ldb.c: In function 'imx_ldb_encoder_enable':
>> drivers/gpu/drm/imx/imx-ldb.c:201:22: warning: format '%d' expects argument of type 'int', but argument 4 has type 'void *' [-Wformat=]
     201 |   dev_warn(ldb->dev, "%s: invalid mux %d\n",
         |                      ^~~~~~~~~~~~~~~~~~~~~~
   include/linux/dev_printk.h:19:22: note: in definition of macro 'dev_fmt'
      19 | #define dev_fmt(fmt) fmt
         |                      ^~~
   drivers/gpu/drm/imx/imx-ldb.c:201:3: note: in expansion of macro 'dev_warn'
     201 |   dev_warn(ldb->dev, "%s: invalid mux %d\n",
         |   ^~~~~~~~
   drivers/gpu/drm/imx/imx-ldb.c:201:40: note: format string is defined here
     201 |   dev_warn(ldb->dev, "%s: invalid mux %d\n",
         |                                       ~^
         |                                        |
         |                                        int
         |                                       %p
   In file included from include/linux/device.h:15,
                    from include/linux/node.h:18,
                    from include/linux/cpu.h:17,
                    from include/linux/of_device.h:5,
                    from drivers/gpu/drm/imx/imx-ldb.c:13:
   drivers/gpu/drm/imx/imx-ldb.c: In function 'imx_ldb_encoder_atomic_mode_set':
   drivers/gpu/drm/imx/imx-ldb.c:265:22: warning: format '%d' expects argument of type 'int', but argument 4 has type 'void *' [-Wformat=]
     265 |   dev_warn(ldb->dev, "%s: invalid mux %d\n",
         |                      ^~~~~~~~~~~~~~~~~~~~~~
   include/linux/dev_printk.h:19:22: note: in definition of macro 'dev_fmt'
      19 | #define dev_fmt(fmt) fmt
         |                      ^~~
   drivers/gpu/drm/imx/imx-ldb.c:265:3: note: in expansion of macro 'dev_warn'
     265 |   dev_warn(ldb->dev, "%s: invalid mux %d\n",
         |   ^~~~~~~~
   drivers/gpu/drm/imx/imx-ldb.c:265:40: note: format string is defined here
     265 |   dev_warn(ldb->dev, "%s: invalid mux %d\n",
         |                                       ~^
         |                                        |
         |                                        int
         |                                       %p

Kconfig warnings: (for reference only)
   WARNING: unmet direct dependencies detected for FRAME_POINTER
   Depends on DEBUG_KERNEL && (M68K || UML || SUPERH) || ARCH_WANT_FRAME_POINTERS
   Selected by
   - FAULT_INJECTION_STACKTRACE_FILTER && FAULT_INJECTION_DEBUG_FS && STACKTRACE_SUPPORT && !X86_64 && !MIPS && !PPC && !S390 && !MICROBLAZE && !ARM && !ARC && !X86


vim +201 drivers/gpu/drm/imx/imx-ldb.c

   192	
   193	static void imx_ldb_encoder_enable(struct drm_encoder *encoder)
   194	{
   195		struct imx_ldb_channel *imx_ldb_ch = enc_to_imx_ldb_ch(encoder);
   196		struct imx_ldb *ldb = imx_ldb_ch->ldb;
   197		int dual = ldb->ldb_ctrl & LDB_SPLIT_MODE_EN;
   198		int mux = drm_of_encoder_active_port_id(imx_ldb_ch->child, encoder);
   199	
   200		if (mux < 0 || mux >= ARRAY_SIZE(ldb->clk_sel)) {
 > 201			dev_warn(ldb->dev, "%s: invalid mux %d\n",
   202				 __func__, ERR_PTR(mux));
   203			return;
   204		}
   205	
   206		drm_panel_prepare(imx_ldb_ch->panel);
   207	
   208		if (dual) {
   209			clk_set_parent(ldb->clk_sel[mux], ldb->clk[0]);
   210			clk_set_parent(ldb->clk_sel[mux], ldb->clk[1]);
   211	
   212			clk_prepare_enable(ldb->clk[0]);
   213			clk_prepare_enable(ldb->clk[1]);
   214		} else {
   215			clk_set_parent(ldb->clk_sel[mux], ldb->clk[imx_ldb_ch->chno]);
   216		}
   217	
   218		if (imx_ldb_ch == &ldb->channel[0] || dual) {
   219			ldb->ldb_ctrl &= ~LDB_CH0_MODE_EN_MASK;
   220			if (mux == 0 || ldb->lvds_mux)
   221				ldb->ldb_ctrl |= LDB_CH0_MODE_EN_TO_DI0;
   222			else if (mux == 1)
   223				ldb->ldb_ctrl |= LDB_CH0_MODE_EN_TO_DI1;
   224		}
   225		if (imx_ldb_ch == &ldb->channel[1] || dual) {
   226			ldb->ldb_ctrl &= ~LDB_CH1_MODE_EN_MASK;
   227			if (mux == 1 || ldb->lvds_mux)
   228				ldb->ldb_ctrl |= LDB_CH1_MODE_EN_TO_DI1;
   229			else if (mux == 0)
   230				ldb->ldb_ctrl |= LDB_CH1_MODE_EN_TO_DI0;
   231		}
   232	
   233		if (ldb->lvds_mux) {
   234			const struct bus_mux *lvds_mux = NULL;
   235	
   236			if (imx_ldb_ch == &ldb->channel[0])
   237				lvds_mux = &ldb->lvds_mux[0];
   238			else if (imx_ldb_ch == &ldb->channel[1])
   239				lvds_mux = &ldb->lvds_mux[1];
   240	
   241			regmap_update_bits(ldb->regmap, lvds_mux->reg, lvds_mux->mask,
   242					   mux << lvds_mux->shift);
   243		}
   244	
   245		regmap_write(ldb->regmap, IOMUXC_GPR2, ldb->ldb_ctrl);
   246	
   247		drm_panel_enable(imx_ldb_ch->panel);
   248	}
   249	

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 36278 bytes --]

  parent reply	other threads:[~2021-03-24 16:16 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-24 12:17 [PATCH] [v2] drm/imx: imx-ldb: fix out of bounds array access warning Arnd Bergmann
2021-03-24 12:17 ` Arnd Bergmann
2021-03-24 12:17 ` Arnd Bergmann
2021-03-24 14:20 ` Joe Perches
2021-03-24 14:20   ` Joe Perches
2021-03-24 14:20   ` Joe Perches
2021-03-24 16:42   ` Arnd Bergmann
2021-03-24 16:42     ` Arnd Bergmann
2021-03-24 16:42     ` Arnd Bergmann
2021-03-24 16:52     ` Joe Perches
2021-03-24 16:52       ` Joe Perches
2021-03-24 16:52       ` Joe Perches
2021-03-24 17:20       ` [RFC patch] vsprintf: Allow %pe to print non PTR_ERR %pe uses as decimal Joe Perches
2021-03-24 17:20         ` Joe Perches
2021-03-24 17:20         ` Joe Perches
2021-03-24 17:33         ` Rasmus Villemoes
2021-03-24 17:33           ` Rasmus Villemoes
2021-03-24 17:33           ` Rasmus Villemoes
2021-03-24 19:24           ` Joe Perches
2021-03-24 19:24             ` Joe Perches
2021-03-24 19:24             ` Joe Perches
2021-03-24 21:27             ` Rasmus Villemoes
2021-03-24 21:27               ` Rasmus Villemoes
2021-03-24 21:27               ` Rasmus Villemoes
2021-03-24 22:18               ` Joe Perches
2021-03-24 22:18                 ` Joe Perches
2021-03-24 22:18                 ` Joe Perches
2021-03-24 22:36                 ` Rasmus Villemoes
2021-03-24 22:36                   ` Rasmus Villemoes
2021-03-24 22:36                   ` Rasmus Villemoes
2021-03-24 22:46                   ` Joe Perches
2021-03-24 22:46                     ` Joe Perches
2021-03-24 22:46                     ` Joe Perches
2021-03-24 16:14 ` kernel test robot [this message]
2021-03-24 16:14   ` [PATCH] [v2] drm/imx: imx-ldb: fix out of bounds array access warning kernel test robot
2021-03-24 16:14   ` kernel test robot

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=202103250034.UQ7D4AFT-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=airlied@linux.ie \
    --cc=arnd@arndb.de \
    --cc=arnd@kernel.org \
    --cc=daniel@ffwll.ch \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=kbuild-all@lists.01.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=m.felsch@pengutronix.de \
    --cc=p.zabel@pengutronix.de \
    --cc=s.hauer@pengutronix.de \
    --cc=shawnguo@kernel.org \
    --cc=victor.liu@nxp.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.