aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKelley Nielsen <kelleynnn@gmail.com>2013-10-29 11:07:40 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2013-10-29 11:36:17 -0400
commit74827f8dfa52103db66c32958f2844abbcec92c5 (patch)
treeb5768fa324ca9f8d87c6d762158c68181f74c95a
parenteb2ec63979702f04d45f608f635b0533defefa16 (diff)
staging: ft1000: style issues fixed in write_blk
function write_blk, in ft1000_download.c, contains many coding style issues. It has indentations of 3 spaces, long lines, C99 comments, and extra whitespace. It also has a return type of u32, and changing the returned variable in the function triggers a checkpatch leading spaces warning. Indentation should be fixed throughout the file for consistency. This patch fixes those issues, in preparation for correcting the status return type throughout the file. The variable Status has been changed from u32 to int and renamed status. Signed-off-by: Kelley Nielsen <kelleynnn@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--drivers/staging/ft1000/ft1000-usb/ft1000_download.c123
1 files changed, 57 insertions, 66 deletions
diff --git a/drivers/staging/ft1000/ft1000-usb/ft1000_download.c b/drivers/staging/ft1000/ft1000-usb/ft1000_download.c
index e5281b97775b..57bd87b91e3c 100644
--- a/drivers/staging/ft1000/ft1000-usb/ft1000_download.c
+++ b/drivers/staging/ft1000/ft1000-usb/ft1000_download.c
@@ -450,75 +450,66 @@ static int write_dpram32_and_check(struct ft1000_usb *ft1000dev,
450 * u8 **pUcFile - DSP image file pointer in u8 450 * u8 **pUcFile - DSP image file pointer in u8
451 * long word_length - length of the buffer to be written to DPRAM 451 * long word_length - length of the buffer to be written to DPRAM
452 */ 452 */
453static u32 write_blk (struct ft1000_usb *ft1000dev, u16 **pUsFile, u8 **pUcFile, long word_length) 453static int write_blk(struct ft1000_usb *ft1000dev, u16 **pUsFile, u8 **pUcFile,
454 long word_length)
454{ 455{
455 u32 Status = STATUS_SUCCESS; 456 int status = STATUS_SUCCESS;
456 u16 dpram; 457 u16 dpram;
457 int loopcnt, i; 458 int loopcnt, i;
458 u16 tempword; 459 u16 tempword;
459 u16 tempbuffer[64]; 460 u16 tempbuffer[64];
460 461
461 //DEBUG("FT1000:download:start word_length = %d\n",(int)word_length); 462 /*DEBUG("FT1000:download:start word_length = %d\n",(int)word_length); */
462 dpram = (u16)DWNLD_MAG1_PS_HDR_LOC; 463 dpram = (u16)DWNLD_MAG1_PS_HDR_LOC;
463 tempword = *(*pUsFile); 464 tempword = *(*pUsFile);
464 (*pUsFile)++; 465 (*pUsFile)++;
465 Status = ft1000_write_dpram16(ft1000dev, dpram, tempword, 0); 466 status = ft1000_write_dpram16(ft1000dev, dpram, tempword, 0);
466 tempword = *(*pUsFile); 467 tempword = *(*pUsFile);
467 (*pUsFile)++; 468 (*pUsFile)++;
468 Status = ft1000_write_dpram16(ft1000dev, dpram++, tempword, 1); 469 status = ft1000_write_dpram16(ft1000dev, dpram++, tempword, 1);
469 470
470 *pUcFile = *pUcFile + 4; 471 *pUcFile = *pUcFile + 4;
471 word_length--; 472 word_length--;
472 tempword = (u16)word_length; 473 tempword = (u16)word_length;
473 word_length = (word_length / 16) + 1; 474 word_length = (word_length / 16) + 1;
474 for (; word_length > 0; word_length--) /* In words */ 475 for (; word_length > 0; word_length--) { /* In words */
475 { 476 loopcnt = 0;
476 loopcnt = 0; 477 for (i = 0; i < 32; i++) {
477 478 if (tempword != 0) {
478 for (i=0; i<32; i++) 479 tempbuffer[i++] = *(*pUsFile);
479 { 480 (*pUsFile)++;
480 if (tempword != 0) 481 tempbuffer[i] = *(*pUsFile);
481 { 482 (*pUsFile)++;
482 tempbuffer[i++] = *(*pUsFile); 483 *pUcFile = *pUcFile + 4;
483 (*pUsFile)++; 484 loopcnt++;
484 tempbuffer[i] = *(*pUsFile); 485 tempword--;
485 (*pUsFile)++; 486 } else {
486 *pUcFile = *pUcFile + 4; 487 tempbuffer[i++] = 0;
487 loopcnt++; 488 tempbuffer[i] = 0;
488 tempword--; 489 }
489 }
490 else
491 {
492 tempbuffer[i++] = 0;
493 tempbuffer[i] = 0;
494 }
495 }
496
497 //DEBUG("write_blk: loopcnt is %d\n", loopcnt);
498 //DEBUG("write_blk: bootmode = %d\n", bootmode);
499 //DEBUG("write_blk: dpram = %x\n", dpram);
500 if (ft1000dev->bootmode == 0)
501 {
502 if (dpram >= 0x3F4)
503 Status = ft1000_write_dpram32 (ft1000dev, dpram, (u8 *)&tempbuffer[0], 8);
504 else
505 Status = ft1000_write_dpram32 (ft1000dev, dpram, (u8 *)&tempbuffer[0], 64);
506 }
507 else
508 {
509 Status = write_dpram32_and_check(ft1000dev, tempbuffer,
510 dpram);
511 if (Status != STATUS_SUCCESS)
512 {
513 DEBUG("FT1000:download:Write failed tempbuffer[31] = 0x%x\n", tempbuffer[31]);
514 break;
515 } 490 }
516 491
517 } 492 /*DEBUG("write_blk: loopcnt is %d\n", loopcnt); */
518 dpram = dpram + loopcnt; 493 /*DEBUG("write_blk: bootmode = %d\n", bootmode); */
519 } 494 /*DEBUG("write_blk: dpram = %x\n", dpram); */
520 495 if (ft1000dev->bootmode == 0) {
521 return Status; 496 if (dpram >= 0x3F4)
497 status = ft1000_write_dpram32(ft1000dev, dpram,
498 (u8 *)&tempbuffer[0], 8);
499 else
500 status = ft1000_write_dpram32(ft1000dev, dpram,
501 (u8 *)&tempbuffer[0], 64);
502 } else {
503 status = write_dpram32_and_check(ft1000dev, tempbuffer,
504 dpram);
505 if (status != STATUS_SUCCESS) {
506 DEBUG("FT1000:download:Write failed tempbuffer[31] = 0x%x\n", tempbuffer[31]);
507 break;
508 }
509 }
510 dpram = dpram + loopcnt;
511 }
512 return status;
522} 513}
523 514
524static void usb_dnld_complete (struct urb *urb) 515static void usb_dnld_complete (struct urb *urb)