All of lore.kernel.org
 help / color / mirror / Atom feed
* [wsa:coccinelle/of_device_get_match_data 4/19] drivers/gpu/drm/exynos/exynos_drm_gsc.c:1232:21: warning: assignment discards 'const' qualifier from pointer target type
@ 2021-09-19  0:48 kernel test robot
  0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2021-09-19  0:48 UTC (permalink / raw)
  To: kbuild-all

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

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux.git coccinelle/of_device_get_match_data
head:   855d01e7ecabcc51ac572795173d15205ecc208b
commit: c0f694afe329f7401326749f83356dd3baa7687b [4/19] drm/exynos: don't cast result of of_device_get_match_data()
config: nds32-randconfig-r032-20210919 (attached as .config)
compiler: nds32le-linux-gcc (GCC) 11.2.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://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux.git/commit/?id=c0f694afe329f7401326749f83356dd3baa7687b
        git remote add wsa https://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux.git
        git fetch --no-tags wsa coccinelle/of_device_get_match_data
        git checkout c0f694afe329f7401326749f83356dd3baa7687b
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross ARCH=nds32 

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 >>):

   drivers/gpu/drm/exynos/exynos_drm_gsc.c: In function 'gsc_probe':
>> drivers/gpu/drm/exynos/exynos_drm_gsc.c:1232:21: warning: assignment discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
    1232 |         driver_data = of_device_get_match_data(dev);
         |                     ^


vim +/const +1232 drivers/gpu/drm/exynos/exynos_drm_gsc.c

  1218	
  1219	static int gsc_probe(struct platform_device *pdev)
  1220	{
  1221		struct device *dev = &pdev->dev;
  1222		struct gsc_driverdata *driver_data;
  1223		struct exynos_drm_ipp_formats *formats;
  1224		struct gsc_context *ctx;
  1225		struct resource *res;
  1226		int num_formats, ret, i, j;
  1227	
  1228		ctx = devm_kzalloc(dev, sizeof(*ctx), GFP_KERNEL);
  1229		if (!ctx)
  1230			return -ENOMEM;
  1231	
> 1232		driver_data = of_device_get_match_data(dev);
  1233		ctx->dev = dev;
  1234		ctx->num_clocks = driver_data->num_clocks;
  1235		ctx->clk_names = driver_data->clk_names;
  1236	
  1237		/* construct formats/limits array */
  1238		num_formats = ARRAY_SIZE(gsc_formats) + ARRAY_SIZE(gsc_tiled_formats);
  1239		formats = devm_kcalloc(dev, num_formats, sizeof(*formats), GFP_KERNEL);
  1240		if (!formats)
  1241			return -ENOMEM;
  1242	
  1243		/* linear formats */
  1244		for (i = 0; i < ARRAY_SIZE(gsc_formats); i++) {
  1245			formats[i].fourcc = gsc_formats[i];
  1246			formats[i].type = DRM_EXYNOS_IPP_FORMAT_SOURCE |
  1247					  DRM_EXYNOS_IPP_FORMAT_DESTINATION;
  1248			formats[i].limits = driver_data->limits;
  1249			formats[i].num_limits = driver_data->num_limits;
  1250		}
  1251	
  1252		/* tiled formats */
  1253		for (j = i, i = 0; i < ARRAY_SIZE(gsc_tiled_formats); j++, i++) {
  1254			formats[j].fourcc = gsc_tiled_formats[i];
  1255			formats[j].modifier = DRM_FORMAT_MOD_SAMSUNG_16_16_TILE;
  1256			formats[j].type = DRM_EXYNOS_IPP_FORMAT_SOURCE |
  1257					  DRM_EXYNOS_IPP_FORMAT_DESTINATION;
  1258			formats[j].limits = driver_data->limits;
  1259			formats[j].num_limits = driver_data->num_limits;
  1260		}
  1261	
  1262		ctx->formats = formats;
  1263		ctx->num_formats = num_formats;
  1264	
  1265		/* clock control */
  1266		for (i = 0; i < ctx->num_clocks; i++) {
  1267			ctx->clocks[i] = devm_clk_get(dev, ctx->clk_names[i]);
  1268			if (IS_ERR(ctx->clocks[i])) {
  1269				dev_err(dev, "failed to get clock: %s\n",
  1270					ctx->clk_names[i]);
  1271				return PTR_ERR(ctx->clocks[i]);
  1272			}
  1273		}
  1274	
  1275		/* resource memory */
  1276		ctx->regs_res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
  1277		ctx->regs = devm_ioremap_resource(dev, ctx->regs_res);
  1278		if (IS_ERR(ctx->regs))
  1279			return PTR_ERR(ctx->regs);
  1280	
  1281		/* resource irq */
  1282		res = platform_get_resource(pdev, IORESOURCE_IRQ, 0);
  1283		if (!res) {
  1284			dev_err(dev, "failed to request irq resource.\n");
  1285			return -ENOENT;
  1286		}
  1287	
  1288		ctx->irq = res->start;
  1289		ret = devm_request_irq(dev, ctx->irq, gsc_irq_handler, 0,
  1290				       dev_name(dev), ctx);
  1291		if (ret < 0) {
  1292			dev_err(dev, "failed to request irq.\n");
  1293			return ret;
  1294		}
  1295	
  1296		/* context initailization */
  1297		ctx->id = pdev->id;
  1298	
  1299		platform_set_drvdata(pdev, ctx);
  1300	
  1301		pm_runtime_use_autosuspend(dev);
  1302		pm_runtime_set_autosuspend_delay(dev, GSC_AUTOSUSPEND_DELAY);
  1303		pm_runtime_enable(dev);
  1304	
  1305		ret = component_add(dev, &gsc_component_ops);
  1306		if (ret)
  1307			goto err_pm_dis;
  1308	
  1309		dev_info(dev, "drm gsc registered successfully.\n");
  1310	
  1311		return 0;
  1312	
  1313	err_pm_dis:
  1314		pm_runtime_dont_use_autosuspend(dev);
  1315		pm_runtime_disable(dev);
  1316		return ret;
  1317	}
  1318	

---
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: 30989 bytes --]

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2021-09-19  0:48 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-09-19  0:48 [wsa:coccinelle/of_device_get_match_data 4/19] drivers/gpu/drm/exynos/exynos_drm_gsc.c:1232:21: warning: assignment discards 'const' qualifier from pointer target type kernel test robot

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.