summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWolfgang Denk <wd@denx.de>2011-11-09 09:29:02 +0000
committerWolfgang Denk <wd@denx.de>2011-11-16 21:04:44 +0100
commit4ec6e4a88fbe4876f46f3c0dbc6292b4bb0530f0 (patch)
treeb144a6baf0556a2d3592b2ef960c30a757f00e5d
parent504f7080c33f2b39ac9528b00421f3da9096309b (diff)
downloadu-boot-imx-4ec6e4a88fbe4876f46f3c0dbc6292b4bb0530f0.zip
u-boot-imx-4ec6e4a88fbe4876f46f3c0dbc6292b4bb0530f0.tar.gz
u-boot-imx-4ec6e4a88fbe4876f46f3c0dbc6292b4bb0530f0.tar.bz2
common/cmd_fdc.c: Fix GCC 4.6 build warnings
Fix: cmd_fdc.c: In function 'fdc_read_data': cmd_fdc.c:435:6: warning: variable 'flags' set but not used [-Wunused-but-set-variable] cmd_fdc.c:432:16: warning: variable 'pcn' set but not used [-Wunused-but-set-variable] cmd_fdc.c:431:20: warning: variable 'lastblk' set but not used [-Wunused-but-set-variable] Note: no attempts were made to otherwise cleanup the code. Signed-off-by: Wolfgang Denk <wd@denx.de>
-rw-r--r--common/cmd_fdc.c29
1 files changed, 17 insertions, 12 deletions
diff --git a/common/cmd_fdc.c b/common/cmd_fdc.c
index 40d12f6..4fe410d 100644
--- a/common/cmd_fdc.c
+++ b/common/cmd_fdc.c
@@ -428,8 +428,8 @@ int fdc_terminate(FDC_COMMAND_STRUCT *pCMD)
int fdc_read_data(unsigned char *buffer, unsigned long blocks,FDC_COMMAND_STRUCT *pCMD, FD_GEO_STRUCT *pFG)
{
/* first seek to start address */
- unsigned long len,lastblk,readblk,i,timeout,ii,offset;
- unsigned char pcn,c,retriesrw,retriescal;
+ unsigned long len,readblk,i,timeout,ii,offset;
+ unsigned char c,retriesrw,retriescal;
unsigned char *bufferw; /* working buffer */
int sect_size;
int flags;
@@ -442,18 +442,19 @@ int fdc_read_data(unsigned char *buffer, unsigned long blocks,FDC_COMMAND_STRUCT
offset=0;
if(fdc_seek(pCMD,pFG)==FALSE) {
stop_fdc_drive(pCMD);
- enable_interrupts();
+ if (flags)
+ enable_interrupts();
return FALSE;
}
if((pCMD->result[STATUS_0]&0x20)!=0x20) {
printf("Seek error Status: %02X\n",pCMD->result[STATUS_0]);
stop_fdc_drive(pCMD);
- enable_interrupts();
+ if (flags)
+ enable_interrupts();
return FALSE;
}
- pcn=pCMD->result[STATUS_PCN]; /* current track */
/* now determine the next seek point */
- lastblk=pCMD->blnr + blocks;
+ /* lastblk=pCMD->blnr + blocks; */
/* readblk=(pFG->head*pFG->sect)-(pCMD->blnr%(pFG->head*pFG->sect)); */
readblk=pFG->sect-(pCMD->blnr%pFG->sect);
PRINTF("1st nr of block possible read %ld start %ld\n",readblk,pCMD->blnr);
@@ -467,7 +468,8 @@ retryrw:
pCMD->cmd[COMMAND]=FDC_CMD_READ;
if(fdc_issue_cmd(pCMD,pFG)==FALSE) {
stop_fdc_drive(pCMD);
- enable_interrupts();
+ if (flags)
+ enable_interrupts();
return FALSE;
}
for (i=0;i<len;i++) {
@@ -488,14 +490,16 @@ retryrw:
if(retriesrw++>FDC_RW_RETRIES) {
if (retriescal++>FDC_CAL_RETRIES) {
stop_fdc_drive(pCMD);
- enable_interrupts();
+ if (flags)
+ enable_interrupts();
return FALSE;
}
else {
PRINTF(" trying to recalibrate Try %d\n",retriescal);
if(fdc_recalibrate(pCMD,pFG)==FALSE) {
stop_fdc_drive(pCMD);
- enable_interrupts();
+ if (flags)
+ enable_interrupts();
return FALSE;
}
retriesrw=0;
@@ -528,7 +532,8 @@ retrycal:
/* a seek is necessary */
if(fdc_seek(pCMD,pFG)==FALSE) {
stop_fdc_drive(pCMD);
- enable_interrupts();
+ if (flags)
+ enable_interrupts();
return FALSE;
}
if((pCMD->result[STATUS_0]&0x20)!=0x20) {
@@ -536,10 +541,10 @@ retrycal:
stop_fdc_drive(pCMD);
return FALSE;
}
- pcn=pCMD->result[STATUS_PCN]; /* current track */
}while(TRUE); /* start over */
stop_fdc_drive(pCMD); /* switch off drive */
- enable_interrupts();
+ if (flags)
+ enable_interrupts();
return TRUE;
}