drivers/gpu/drm/tilcdc/tilcdc_panel_legacy.c:108:55: sparse: sparse: incorrect type in initializer (different base types)
kernel test robot
build bottree: https://gitlab.freedesktop.org/drm/misc/kernel.git drm-misc-next head: 948e195dfaa56e48eabda591f97630502ff7e27e commit: 0ff223d991477fa4677dcb0f1fb00065847e2212 [5/25] drm/tilcdc: Convert legacy panel binding via DT overlay at boot time config: arm-randconfig-r111-20260219 (https://download.01.org/0day-ci/archive/20260220/[email protected]/config) compiler: clang version 23.0.0git (https://github.com/llvm/llvm-project e86750b29fa0ff207cd43213d66dabe565417638) reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260220/[email protected]/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 <[email protected]>
| Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/
sparse warnings: (new ones prefixed by >>)
>> drivers/gpu/drm/tilcdc/tilcdc_panel_legacy.c:108:55: sparse: sparse: incorrect type in initializer (different base types) @@ expected unsigned int [usertype] @@ got restricted __be32 [usertype] @@
drivers/gpu/drm/tilcdc/tilcdc_panel_legacy.c:108:55: sparse: expected unsigned int [usertype]
drivers/gpu/drm/tilcdc/tilcdc_panel_legacy.c:108:55: sparse: got restricted __be32 [usertype]
drivers/gpu/drm/tilcdc/tilcdc_panel_legacy.c:115:55: sparse: sparse: incorrect type in initializer (different base types) @@ expected unsigned int [usertype] @@ got restricted __be32 [usertype] @@
drivers/gpu/drm/tilcdc/tilcdc_panel_legacy.c:115:55: sparse: expected unsigned int [usertype]
drivers/gpu/drm/tilcdc/tilcdc_panel_legacy.c:115:55: sparse: got restricted __be32 [usertype]
vim +108 drivers/gpu/drm/tilcdc/tilcdc_panel_legacy.c
41
42 static int __init tilcdc_panel_copy_props(struct device_node *old_panel,
43 struct device_node *new_panel)
44 {
45 struct device_node *old_timing __free(device_node) = NULL;
46 struct device_node *new_timing __free(device_node) = NULL;
47 struct device_node *panel_info __free(device_node) = NULL;
48 struct device_node *child __free(device_node) = NULL;
49 u32 invert_pxl_clk = 0, sync_edge = 0;
50 struct of_changeset ocs;
51 struct property *prop;
52 int ret;
53
54 child = of_get_child_by_name(old_panel, "display-timings");
55 if (!child)
56 return -EINVAL;
57
58 /* The default display timing is the one specified as native-mode.
59 * If no native-mode is specified then the first node is assumed
60 * to be the native mode.
61 */
62 old_timing = of_parse_phandle(child, "native-mode", 0);
63 if (!old_timing) {
64 old_timing = of_get_next_child(child, NULL);
65 if (!old_timing)
66 return -EINVAL;
67 }
68
69 panel_info = of_get_child_by_name(old_panel, "panel-info");
70 if (!panel_info)
71 return -EINVAL;
72
73 of_changeset_init(&ocs);
74
75 /* Copy all panel properties to the new panel node */
76 for_each_property_of_node(old_panel, prop) {
77 if (!strncmp(prop->name, "compatible", sizeof("compatible")))
78 continue;
79
80 ret = tilcdc_panel_update_prop(&ocs, new_panel, prop->name,
81 prop->value, prop->length);
82 if (ret)
83 goto destroy_ocs;
84 }
85
86 new_timing = of_changeset_create_node(&ocs, new_panel, "panel-timing");
87 if (!new_timing) {
88 ret = -ENODEV;
89 goto destroy_ocs;
90 }
91
92 /* Copy all panel timing properties to the new panel node */
93 for_each_property_of_node(old_timing, prop) {
94 ret = tilcdc_panel_update_prop(&ocs, new_timing, prop->name,
95 prop->value, prop->length);
96 if (ret)
97 goto destroy_ocs;
98 }
99
100 /* Looked only for these two parameter as all the other are always
101 * set to default and not related to common DRM properties.
102 */
103 of_property_read_u32(panel_info, "invert-pxl-clk", &invert_pxl_clk);
104 of_property_read_u32(panel_info, "sync-edge", &sync_edge);
105
106 if (!invert_pxl_clk) {
107 ret = tilcdc_panel_update_prop(&ocs, new_timing, "pixelclk-active",
> 108 &(u32){cpu_to_be32(1)}, sizeof(u32)); 109 if (ret)
110 goto destroy_ocs;
111 }
112
113 if (!sync_edge) {
114 ret = tilcdc_panel_update_prop(&ocs, new_timing, "syncclk-active",
115 &(u32){cpu_to_be32(1)}, sizeof(u32));
116 if (ret)
117 goto destroy_ocs;
118 }
119
120 /* Remove compatible property to avoid any driver compatible match */
121 of_changeset_remove_property(&ocs, old_panel,
122 of_find_property(old_panel, "compatible", NULL));
123
124 of_changeset_apply(&ocs);
125 return 0;
126
127 destroy_ocs:
128 of_changeset_destroy(&ocs);
129 return ret;
130 }
131
Signature · 2 lines
0-DAY CI Kernel Test Service https://github.com/intel/lkp-tests/wiki