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

powerpc: Fix fallout from device_node->name constification

Commit c22618a1, "drivers/of: Constify device_node->name and
->path_component_name" changes device_node name to a const value, but
the PowerPC scom code still assigns it to a non-void field in
debugfs_blob_wrapper. The /right/ solution might be to change the
debugfs_blob_wrapper->data to also be const, but that is a bit
risky. Instead, cast the value to (void*). It is a bit ugly, but it
is the safest change until it can be investigated where
debugfs_blob_wrapper can be modified.

Reported-by: Michael Neuling <mikey@neuling.org>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Grant Likely <grant.likely@secretlab.ca>

+1 -1
+1 -1
arch/powerpc/sysdev/scom.c
··· 157 157 ent->map = SCOM_MAP_INVALID; 158 158 spin_lock_init(&ent->lock); 159 159 snprintf(ent->name, 8, "scom%d", i); 160 - ent->blob.data = dn->full_name; 160 + ent->blob.data = (void*) dn->full_name; 161 161 ent->blob.size = strlen(dn->full_name); 162 162 163 163 dir = debugfs_create_dir(ent->name, root);