Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

media: ti-vpe: avoid gcc-9 warning

gcc warns about empty array declarations, which we get in this driver
when compile-testing without CONFIG_OF:

drivers/media/platform/ti-vpe/cal.c:2194:34: warning: array 'cal_of_match' assumed to have one element
2194 | static const struct of_device_id cal_of_match[];

Since all users of this driver do need CONFIG_OF anyway, there is no
point in making the array definition conditional to save space, so
just remove the #ifdef and move the array up a little.

Fixes: 343e89a792a5 ("[media] media: ti-vpe: Add CAL v4l2 camera capture driver")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Reviewed-by: Benoit Parrot <bparrot@ti.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>

authored by

Arnd Bergmann and committed by
Mauro Carvalho Chehab
6c8d0cdd 7c192ebf

+21 -25
+21 -25
drivers/media/platform/ti-vpe/cal.c
··· 2237 2237 return NULL; 2238 2238 } 2239 2239 2240 - static const struct of_device_id cal_of_match[]; 2240 + static const struct of_device_id cal_of_match[] = { 2241 + { 2242 + .compatible = "ti,dra72-cal", 2243 + .data = (void *)&dra72x_cal_data, 2244 + }, 2245 + { 2246 + .compatible = "ti,dra72-pre-es2-cal", 2247 + .data = (void *)&dra72x_es1_cal_data, 2248 + }, 2249 + { 2250 + .compatible = "ti,dra76-cal", 2251 + .data = (void *)&dra76x_cal_data, 2252 + }, 2253 + { 2254 + .compatible = "ti,am654-cal", 2255 + .data = (void *)&am654_cal_data, 2256 + }, 2257 + {}, 2258 + }; 2259 + MODULE_DEVICE_TABLE(of, cal_of_match); 2241 2260 2242 2261 static int cal_probe(struct platform_device *pdev) 2243 2262 { ··· 2432 2413 return 0; 2433 2414 } 2434 2415 2435 - #if defined(CONFIG_OF) 2436 - static const struct of_device_id cal_of_match[] = { 2437 - { 2438 - .compatible = "ti,dra72-cal", 2439 - .data = (void *)&dra72x_cal_data, 2440 - }, 2441 - { 2442 - .compatible = "ti,dra72-pre-es2-cal", 2443 - .data = (void *)&dra72x_es1_cal_data, 2444 - }, 2445 - { 2446 - .compatible = "ti,dra76-cal", 2447 - .data = (void *)&dra76x_cal_data, 2448 - }, 2449 - { 2450 - .compatible = "ti,am654-cal", 2451 - .data = (void *)&am654_cal_data, 2452 - }, 2453 - {}, 2454 - }; 2455 - MODULE_DEVICE_TABLE(of, cal_of_match); 2456 - #endif 2457 - 2458 2416 static int cal_runtime_resume(struct device *dev) 2459 2417 { 2460 2418 struct cal_dev *caldev = dev_get_drvdata(dev); ··· 2458 2462 .driver = { 2459 2463 .name = CAL_MODULE_NAME, 2460 2464 .pm = &cal_pm_ops, 2461 - .of_match_table = of_match_ptr(cal_of_match), 2465 + .of_match_table = cal_of_match, 2462 2466 }, 2463 2467 }; 2464 2468