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

[POWERPC] chrp: Constify & voidify get_property()

Now that get_property() returns a void *, there's no need to cast its
return value. Also, treat the return value as const, so we can
constify get_property later.

chrp platform changes.

Built for chrp32_defconfig

Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
Signed-off-by: Paul Mackerras <paulus@samba.org>

authored by

Jeremy Kerr and committed by
Paul Mackerras
ae6b4101 c61c27d5

+17 -20
+3 -2
arch/powerpc/platforms/chrp/nvram.c
··· 67 67 void __init chrp_nvram_init(void) 68 68 { 69 69 struct device_node *nvram; 70 - unsigned int *nbytes_p, proplen; 70 + const unsigned int *nbytes_p; 71 + unsigned int proplen; 71 72 72 73 nvram = of_find_node_by_type(NULL, "nvram"); 73 74 if (nvram == NULL) 74 75 return; 75 76 76 - nbytes_p = (unsigned int *)get_property(nvram, "#bytes", &proplen); 77 + nbytes_p = get_property(nvram, "#bytes", &proplen); 77 78 if (nbytes_p == NULL || proplen != sizeof(unsigned int)) 78 79 return; 79 80
+5 -6
arch/powerpc/platforms/chrp/pci.c
··· 214 214 chrp_find_bridges(void) 215 215 { 216 216 struct device_node *dev; 217 - int *bus_range; 217 + const int *bus_range; 218 218 int len, index = -1; 219 219 struct pci_controller *hose; 220 - unsigned int *dma; 221 - char *model, *machine; 220 + const unsigned int *dma; 221 + const char *model, *machine; 222 222 int is_longtrail = 0, is_mot = 0, is_pegasos = 0; 223 223 struct device_node *root = find_path_device("/"); 224 224 struct resource r; ··· 246 246 dev->full_name); 247 247 continue; 248 248 } 249 - bus_range = (int *) get_property(dev, "bus-range", &len); 249 + bus_range = get_property(dev, "bus-range", &len); 250 250 if (bus_range == NULL || len < 2 * sizeof(int)) { 251 251 printk(KERN_WARNING "Can't get bus-range for %s\n", 252 252 dev->full_name); ··· 312 312 313 313 /* check the first bridge for a property that we can 314 314 use to set pci_dram_offset */ 315 - dma = (unsigned int *) 316 - get_property(dev, "ibm,dma-ranges", &len); 315 + dma = get_property(dev, "ibm,dma-ranges", &len); 317 316 if (index == 0 && dma != NULL && len >= 6 * sizeof(*dma)) { 318 317 pci_dram_offset = dma[2] - dma[3]; 319 318 printk("pci_dram_offset = %lx\n", pci_dram_offset);
+9 -12
arch/powerpc/platforms/chrp/setup.c
··· 226 226 /* Enable L2 cache if needed */ 227 227 np = find_type_devices("cpu"); 228 228 if (np != NULL) { 229 - unsigned int *l2cr = (unsigned int *) 230 - get_property (np, "l2cr", NULL); 229 + const unsigned int *l2cr = get_property(np, "l2cr", NULL); 231 230 if (l2cr == NULL) { 232 231 printk ("Pegasos l2cr : no cpu l2cr property found\n"); 233 232 return; ··· 251 252 void __init chrp_setup_arch(void) 252 253 { 253 254 struct device_node *root = find_path_device ("/"); 254 - char *machine = NULL; 255 + const char *machine = NULL; 255 256 256 257 /* init to some ~sane value until calibrate_delay() runs */ 257 258 loops_per_jiffy = 50000000/HZ; ··· 352 353 struct device_node *np, *root; 353 354 int len, i, j; 354 355 int isu_size, idu_size; 355 - unsigned int *iranges, *opprop = NULL; 356 + const unsigned int *iranges, *opprop = NULL; 356 357 int oplen = 0; 357 358 unsigned long opaddr; 358 359 int na = 1; ··· 362 363 return; 363 364 root = of_find_node_by_path("/"); 364 365 if (root) { 365 - opprop = (unsigned int *) get_property 366 - (root, "platform-open-pic", &oplen); 366 + opprop = get_property(root, "platform-open-pic", &oplen); 367 367 na = prom_n_addr_cells(root); 368 368 } 369 369 if (opprop && oplen >= na * sizeof(unsigned int)) { ··· 379 381 380 382 printk(KERN_INFO "OpenPIC at %lx\n", opaddr); 381 383 382 - iranges = (unsigned int *) get_property(np, "interrupt-ranges", &len); 384 + iranges = get_property(np, "interrupt-ranges", &len); 383 385 if (iranges == NULL) 384 386 len = 0; /* non-distributed mpic */ 385 387 else ··· 465 467 * from anyway 466 468 */ 467 469 for (np = find_devices("pci"); np != NULL; np = np->next) { 468 - unsigned int *addrp = (unsigned int *) 469 - get_property(np, "8259-interrupt-acknowledge", NULL); 470 + const unsigned int *addrp = get_property(np, 471 + "8259-interrupt-acknowledge", NULL); 470 472 471 473 if (addrp == NULL) 472 474 continue; ··· 525 527 chrp_init2(void) 526 528 { 527 529 struct device_node *device; 528 - unsigned int *p = NULL; 530 + const unsigned int *p = NULL; 529 531 530 532 #ifdef CONFIG_NVRAM 531 533 chrp_nvram_init(); ··· 543 545 */ 544 546 device = find_devices("rtas"); 545 547 if (device) 546 - p = (unsigned int *) get_property 547 - (device, "rtas-event-scan-rate", NULL); 548 + p = get_property(device, "rtas-event-scan-rate", NULL); 548 549 if (p && *p) { 549 550 /* 550 551 * Arrange to call chrp_event_scan at least *p times