mirror of
https://github.com/Stichting-MINIX-Research-Foundation/u-boot.git
synced 2025-09-10 12:39:22 -04:00
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>
This commit is contained in:
parent
504f7080c3
commit
4ec6e4a88f
@ -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)
|
int fdc_read_data(unsigned char *buffer, unsigned long blocks,FDC_COMMAND_STRUCT *pCMD, FD_GEO_STRUCT *pFG)
|
||||||
{
|
{
|
||||||
/* first seek to start address */
|
/* first seek to start address */
|
||||||
unsigned long len,lastblk,readblk,i,timeout,ii,offset;
|
unsigned long len,readblk,i,timeout,ii,offset;
|
||||||
unsigned char pcn,c,retriesrw,retriescal;
|
unsigned char c,retriesrw,retriescal;
|
||||||
unsigned char *bufferw; /* working buffer */
|
unsigned char *bufferw; /* working buffer */
|
||||||
int sect_size;
|
int sect_size;
|
||||||
int flags;
|
int flags;
|
||||||
@ -442,18 +442,19 @@ int fdc_read_data(unsigned char *buffer, unsigned long blocks,FDC_COMMAND_STRUCT
|
|||||||
offset=0;
|
offset=0;
|
||||||
if(fdc_seek(pCMD,pFG)==FALSE) {
|
if(fdc_seek(pCMD,pFG)==FALSE) {
|
||||||
stop_fdc_drive(pCMD);
|
stop_fdc_drive(pCMD);
|
||||||
|
if (flags)
|
||||||
enable_interrupts();
|
enable_interrupts();
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
if((pCMD->result[STATUS_0]&0x20)!=0x20) {
|
if((pCMD->result[STATUS_0]&0x20)!=0x20) {
|
||||||
printf("Seek error Status: %02X\n",pCMD->result[STATUS_0]);
|
printf("Seek error Status: %02X\n",pCMD->result[STATUS_0]);
|
||||||
stop_fdc_drive(pCMD);
|
stop_fdc_drive(pCMD);
|
||||||
|
if (flags)
|
||||||
enable_interrupts();
|
enable_interrupts();
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
pcn=pCMD->result[STATUS_PCN]; /* current track */
|
|
||||||
/* now determine the next seek point */
|
/* 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->head*pFG->sect)-(pCMD->blnr%(pFG->head*pFG->sect)); */
|
||||||
readblk=pFG->sect-(pCMD->blnr%pFG->sect);
|
readblk=pFG->sect-(pCMD->blnr%pFG->sect);
|
||||||
PRINTF("1st nr of block possible read %ld start %ld\n",readblk,pCMD->blnr);
|
PRINTF("1st nr of block possible read %ld start %ld\n",readblk,pCMD->blnr);
|
||||||
@ -467,6 +468,7 @@ retryrw:
|
|||||||
pCMD->cmd[COMMAND]=FDC_CMD_READ;
|
pCMD->cmd[COMMAND]=FDC_CMD_READ;
|
||||||
if(fdc_issue_cmd(pCMD,pFG)==FALSE) {
|
if(fdc_issue_cmd(pCMD,pFG)==FALSE) {
|
||||||
stop_fdc_drive(pCMD);
|
stop_fdc_drive(pCMD);
|
||||||
|
if (flags)
|
||||||
enable_interrupts();
|
enable_interrupts();
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
@ -488,6 +490,7 @@ retryrw:
|
|||||||
if(retriesrw++>FDC_RW_RETRIES) {
|
if(retriesrw++>FDC_RW_RETRIES) {
|
||||||
if (retriescal++>FDC_CAL_RETRIES) {
|
if (retriescal++>FDC_CAL_RETRIES) {
|
||||||
stop_fdc_drive(pCMD);
|
stop_fdc_drive(pCMD);
|
||||||
|
if (flags)
|
||||||
enable_interrupts();
|
enable_interrupts();
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
@ -495,6 +498,7 @@ retryrw:
|
|||||||
PRINTF(" trying to recalibrate Try %d\n",retriescal);
|
PRINTF(" trying to recalibrate Try %d\n",retriescal);
|
||||||
if(fdc_recalibrate(pCMD,pFG)==FALSE) {
|
if(fdc_recalibrate(pCMD,pFG)==FALSE) {
|
||||||
stop_fdc_drive(pCMD);
|
stop_fdc_drive(pCMD);
|
||||||
|
if (flags)
|
||||||
enable_interrupts();
|
enable_interrupts();
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
@ -528,6 +532,7 @@ retrycal:
|
|||||||
/* a seek is necessary */
|
/* a seek is necessary */
|
||||||
if(fdc_seek(pCMD,pFG)==FALSE) {
|
if(fdc_seek(pCMD,pFG)==FALSE) {
|
||||||
stop_fdc_drive(pCMD);
|
stop_fdc_drive(pCMD);
|
||||||
|
if (flags)
|
||||||
enable_interrupts();
|
enable_interrupts();
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
@ -536,9 +541,9 @@ retrycal:
|
|||||||
stop_fdc_drive(pCMD);
|
stop_fdc_drive(pCMD);
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
pcn=pCMD->result[STATUS_PCN]; /* current track */
|
|
||||||
}while(TRUE); /* start over */
|
}while(TRUE); /* start over */
|
||||||
stop_fdc_drive(pCMD); /* switch off drive */
|
stop_fdc_drive(pCMD); /* switch off drive */
|
||||||
|
if (flags)
|
||||||
enable_interrupts();
|
enable_interrupts();
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user