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

nubus: Clean up whitespace

Signed-off-by: Finn Thain <fthain@telegraphics.com.au>
[geert: rebased]
Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>

authored by

Finn Thain and committed by
Geert Uytterhoeven
f42e5550 71ae40e4

+148 -162
+148 -162
drivers/nubus/nubus.c
··· 44 44 45 45 /* Globals */ 46 46 47 - struct nubus_dev* nubus_devices; 48 - struct nubus_board* nubus_boards; 47 + struct nubus_dev *nubus_devices; 48 + struct nubus_board *nubus_boards; 49 49 50 50 /* Meaning of "bytelanes": 51 51 ··· 69 69 70 70 Etcetera, etcetera. Hopefully this clears up some confusion over 71 71 what the following code actually does. */ 72 - 72 + 73 73 static inline int not_useful(void *p, int map) 74 74 { 75 - unsigned long pv=(unsigned long)p; 75 + unsigned long pv = (unsigned long)p; 76 + 76 77 pv &= 3; 77 - if(map & (1<<pv)) 78 + if (map & (1 << pv)) 78 79 return 0; 79 80 return 1; 80 81 } 81 - 82 + 82 83 static unsigned long nubus_get_rom(unsigned char **ptr, int len, int map) 83 84 { 84 85 /* This will hold the result */ 85 86 unsigned long v = 0; 86 87 unsigned char *p = *ptr; 87 88 88 - while(len) 89 - { 89 + while (len) { 90 90 v <<= 8; 91 - while(not_useful(p,map)) 91 + while (not_useful(p, map)) 92 92 p++; 93 93 v |= *p++; 94 94 len--; ··· 99 99 100 100 static void nubus_rewind(unsigned char **ptr, int len, int map) 101 101 { 102 - unsigned char *p=*ptr; 102 + unsigned char *p = *ptr; 103 103 104 104 /* Sanity check */ 105 - if(len > 65536) 105 + if (len > 65536) 106 106 pr_err("rewind of 0x%08x!\n", len); 107 - while(len) 108 - { 109 - do 110 - { 107 + while (len) { 108 + do { 111 109 p--; 112 - } 113 - while(not_useful(p, map)); 110 + } while (not_useful(p, map)); 114 111 len--; 115 112 } 116 - *ptr=p; 113 + *ptr = p; 117 114 } 118 115 119 116 static void nubus_advance(unsigned char **ptr, int len, int map) 120 117 { 121 118 unsigned char *p = *ptr; 122 - if(len>65536) 119 + 120 + if (len > 65536) 123 121 pr_err("advance of 0x%08x!\n", len); 124 - while(len) 125 - { 126 - while(not_useful(p,map)) 122 + while (len) { 123 + while (not_useful(p, map)) 127 124 p++; 128 125 p++; 129 126 len--; ··· 130 133 131 134 static void nubus_move(unsigned char **ptr, int len, int map) 132 135 { 133 - if(len > 0) 136 + if (len > 0) 134 137 nubus_advance(ptr, len, map); 135 - else if(len < 0) 138 + else if (len < 0) 136 139 nubus_rewind(ptr, -len, map); 137 140 } 138 141 ··· 145 148 146 149 static inline long nubus_expand32(long foo) 147 150 { 148 - if(foo & 0x00800000) /* 24bit negative */ 151 + if (foo & 0x00800000) /* 24bit negative */ 149 152 foo |= 0xFF000000; 150 153 return foo; 151 154 } 152 155 153 156 static inline void *nubus_rom_addr(int slot) 154 - { 157 + { 155 158 /* 156 159 * Returns the first byte after the card. We then walk 157 160 * backwards to get the lane register and the config 158 161 */ 159 - return (void *)(0xF1000000+(slot<<24)); 162 + return (void *)(0xF1000000 + (slot << 24)); 160 163 } 161 164 162 165 static unsigned char *nubus_dirptr(const struct nubus_dirent *nd) 163 166 { 164 167 unsigned char *p = nd->base; 168 + 165 169 /* Essentially, just step over the bytelanes using whatever 166 170 offset we might have found */ 167 171 nubus_move(&p, nubus_expand32(nd->data), nd->mask); ··· 173 175 /* These two are for pulling resource data blocks (i.e. stuff that's 174 176 pointed to with offsets) out of the card ROM. */ 175 177 176 - void nubus_get_rsrc_mem(void *dest, const struct nubus_dirent* dirent, 178 + void nubus_get_rsrc_mem(void *dest, const struct nubus_dirent *dirent, 177 179 int len) 178 180 { 179 181 unsigned char *t = (unsigned char *)dest; 180 182 unsigned char *p = nubus_dirptr(dirent); 181 - while(len) 182 - { 183 + 184 + while (len) { 183 185 *t++ = nubus_get_rom(&p, 1, dirent->mask); 184 186 len--; 185 187 } 186 188 } 187 189 EXPORT_SYMBOL(nubus_get_rsrc_mem); 188 190 189 - void nubus_get_rsrc_str(void *dest, const struct nubus_dirent* dirent, 191 + void nubus_get_rsrc_str(void *dest, const struct nubus_dirent *dirent, 190 192 int len) 191 193 { 192 - unsigned char *t=(unsigned char *)dest; 194 + unsigned char *t = (unsigned char *)dest; 193 195 unsigned char *p = nubus_dirptr(dirent); 194 - while(len) 195 - { 196 + 197 + while (len) { 196 198 *t = nubus_get_rom(&p, 1, dirent->mask); 197 - if(!*t++) 199 + if (!*t++) 198 200 break; 199 201 len--; 200 202 } 201 203 } 202 204 EXPORT_SYMBOL(nubus_get_rsrc_str); 203 205 204 - int nubus_get_root_dir(const struct nubus_board* board, 205 - struct nubus_dir* dir) 206 + int nubus_get_root_dir(const struct nubus_board *board, 207 + struct nubus_dir *dir) 206 208 { 207 209 dir->ptr = dir->base = board->directory; 208 210 dir->done = 0; ··· 212 214 EXPORT_SYMBOL(nubus_get_root_dir); 213 215 214 216 /* This is a slyly renamed version of the above */ 215 - int nubus_get_func_dir(const struct nubus_dev* dev, 216 - struct nubus_dir* dir) 217 + int nubus_get_func_dir(const struct nubus_dev *dev, 218 + struct nubus_dir *dir) 217 219 { 218 220 dir->ptr = dir->base = dev->directory; 219 221 dir->done = 0; ··· 222 224 } 223 225 EXPORT_SYMBOL(nubus_get_func_dir); 224 226 225 - int nubus_get_board_dir(const struct nubus_board* board, 226 - struct nubus_dir* dir) 227 + int nubus_get_board_dir(const struct nubus_board *board, 228 + struct nubus_dir *dir) 227 229 { 228 230 struct nubus_dirent ent; 229 - 231 + 230 232 dir->ptr = dir->base = board->directory; 231 233 dir->done = 0; 232 234 dir->mask = board->lanes; ··· 254 256 int nubus_readdir(struct nubus_dir *nd, struct nubus_dirent *ent) 255 257 { 256 258 u32 resid; 259 + 257 260 if (nd->done) 258 261 return -1; 259 262 ··· 265 266 resid = nubus_get_rom(&nd->ptr, 4, nd->mask); 266 267 267 268 /* EOL marker, as per the Apple docs */ 268 - if((resid&0xff000000) == 0xff000000) 269 - { 269 + if ((resid & 0xff000000) == 0xff000000) { 270 270 /* Mark it as done */ 271 271 nd->done = 1; 272 272 return -1; 273 273 } 274 274 275 275 /* First byte is the resource ID */ 276 - ent->type = resid >> 24; 276 + ent->type = resid >> 24; 277 277 /* Low 3 bytes might contain data (or might not) */ 278 278 ent->data = resid & 0xffffff; 279 - ent->mask = nd->mask; 279 + ent->mask = nd->mask; 280 280 return 0; 281 281 } 282 282 EXPORT_SYMBOL(nubus_readdir); 283 283 284 - int nubus_rewinddir(struct nubus_dir* dir) 284 + int nubus_rewinddir(struct nubus_dir *dir) 285 285 { 286 286 dir->ptr = dir->base; 287 287 dir->done = 0; 288 - 289 288 return 0; 290 289 } 291 290 EXPORT_SYMBOL(nubus_rewinddir); ··· 291 294 /* Driver interface functions, more or less like in pci.c */ 292 295 293 296 struct nubus_dev* 294 - nubus_find_device(unsigned short category, 295 - unsigned short type, 296 - unsigned short dr_hw, 297 - unsigned short dr_sw, 298 - const struct nubus_dev* from) 297 + nubus_find_device(unsigned short category, unsigned short type, 298 + unsigned short dr_hw, unsigned short dr_sw, 299 + const struct nubus_dev *from) 299 300 { 300 - struct nubus_dev* itor = 301 - from ? from->next : nubus_devices; 301 + struct nubus_dev *itor = from ? from->next : nubus_devices; 302 302 303 303 while (itor) { 304 - if (itor->category == category 305 - && itor->type == type 306 - && itor->dr_hw == dr_hw 307 - && itor->dr_sw == dr_sw) 304 + if (itor->category == category && itor->type == type && 305 + itor->dr_hw == dr_hw && itor->dr_sw == dr_sw) 308 306 return itor; 309 307 itor = itor->next; 310 308 } ··· 308 316 EXPORT_SYMBOL(nubus_find_device); 309 317 310 318 struct nubus_dev* 311 - nubus_find_type(unsigned short category, 312 - unsigned short type, 313 - const struct nubus_dev* from) 319 + nubus_find_type(unsigned short category, unsigned short type, 320 + const struct nubus_dev *from) 314 321 { 315 - struct nubus_dev* itor = 316 - from ? from->next : nubus_devices; 322 + struct nubus_dev *itor = from ? from->next : nubus_devices; 317 323 318 324 while (itor) { 319 - if (itor->category == category 320 - && itor->type == type) 325 + if (itor->category == category && itor->type == type) 321 326 return itor; 322 327 itor = itor->next; 323 328 } ··· 323 334 EXPORT_SYMBOL(nubus_find_type); 324 335 325 336 struct nubus_dev* 326 - nubus_find_slot(unsigned int slot, 327 - const struct nubus_dev* from) 337 + nubus_find_slot(unsigned int slot, const struct nubus_dev *from) 328 338 { 329 - struct nubus_dev* itor = 330 - from ? from->next : nubus_devices; 331 - 339 + struct nubus_dev *itor = from ? from->next : nubus_devices; 340 + 332 341 while (itor) { 333 342 if (itor->board->slot == slot) 334 343 return itor; ··· 337 350 EXPORT_SYMBOL(nubus_find_slot); 338 351 339 352 int 340 - nubus_find_rsrc(struct nubus_dir* dir, unsigned char rsrc_type, 341 - struct nubus_dirent* ent) 353 + nubus_find_rsrc(struct nubus_dir *dir, unsigned char rsrc_type, 354 + struct nubus_dirent *ent) 342 355 { 343 356 while (nubus_readdir(dir, ent) != -1) { 344 357 if (ent->type == rsrc_type) 345 358 return 0; 346 - } 359 + } 347 360 return -1; 348 361 } 349 362 EXPORT_SYMBOL(nubus_find_rsrc); ··· 357 370 among other things. The rest of it should go in the /proc code. 358 371 For now, we just use it to give verbose boot logs. */ 359 372 360 - static int __init nubus_show_display_resource(struct nubus_dev* dev, 361 - const struct nubus_dirent* ent) 373 + static int __init nubus_show_display_resource(struct nubus_dev *dev, 374 + const struct nubus_dirent *ent) 362 375 { 363 376 switch (ent->type) { 364 377 case NUBUS_RESID_GAMMADIR: ··· 375 388 return 0; 376 389 } 377 390 378 - static int __init nubus_show_network_resource(struct nubus_dev* dev, 379 - const struct nubus_dirent* ent) 391 + static int __init nubus_show_network_resource(struct nubus_dev *dev, 392 + const struct nubus_dirent *ent) 380 393 { 381 394 switch (ent->type) { 382 395 case NUBUS_RESID_MAC_ADDRESS: 383 396 { 384 397 char addr[6]; 385 - 398 + 386 399 nubus_get_rsrc_mem(addr, ent, 6); 387 400 pr_info(" MAC address: %pM\n", addr); 388 401 break; ··· 394 407 return 0; 395 408 } 396 409 397 - static int __init nubus_show_cpu_resource(struct nubus_dev* dev, 398 - const struct nubus_dirent* ent) 410 + static int __init nubus_show_cpu_resource(struct nubus_dev *dev, 411 + const struct nubus_dirent *ent) 399 412 { 400 413 switch (ent->type) { 401 414 case NUBUS_RESID_MEMINFO: 402 415 { 403 416 unsigned long meminfo[2]; 417 + 404 418 nubus_get_rsrc_mem(&meminfo, ent, 8); 405 419 pr_info(" memory: [ 0x%08lx 0x%08lx ]\n", 406 420 meminfo[0], meminfo[1]); ··· 410 422 case NUBUS_RESID_ROMINFO: 411 423 { 412 424 unsigned long rominfo[2]; 425 + 413 426 nubus_get_rsrc_mem(&rominfo, ent, 8); 414 427 pr_info(" ROM: [ 0x%08lx 0x%08lx ]\n", 415 428 rominfo[0], rominfo[1]); ··· 423 434 return 0; 424 435 } 425 436 426 - static int __init nubus_show_private_resource(struct nubus_dev* dev, 427 - const struct nubus_dirent* ent) 437 + static int __init nubus_show_private_resource(struct nubus_dev *dev, 438 + const struct nubus_dirent *ent) 428 439 { 429 440 switch (dev->category) { 430 441 case NUBUS_CAT_DISPLAY: ··· 443 454 return 0; 444 455 } 445 456 446 - static struct nubus_dev* __init 447 - nubus_get_functional_resource(struct nubus_board* board, 448 - int slot, 449 - const struct nubus_dirent* parent) 457 + static struct nubus_dev * __init 458 + nubus_get_functional_resource(struct nubus_board *board, int slot, 459 + const struct nubus_dirent *parent) 450 460 { 451 - struct nubus_dir dir; 461 + struct nubus_dir dir; 452 462 struct nubus_dirent ent; 453 - struct nubus_dev* dev; 454 - 463 + struct nubus_dev *dev; 464 + 455 465 pr_info(" Function 0x%02x:\n", parent->type); 456 466 nubus_get_subdir(parent, &dir); 457 467 458 468 /* Apple seems to have botched the ROM on the IIx */ 459 469 if (slot == 0 && (unsigned long)dir.base % 2) 460 470 dir.base += 1; 461 - 471 + 462 472 pr_debug("%s: parent is 0x%p, dir is 0x%p\n", 463 473 __func__, parent->base, dir.base); 464 474 465 475 /* Actually we should probably panic if this fails */ 466 476 if ((dev = kzalloc(sizeof(*dev), GFP_ATOMIC)) == NULL) 467 - return NULL; 477 + return NULL; 468 478 dev->resid = parent->type; 469 479 dev->directory = dir.base; 470 480 dev->board = board; 471 - 472 - while (nubus_readdir(&dir, &ent) != -1) 473 - { 474 - switch(ent.type) 475 - { 481 + 482 + while (nubus_readdir(&dir, &ent) != -1) { 483 + switch (ent.type) { 476 484 case NUBUS_RESID_TYPE: 477 485 { 478 486 unsigned short nbtdata[4]; 487 + 479 488 nubus_get_rsrc_mem(nbtdata, &ent, 8); 480 489 dev->category = nbtdata[0]; 481 490 dev->type = nbtdata[1]; ··· 495 508 use this :-) */ 496 509 struct nubus_dir drvr_dir; 497 510 struct nubus_dirent drvr_ent; 511 + 498 512 nubus_get_subdir(&ent, &drvr_dir); 499 513 nubus_readdir(&drvr_dir, &drvr_ent); 500 514 dev->driver = nubus_dirptr(&drvr_ent); ··· 513 525 /* Ditto */ 514 526 nubus_get_rsrc_mem(&dev->iosize, &ent, 4); 515 527 pr_info(" memory length: 0x%08lx\n", dev->iosize); 516 - break; 528 + break; 517 529 case NUBUS_RESID_FLAGS: 518 530 dev->flags = ent.data; 519 531 pr_info(" flags: 0x%06x\n", dev->flags); ··· 528 540 nubus_show_private_resource(dev, &ent); 529 541 } 530 542 } 531 - 543 + 532 544 return dev; 533 545 } 534 546 535 547 /* This is cool. */ 536 - static int __init nubus_get_vidnames(struct nubus_board* board, 537 - const struct nubus_dirent* parent) 548 + static int __init nubus_get_vidnames(struct nubus_board *board, 549 + const struct nubus_dirent *parent) 538 550 { 539 - struct nubus_dir dir; 551 + struct nubus_dir dir; 540 552 struct nubus_dirent ent; 553 + 541 554 /* FIXME: obviously we want to put this in a header file soon */ 542 555 struct vidmode { 543 556 u32 size; ··· 553 564 pr_debug("%s: parent is 0x%p, dir is 0x%p\n", 554 565 __func__, parent->base, dir.base); 555 566 556 - while(nubus_readdir(&dir, &ent) != -1) 557 - { 567 + while (nubus_readdir(&dir, &ent) != -1) { 558 568 struct vidmode mode; 559 569 u32 size; 560 570 561 571 /* First get the length */ 562 572 nubus_get_rsrc_mem(&size, &ent, 4); 563 - 573 + 564 574 /* Now clobber the whole thing */ 565 575 if (size > sizeof(mode) - 1) 566 576 size = sizeof(mode) - 1; ··· 572 584 } 573 585 574 586 /* This is *really* cool. */ 575 - static int __init nubus_get_icon(struct nubus_board* board, 576 - const struct nubus_dirent* ent) 587 + static int __init nubus_get_icon(struct nubus_board *board, 588 + const struct nubus_dirent *ent) 577 589 { 578 590 /* Should be 32x32 if my memory serves me correctly */ 579 591 unsigned char icon[128]; 580 592 int x, y; 581 - 593 + 582 594 nubus_get_rsrc_mem(&icon, ent, 128); 583 595 pr_info(" icon:\n"); 584 596 ··· 588 600 for (y = 0; y < 32; y++) { 589 601 pr_info(" "); 590 602 for (x = 0; x < 32; x++) { 591 - if (icon[y*4 + x/8] 592 - & (0x80 >> (x%8))) 603 + if (icon[y * 4 + x / 8] & (0x80 >> (x % 8))) 593 604 pr_cont("*"); 594 605 else 595 606 pr_cont(" "); ··· 598 611 return 0; 599 612 } 600 613 601 - static int __init nubus_get_vendorinfo(struct nubus_board* board, 602 - const struct nubus_dirent* parent) 614 + static int __init nubus_get_vendorinfo(struct nubus_board *board, 615 + const struct nubus_dirent *parent) 603 616 { 604 - struct nubus_dir dir; 617 + struct nubus_dir dir; 605 618 struct nubus_dirent ent; 606 - static char* vendor_fields[6] = {"ID", "serial", "revision", 607 - "part", "date", "unknown field"}; 619 + static char *vendor_fields[6] = { "ID", "serial", "revision", 620 + "part", "date", "unknown field" }; 608 621 609 622 pr_info(" vendor info:\n"); 610 623 nubus_get_subdir(parent, &dir); 611 624 pr_debug("%s: parent is 0x%p, dir is 0x%p\n", 612 625 __func__, parent->base, dir.base); 613 626 614 - while(nubus_readdir(&dir, &ent) != -1) 615 - { 627 + while (nubus_readdir(&dir, &ent) != -1) { 616 628 char name[64]; 617 - 629 + 618 630 /* These are all strings, we think */ 619 631 nubus_get_rsrc_str(name, &ent, 64); 620 632 if (ent.type > 5) ··· 623 637 return 0; 624 638 } 625 639 626 - static int __init nubus_get_board_resource(struct nubus_board* board, int slot, 627 - const struct nubus_dirent* parent) 640 + static int __init nubus_get_board_resource(struct nubus_board *board, int slot, 641 + const struct nubus_dirent *parent) 628 642 { 629 - struct nubus_dir dir; 643 + struct nubus_dir dir; 630 644 struct nubus_dirent ent; 631 - 645 + 632 646 nubus_get_subdir(parent, &dir); 633 647 pr_debug("%s: parent is 0x%p, dir is 0x%p\n", 634 648 __func__, parent->base, dir.base); 635 649 636 - while(nubus_readdir(&dir, &ent) != -1) 637 - { 650 + while (nubus_readdir(&dir, &ent) != -1) { 638 651 switch (ent.type) { 639 652 case NUBUS_RESID_TYPE: 640 653 { ··· 674 689 case NUBUS_RESID_SECONDINIT: 675 690 pr_info(" secondary init offset: 0x%06x\n", ent.data); 676 691 break; 677 - /* WTF isn't this in the functional resources? */ 692 + /* WTF isn't this in the functional resources? */ 678 693 case NUBUS_RESID_VIDNAMES: 679 694 nubus_get_vidnames(board, &ent); 680 695 break; ··· 682 697 case NUBUS_RESID_VIDMODES: 683 698 pr_info(" video mode parameter directory offset: 0x%06x\n", 684 699 ent.data); 685 - break; 700 + break; 686 701 default: 687 702 pr_info(" unknown resource %02X, data 0x%06x\n", 688 703 ent.type, ent.data); ··· 695 710 sResources in the motherboard ROM */ 696 711 static void __init nubus_find_rom_dir(struct nubus_board* board) 697 712 { 698 - unsigned char* rp; 699 - unsigned char* romdir; 713 + unsigned char *rp; 714 + unsigned char *romdir; 700 715 struct nubus_dir dir; 701 716 struct nubus_dirent ent; 702 717 ··· 729 744 if (console_loglevel >= CONSOLE_LOGLEVEL_DEBUG) 730 745 printk(KERN_INFO "nubus_get_rom_dir: entry %02x %06x\n", ent.type, ent.data); 731 746 /* This one takes us to where we want to go. */ 732 - if (nubus_readdir(&dir, &ent) == -1) 747 + if (nubus_readdir(&dir, &ent) == -1) 733 748 goto badrom; 734 749 if (console_loglevel >= CONSOLE_LOGLEVEL_DEBUG) 735 750 printk(KERN_DEBUG "nubus_get_rom_dir: entry %02x %06x\n", ent.type, ent.data); 736 751 nubus_get_subdir(&ent, &dir); 737 752 738 753 /* Resource ID 01, also an "Unknown Macintosh" */ 739 - if (nubus_readdir(&dir, &ent) == -1) 754 + if (nubus_readdir(&dir, &ent) == -1) 740 755 goto badrom; 741 756 if (console_loglevel >= CONSOLE_LOGLEVEL_DEBUG) 742 757 printk(KERN_DEBUG "nubus_get_rom_dir: entry %02x %06x\n", ent.type, ent.data); ··· 755 770 goto badrom; 756 771 if (console_loglevel >= CONSOLE_LOGLEVEL_DEBUG) 757 772 printk(KERN_DEBUG "nubus_get_rom_dir: entry %02x %06x\n", ent.type, ent.data); 758 - 773 + 759 774 /* Bwahahahaha... */ 760 775 nubus_get_subdir(&ent, &dir); 761 776 board->directory = dir.base; 762 777 return; 763 - 778 + 764 779 /* Even more evil laughter... */ 765 780 badrom: 766 781 board->directory = board->fblock; ··· 769 784 } 770 785 771 786 /* Add a board (might be many devices) to the list */ 772 - static struct nubus_board* __init nubus_add_board(int slot, int bytelanes) 787 + static struct nubus_board * __init nubus_add_board(int slot, int bytelanes) 773 788 { 774 - struct nubus_board* board; 775 - struct nubus_board** boardp; 776 - 789 + struct nubus_board *board; 790 + struct nubus_board **boardp; 777 791 unsigned char *rp; 778 792 unsigned long dpat; 779 793 struct nubus_dir dir; 780 794 struct nubus_dirent ent; 781 795 782 796 /* Move to the start of the format block */ 783 - rp = nubus_rom_addr(slot); 797 + rp = nubus_rom_addr(slot); 784 798 nubus_rewind(&rp, FORMAT_BLOCK_SIZE, bytelanes); 785 799 786 800 /* Actually we should probably panic if this fails */ 787 801 if ((board = kzalloc(sizeof(*board), GFP_ATOMIC)) == NULL) 788 - return NULL; 802 + return NULL; 789 803 board->fblock = rp; 790 804 791 805 /* Dump the format block for debugging purposes */ ··· 800 816 rp = board->fblock; 801 817 802 818 board->slot = slot; 803 - board->slot_addr = (unsigned long) nubus_slot_addr(slot); 819 + board->slot_addr = (unsigned long)nubus_slot_addr(slot); 804 820 board->doffset = nubus_get_rom(&rp, 4, bytelanes); 805 821 /* rom_length is *supposed* to be the total length of the 806 822 * ROM. In practice it is the "amount of ROM used to compute ··· 811 827 board->rom_length = nubus_get_rom(&rp, 4, bytelanes); 812 828 board->crc = nubus_get_rom(&rp, 4, bytelanes); 813 829 board->rev = nubus_get_rom(&rp, 1, bytelanes); 814 - board->format = nubus_get_rom(&rp,1, bytelanes); 830 + board->format = nubus_get_rom(&rp, 1, bytelanes); 815 831 board->lanes = bytelanes; 816 832 817 833 /* Directory offset should be small and negative... */ 818 - if(!(board->doffset & 0x00FF0000)) 834 + if (!(board->doffset & 0x00FF0000)) 819 835 pr_warn("Dodgy doffset!\n"); 820 836 dpat = nubus_get_rom(&rp, 4, bytelanes); 821 - if(dpat != NUBUS_TEST_PATTERN) 837 + if (dpat != NUBUS_TEST_PATTERN) 822 838 pr_warn("Wrong test pattern %08lx!\n", dpat); 823 - 839 + 824 840 /* 825 841 * I wonder how the CRC is meant to work - 826 842 * any takers ? ··· 830 846 831 847 /* Attempt to work around slot zero weirdness */ 832 848 nubus_find_rom_dir(board); 833 - nubus_get_root_dir(board, &dir); 849 + nubus_get_root_dir(board, &dir); 834 850 835 851 /* We're ready to rock */ 836 852 pr_info("Slot %X:\n", slot); ··· 853 869 resources. I have no idea WTF to do about this. */ 854 870 855 871 while (nubus_readdir(&dir, &ent) != -1) { 856 - struct nubus_dev* dev; 857 - struct nubus_dev** devp; 872 + struct nubus_dev *dev; 873 + struct nubus_dev **devp; 874 + 858 875 dev = nubus_get_functional_resource(board, slot, &ent); 859 876 if (dev == NULL) 860 877 continue; ··· 863 878 /* We zeroed this out above */ 864 879 if (board->first_dev == NULL) 865 880 board->first_dev = dev; 866 - 881 + 867 882 /* Put it on the global NuBus device chain. Keep entries in order. */ 868 - for (devp=&nubus_devices; *devp!=NULL; devp=&((*devp)->next)) 883 + for (devp = &nubus_devices; *devp != NULL; 884 + devp = &((*devp)->next)) 869 885 /* spin */; 870 886 *devp = dev; 871 - dev->next = NULL; 887 + dev->next = NULL; 872 888 } 873 889 874 890 /* Put it on the global NuBus board chain. Keep entries in order. */ 875 - for (boardp=&nubus_boards; *boardp!=NULL; boardp=&((*boardp)->next)) 891 + for (boardp = &nubus_boards; *boardp != NULL; 892 + boardp = &((*boardp)->next)) 876 893 /* spin */; 877 894 *boardp = board; 878 895 board->next = NULL; 879 - 896 + 880 897 return board; 881 898 } 882 899 883 900 void __init nubus_probe_slot(int slot) 884 901 { 885 902 unsigned char dp; 886 - unsigned char* rp; 903 + unsigned char *rp; 887 904 int i; 888 905 889 - rp = nubus_rom_addr(slot); 890 - for(i = 4; i; i--) 891 - { 906 + rp = nubus_rom_addr(slot); 907 + for (i = 4; i; i--) { 892 908 int card_present; 893 909 894 910 rp--; ··· 904 918 /* The last byte of the format block consists of two 905 919 nybbles which are "mirror images" of each other. 906 920 These show us the valid bytelanes */ 907 - if ((((dp>>4) ^ dp) & 0x0F) != 0x0F) 921 + if ((((dp >> 4) ^ dp) & 0x0F) != 0x0F) 908 922 continue; 909 923 /* Check that this value is actually *on* one of the 910 924 bytelanes it claims are valid! */ 911 - if ((dp & 0x0F) >= (1<<i)) 925 + if ((dp & 0x0F) >= (1 << i)) 912 926 continue; 913 927 914 928 /* Looks promising. Let's put it on the list. */ ··· 921 935 void __init nubus_scan_bus(void) 922 936 { 923 937 int slot; 938 + 924 939 /* This might not work on your machine */ 925 940 #ifdef I_WANT_TO_PROBE_SLOT_ZERO 926 941 nubus_probe_slot(0); 927 942 #endif 928 - for(slot = 9; slot < 15; slot++) 929 - { 943 + for (slot = 9; slot < 15; slot++) { 930 944 nubus_probe_slot(slot); 931 945 } 932 946 } 933 947 934 948 static int __init nubus_init(void) 935 949 { 936 - if (!MACH_IS_MAC) 950 + if (!MACH_IS_MAC) 937 951 return 0; 938 952 939 953 /* Initialize the NuBus interrupts */ ··· 949 963 gurus can fix the real cause of the problem. */ 950 964 mdelay(1000); 951 965 #endif 952 - 966 + 953 967 /* And probe */ 954 968 pr_info("NuBus: Scanning NuBus slots.\n"); 955 969 nubus_devices = NULL; 956 - nubus_boards = NULL; 970 + nubus_boards = NULL; 957 971 nubus_scan_bus(); 958 972 nubus_proc_init(); 959 973 return 0;