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

staging: dgap: Fix trailing whitespace in downld.c

This patch fix "ERROR: trailing whitespace found by
checkpatch.pl, whithin downld.c

Signed-off-by: Masanari Iida <standby24x7@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Masanari Iida and committed by
Greg Kroah-Hartman
ebca68f6 7e4290c6

+84 -84
+84 -84
drivers/staging/dgap/downld.c
··· 24 24 ** 25 25 ** This is the daemon that sends the fep, bios, and concentrator images 26 26 ** from user space to the driver. 27 - ** BUGS: 27 + ** BUGS: 28 28 ** If the file changes in the middle of the download, you probably 29 29 ** will get what you deserve. 30 30 ** ··· 121 121 122 122 123 123 /* 124 - * The same for either the FEP or the BIOS. 124 + * The same for either the FEP or the BIOS. 125 125 * Append the downldio header, issue the ioctl, then free 126 126 * the buffer. Not horribly CPU efficient, but quite RAM efficient. 127 127 */ ··· 136 136 /* 137 137 * If this binary comes from a file, stat it to see how 138 138 * large it is. Yes, we intentionally do this each 139 - * time for the binary may change between loads. 139 + * time for the binary may change between loads. 140 140 */ 141 141 142 142 if (ii->pathname) { ··· 144 144 145 145 if (sfd < 0 ) { 146 146 myperror(ii->pathname); 147 - goto squirt_end; 147 + goto squirt_end; 148 148 } 149 149 150 150 if (fstat(sfd, &sb) == -1 ) { ··· 152 152 goto squirt_end; 153 153 } 154 154 155 - ii->len = sb.st_size ; 155 + ii->len = sb.st_size; 156 156 } 157 157 158 158 size_buf = ii->len + sizeof(struct downldio); ··· 165 165 dliop = (struct downldio *) malloc(size_buf); 166 166 167 167 if (dliop == NULL) { 168 - fprintf(stderr,"%s: can't get %d bytes of memory; aborting\n", 168 + fprintf(stderr,"%s: can't get %d bytes of memory; aborting\n", 169 169 pgm, size_buf); 170 170 exit (1); 171 171 } ··· 185 185 186 186 if (debugflag) 187 187 printf("sending %d bytes of %s %s from %s\n", 188 - ii->len, 188 + ii->len, 189 189 (ii->type == IFEP) ? "FEP" : (ii->type == IBIOS) ? "BIOS" : "CONFIG", 190 190 ii->name ? ii->name : "", 191 191 (ii->pathname) ? ii->pathname : "internal image" ); ··· 209 209 210 210 211 211 /* 212 - * See if we need to reload the download image in core 213 - * 212 + * See if we need to reload the download image in core 213 + * 214 214 */ 215 215 void consider_file_rescan(struct image_info *ii) 216 216 { 217 - int sfd ; 218 - int len ; 217 + int sfd; 218 + int len; 219 219 struct stat sb; 220 220 221 221 /* This operation only makes sense when we're working from a file */ ··· 232 232 myperror(ii->pathname); 233 233 exit(1); 234 234 } 235 - 236 - /* If the file hasn't changed since we last did this, 237 - * and we have not done a free() on the image, bail 235 + 236 + /* If the file hasn't changed since we last did this, 237 + * and we have not done a free() on the image, bail 238 238 */ 239 239 if (ii->image && (sb.st_mtime == ii->mtime)) 240 240 goto end_rescan; 241 241 242 - ii->len = len = sb.st_size ; 242 + ii->len = len = sb.st_size; 243 243 244 244 /* Record the timestamp of the file */ 245 245 ii->mtime = sb.st_mtime; ··· 249 249 * have a memory leak. 250 250 */ 251 251 if ( ii->image ) { 252 - free( ii->image ); 252 + free( ii->image ); 253 253 /* ii->image = NULL; */ /* not necessary */ 254 254 } 255 255 256 - /* This image will be kept only long enough for the 257 - * download to happen. After sending the last block, 256 + /* This image will be kept only long enough for the 257 + * download to happen. After sending the last block, 258 258 * it will be freed 259 259 */ 260 260 ii->image = malloc(len) ; ··· 267 267 } 268 268 269 269 if (read(sfd, ii->image, len) < len) { 270 - fprintf(stderr,"%s: read error on %s; aborting\n", 270 + fprintf(stderr,"%s: read error on %s; aborting\n", 271 271 pgm, ii->pathname); 272 272 exit (1); 273 273 } 274 274 275 275 end_rescan: 276 276 close(sfd); 277 - 277 + 278 278 } 279 279 } 280 280 ··· 284 284 285 285 struct image_info * find_conc_image() 286 286 { 287 - int x ; 288 - struct image_info *i = NULL ; 287 + int x; 288 + struct image_info *i = NULL; 289 289 290 290 for ( x = 0; x < nimages; x++ ) { 291 291 i=&image_list[x]; 292 - 292 + 293 293 if(i->type != ICONC) 294 294 continue; 295 295 ··· 305 305 */ 306 306 if ((dp->dl_type != 'P' ) && ( ip->dl_srev == dp->dl_srev )) 307 307 return i; 308 - } 309 - return NULL ; 308 + } 309 + return NULL; 310 310 } 311 311 312 312 ··· 378 378 ** the list before built in images so that the command line images 379 379 ** can override the built in ones. 380 380 */ 381 - 381 + 382 382 /* allocate space for the list */ 383 383 384 384 nimages = argc - 2; ··· 390 390 nimages += count; 391 391 392 392 /* Really should just remove the variable "image_list".... robertl */ 393 - image_list = images ; 394 - 393 + image_list = images; 394 + 395 395 /* get the images from the command line */ 396 396 for(x = 2; x < argc; x++) { 397 - int xx; 397 + int xx; 398 398 399 399 /* 400 - * strip off any leading path information for 401 - * determining file type 400 + * strip off any leading path information for 401 + * determining file type 402 402 */ 403 403 if( (fname = strrchr(argv[x],'/')) == NULL) 404 404 fname = argv[x]; ··· 406 406 fname++; /* skip the slash */ 407 407 408 408 for (xx = 0; xx < count; xx++) { 409 - if (strcmp(fname, images[xx].fname) == 0 ) { 409 + if (strcmp(fname, images[xx].fname) == 0 ) { 410 410 images[xx].pathname = argv[x]; 411 411 412 412 /* image should be NULL until */ 413 413 /* space is malloced */ 414 - images[xx].image = NULL ; 414 + images[xx].image = NULL; 415 415 } 416 416 } 417 417 } 418 418 419 419 sleep(3); 420 - 420 + 421 421 /* 422 422 ** Endless loop: get a request from the fep, and service that request. 423 423 */ ··· 425 425 /* get the request */ 426 426 if (debugflag) 427 427 printf("b4 get ioctl..."); 428 - 428 + 429 429 if (ioctl(fd,DIGI_DLREQ_GET, &dlio) == -1 ) { 430 430 if (errorprint) { 431 431 fprintf(stderr, ··· 438 438 if (debugflag) 439 439 printf("dlio.req_type is %d bd %d\n", 440 440 dlio.req_type,dlio.bdid); 441 - 441 + 442 442 switch(dlio.req_type) { 443 443 case DLREQ_BIOS: 444 444 /* ··· 447 447 for ( x = 0; x < nimages; x++ ) { 448 448 if(image_list[x].type != IBIOS) 449 449 continue; 450 - 451 - if ((dlio.image.fi.type & FAMILY) == 450 + 451 + if ((dlio.image.fi.type & FAMILY) == 452 452 image_list[x].family) { 453 - 454 - if ( image_list[x].family == T_CX ) { 455 - if ((dlio.image.fi.type & BUSTYPE) 453 + 454 + if ( image_list[x].family == T_CX ) { 455 + if ((dlio.image.fi.type & BUSTYPE) 456 456 == T_PCIBUS ) { 457 - if ( image_list[x].subtype 457 + if ( image_list[x].subtype 458 458 == T_PCIBUS ) 459 459 break; 460 460 } 461 - else { 461 + else { 462 462 break; 463 463 } 464 464 } ··· 466 466 /* If subtype of image is T_PCIBUS, it is */ 467 467 /* a PCI EPC image, so the board must */ 468 468 /* have bus type T_PCIBUS to match */ 469 - if ((dlio.image.fi.type & BUSTYPE) 469 + if ((dlio.image.fi.type & BUSTYPE) 470 470 == T_PCIBUS ) { 471 - if ( image_list[x].subtype 471 + if ( image_list[x].subtype 472 472 == T_PCIBUS ) 473 473 break; 474 474 } 475 - else { 475 + else { 476 476 /* NON PCI EPC doesn't use PCI image */ 477 - if ( image_list[x].subtype 477 + if ( image_list[x].subtype 478 478 != T_PCIBUS ) 479 479 break; 480 480 } ··· 484 484 } 485 485 else if ((dlio.image.fi.type & SUBTYPE) == image_list[x].subtype) { 486 486 /* PCXR board will break out of the loop here */ 487 - if ( image_list[x].subtype == T_PCXR ) { 487 + if ( image_list[x].subtype == T_PCXR ) { 488 488 break; 489 489 } 490 490 } 491 491 } 492 - 492 + 493 493 if ( x >= nimages) { 494 494 /* 495 495 ** no valid images exist ··· 514 514 } 515 515 squirt(dlio.req_type, dlio.bdid, &image_list[x]); 516 516 break ; 517 - 517 + 518 518 case DLREQ_FEP: 519 519 /* 520 520 ** find the fep image for this type ··· 522 522 for ( x = 0; x < nimages; x++ ) { 523 523 if(image_list[x].type != IFEP) 524 524 continue; 525 - if( (dlio.image.fi.type & FAMILY) == 525 + if( (dlio.image.fi.type & FAMILY) == 526 526 image_list[x].family ) { 527 - if ( image_list[x].family == T_CX ) { 527 + if ( image_list[x].family == T_CX ) { 528 528 /* C/X PCI board */ 529 - if ((dlio.image.fi.type & BUSTYPE) 529 + if ((dlio.image.fi.type & BUSTYPE) 530 530 == T_PCIBUS ) { 531 531 if ( image_list[x].subtype 532 532 == T_PCIBUS ) 533 533 break; 534 534 } 535 - else { 535 + else { 536 536 /* Regular CX */ 537 537 break; 538 538 } ··· 541 541 /* If subtype of image is T_PCIBUS, it is */ 542 542 /* a PCI EPC image, so the board must */ 543 543 /* have bus type T_PCIBUS to match */ 544 - if ((dlio.image.fi.type & BUSTYPE) 544 + if ((dlio.image.fi.type & BUSTYPE) 545 545 == T_PCIBUS ) { 546 - if ( image_list[x].subtype 546 + if ( image_list[x].subtype 547 547 == T_PCIBUS ) 548 548 break; 549 549 } 550 - else { 550 + else { 551 551 /* NON PCI EPC doesn't use PCI image */ 552 - if ( image_list[x].subtype 552 + if ( image_list[x].subtype 553 553 != T_PCIBUS ) 554 554 break; 555 555 } ··· 559 559 } 560 560 else if ((dlio.image.fi.type & SUBTYPE) == image_list[x].subtype) { 561 561 /* PCXR board will break out of the loop here */ 562 - if ( image_list[x].subtype == T_PCXR ) { 562 + if ( image_list[x].subtype == T_PCXR ) { 563 563 break; 564 564 } 565 565 } 566 566 } 567 - 567 + 568 568 if ( x >= nimages) { 569 569 /* 570 570 ** no valid images exist ··· 613 613 } 614 614 615 615 break; 616 - 616 + 617 617 case DLREQ_CONFIG: 618 618 for ( x = 0; x < nimages; x++ ) { 619 619 if(image_list[x].type != ICONFIG) ··· 658 658 */ 659 659 for ( x = 0; x < nimages; x++ ) { 660 660 ii=&image_list[x]; 661 - 661 + 662 662 if(image_list[x].type != ICONC) 663 663 continue; 664 - 664 + 665 665 consider_file_rescan(ii) ; 666 - 666 + 667 667 ip = (struct downld_t *) image_list[x].image; 668 668 if (ip == NULL) continue; 669 - 669 + 670 670 /* 671 671 * When I removed Clusterport, I kept only the 672 672 * code that I was SURE wasn't ClusterPort. ··· 674 674 */ 675 675 676 676 if ((dp->dl_type != 'P' ) && 677 - (ip->dl_lrev <= dp->dl_lrev ) && 677 + (ip->dl_lrev <= dp->dl_lrev ) && 678 678 ( dp->dl_lrev <= ip->dl_hrev)) 679 679 break; 680 680 } 681 - 681 + 682 682 if ( x >= nimages ) { 683 683 /* 684 684 ** No valid images exist ··· 691 691 } 692 692 continue; 693 693 } 694 - 694 + 695 695 } else { 696 696 /* 697 697 ** find image version required ··· 706 706 continue; 707 707 } 708 708 } 709 - 709 + 710 710 /* 711 711 ** download block of image 712 712 */ 713 - 713 + 714 714 offset = 1024 * dp->dl_seq; 715 - 715 + 716 716 /* 717 717 ** test if block requested within image 718 718 */ 719 - if ( offset < ii->len ) { 720 - 719 + if ( offset < ii->len ) { 720 + 721 721 /* 722 722 ** if it is, determine block size, set segment, 723 723 ** set size, set pointers, and copy block 724 724 */ 725 725 if (( bsize = ii->len - offset ) > 1024 ) 726 726 bsize = 1024; 727 - 727 + 728 728 /* 729 729 ** copy image version info to download area 730 730 */ 731 731 dp->dl_srev = ip->dl_srev; 732 732 dp->dl_lrev = ip->dl_lrev; 733 733 dp->dl_hrev = ip->dl_hrev; 734 - 734 + 735 735 dp->dl_seg = (64 * dp->dl_seq) + ip->dl_seg; 736 736 dp->dl_size = bsize; 737 - 737 + 738 738 down = (char *)&dp->dl_data[0]; 739 739 image = (char *)((char *)ip + offset); 740 - 740 + 741 741 memcpy(down, image, bsize); 742 - } 742 + } 743 743 else { 744 744 /* 745 745 ** Image has been downloaded, set segment and ··· 747 747 */ 748 748 dp->dl_seg = ip->dl_seg; 749 749 dp->dl_size = 0; 750 - 750 + 751 751 /* Now, we can release the concentrator */ 752 752 /* image from memory if we're running */ 753 753 /* from filesystem images */ 754 - 754 + 755 755 if (ii->pathname) 756 756 if (ii->image) { 757 757 free(ii->image); 758 - ii->image = NULL ; 759 - } 758 + ii->image = NULL; 759 + } 760 760 } 761 - 761 + 762 762 if (debugflag) 763 763 printf( 764 764 "sending conc dl section %d to %s from %s\n", 765 765 dp->dl_seq, ii->name, 766 766 ii->pathname ? ii->pathname : "Internal Image"); 767 - 767 + 768 768 if (ioctl(fd, DIGI_DLREQ_SET, &dlio) == -1 ) { 769 769 if (errorprint) { 770 770 fprintf(stderr,