fix compiler warnings

This commit is contained in:
Markus Fröschle
2016-10-04 06:39:12 +00:00
parent 4a7fcbccee
commit b89fdda6d7
15 changed files with 83 additions and 58 deletions

View File

@@ -43,7 +43,6 @@ CFLAGS= -Wall \
-ffreestanding \
-fleading-underscore \
-Winline \
-Wshadow \
-Wa,--register-prefix-optional \
-g2
CFLAGS_OPTIMIZED = -mcpu=5474 \

View File

@@ -164,11 +164,10 @@ int MCD_initDma (dmaRegs *dmaBarAddr, void *taskTableDest, u32 flags)
int taskTableSize, varTabsSize, funcDescTabsSize, contextSavesSize;
int taskDescTabSize;
int i;
/* check if physical address is aligned on 512 byte boundary */
if (((u32)taskTableDest & 0x000001ff) != 0)
return(MCD_TABLE_UNALIGNED);
if (((u32) taskTableDest & 0x000001ff) != 0)
return MCD_TABLE_UNALIGNED;
MCD_taskTable = taskTableDest; /* set up local pointer to task Table */
@@ -300,7 +299,7 @@ int MCD_initDma (dmaRegs *dmaBarAddr, void *taskTableDest, u32 flags)
else
MCD_dmaBar->ptdControl |= PTD_CTL_COMM_PREFETCH;
return(MCD_OK);
return MCD_OK;
}
/*********************** End of MCD_initDma() ***********************/
@@ -547,7 +546,7 @@ printf("startDma:Setting up params\n");
}
}
MCD_chStatus[channel] = MCD_IDLE;
return(MCD_OK);
return MCD_OK;
}
/************************ End of MCD_startDma() *********************/
@@ -694,7 +693,7 @@ int MCD_XferProgrQuery (int channel, MCD_XferProg *progRep)
default: break;
}
return(MCD_OK);
return MCD_OK;
}
/******************* End of MCD_XferProgrQuery() ********************/
@@ -753,7 +752,7 @@ int MCD_killDma (int channel)
* MCD_XferProgrQuery (channel, &progRep);
* progRep.currBufDesc->lastDestAddr = progRep.lastDestAddr;
*/
return(MCD_OK);
return MCD_OK;
}
/************************ End of MCD_killDma() **********************/
@@ -776,7 +775,7 @@ int MCD_continDma (int channel)
MCD_dmaBar->taskControl[channel] |= TASK_CTL_EN;
MCD_chStatus[channel] = MCD_RUNNING;
return(MCD_OK);
return MCD_OK;
}
/********************** End of MCD_continDma() **********************/
@@ -839,7 +838,7 @@ int MCD_pauseDma (int channel)
* progRep.currBufDesc->lastDestAddr = progRep.lastDestAddr;
*/
}
return(MCD_OK);
return MCD_OK;
}
/************************* End of MCD_pauseDma() ********************/
@@ -858,7 +857,7 @@ int MCD_resumeDma (int channel)
if (MCD_dmaBar->taskControl[channel] & TASK_CTL_EN)
MCD_resmActions (channel);
return(MCD_OK);
return MCD_OK;
}
/************************ End of MCD_resumeDma() ********************/
@@ -881,7 +880,7 @@ int MCD_csumQuery (int channel, u32 *csum)
*csum = MCD_relocBuffDesc[channel].csumResult;
return(MCD_OK);
#else
return(MCD_ERROR);
return MCD_ERROR;
#endif
}
/*********************** End of MCD_resumeDma() *********************/

View File

@@ -103,13 +103,13 @@ static uint32_t hex_to_long(uint8_t hex[8])
static uint8_t checksum(uint8_t arr[])
{
int i;
uint8_t checksum = SREC_COUNT(arr);
uint8_t csum = SREC_COUNT(arr);
for (i = 0; i < SREC_COUNT(arr) - 1; i++)
{
checksum += arr[i + 2];
csum += arr[i + 2];
}
return ~checksum;
return ~csum;
}
#ifdef _NOT_USED_

View File

@@ -489,8 +489,8 @@ extern void __OUTPLLP(struct radeonfb_info *rinfo, uint32_t index, uint32_t val,
#define INREG16(addr) swpw(*(uint16_t *)(rinfo->mmio_base + addr))
#define INREG(addr) swpl(*(uint32_t *)(rinfo->mmio_base + addr))
#define OUTREG8(addr, val) (*((uint8_t *)(rinfo->mmio_base + addr)) = val)
#define OUTREG16(addr, val) (*((uint16_t *)(rinfo->mmio_base + addr)) = swpw(val))
#define OUTREG(addr, val) (*((uint32_t *)(rinfo->mmio_base + addr)) = swpl(val))
#define OUTREG16(addr, val) (*((uint16_t *)(rinfo->mmio_base + addr)) = swpw((uint32_t) val))
#define OUTREG(addr, val) (*((uint32_t *)(rinfo->mmio_base + addr)) = swpl((uint32_t) val))
extern int32_t *tab_funcs_pci;
#define BIOS_IN8(v) (* ((uint8_t *) rinfo->bios_seg_phys + v))

View File

@@ -25,5 +25,8 @@ enum {
SET_FAILED = 0x88,
BUFFER_TOO_SMALL = 0x89
};
extern int x86_pcibios_handler(struct X86EMU *emu);
#endif /* PCI_BIOS_H */

View File

@@ -213,7 +213,18 @@ void ikbd_handle_input(unsigned char cmd)
}
}
void ikbd_poll(void) {
/*
* FIXME: temporarily provide function prototypes for unimplemented functions here to make compiler happy
*/
extern int GetTimer(int);
extern int CheckTimer(int);
extern void EnableIO(void);
extern void DisableIO(void);
extern int SPI(int);
void ikbd_poll(void)
{
static int mtimer = 0;
if (CheckTimer(mtimer))
{

View File

@@ -509,8 +509,8 @@ void radeon_setup_for_mono_8x8_pattern_fill_mmio(struct fb_info *info, int patte
OUT_ACCEL_REG(DP_BRUSH_BKGD_CLR, bg);
if (rinfo->big_endian)
{
OUT_ACCEL_REG(BRUSH_DATA0, *(unsigned long *) &pattern[0]);
OUT_ACCEL_REG(BRUSH_DATA1, *(unsigned long *) &pattern[4]);
OUT_ACCEL_REG(BRUSH_DATA0, &pattern[0]);
OUT_ACCEL_REG(BRUSH_DATA1, &pattern[4]);
}
else
{

View File

@@ -39,7 +39,7 @@ static struct fb_var_screeninfo radeonfb_default_var =
.vmode = FB_VMODE_NONINTERLACED
};
static char *radeon_get_mon_name(int type)
char *radeon_get_mon_name(int type)
{
char *pret = NULL;
switch(type)

View File

@@ -127,7 +127,8 @@ int dspi_set_baudrate(int rate)
pbr = baudrates[i].pbr_divisor;
/* TODO: set br and pbr here */
(void) pbr;
(void) br;
return set_baudrate;
}
@@ -162,7 +163,7 @@ uint8_t dspi_xchg_byte(int device, uint8_t byte, int last)
* buff: pointer to data buffer
* btr: number of bytes to receive (16, 64 or 512)
*/
static void dspi_rcv_byte_multi(int device, uint8_t *buff, uint32_t count)
void dspi_rcv_byte_multi(int device, uint8_t *buff, uint32_t count)
{
int i;
@@ -176,7 +177,7 @@ static void dspi_rcv_byte_multi(int device, uint8_t *buff, uint32_t count)
* buff: pointer to data
* btx: number of bytes to send
*/
static void dspi_xmt_byte_multi(int device, const uint8_t *buff, uint32_t btx)
void dspi_xmt_byte_multi(int device, const uint8_t *buff, uint32_t btx)
{
int i;

View File

@@ -531,7 +531,7 @@ void BaS(void)
xprintf("call FireTOS\r\n");
/* Jump into FireTOS */
typedef void void_func(void);
void_func* FireTOS = (void_func*) FIRETOS;
FireTOS(); // Should never return
}

View File

@@ -138,9 +138,9 @@ int usb_init(int32_t handle, const struct pci_device_id *ent)
{
if (controller_priv[i] != NULL)
{
long handle = controller_priv[i]->handle;
long hdl = controller_priv[i]->handle;
if (handle)
if (hdl)
{
res |= usb_init(handle, NULL); /* FIXME: recursive call!? */
}
@@ -1044,13 +1044,13 @@ struct usb_device *usb_get_dev_index(int index, int index_bus)
* returns a pointer of a new device structure or NULL, if
* no device struct is available
*/
struct usb_device *usb_alloc_new_device(int bus_index, void *priv)
struct usb_device *usb_alloc_new_device(int bus, void *priv)
{
int i;
int index = dev_index[bus_index];
int index = dev_index[bus];
struct usb_device *dev;
dbg("USB %d new device %d\r\n", bus_index, index);
dbg("USB %d new device %d\r\n", bus, index);
if (index >= USB_MAX_DEVICE)
{
dbg("ERROR, too many USB Devices, max=%d\r\n", USB_MAX_DEVICE);
@@ -1058,7 +1058,7 @@ struct usb_device *usb_alloc_new_device(int bus_index, void *priv)
}
/* default Address is 0, real addresses start with 1 */
dev = &usb_dev[(bus_index * USB_MAX_DEVICE) + index];
dev = &usb_dev[(bus * USB_MAX_DEVICE) + index];
dev->devnum = index + 1;
dev->maxchild = 0;
@@ -1067,8 +1067,8 @@ struct usb_device *usb_alloc_new_device(int bus_index, void *priv)
dev->parent = NULL;
dev->priv_hcd = priv;
dev->usbnum = bus_index;
dev_index[bus_index]++;
dev->usbnum = bus;
dev_index[bus]++;
return dev;
}

View File

@@ -84,9 +84,9 @@ int strcmp(const char *s1, const char *s2)
int strncmp(const char *s1, const char *s2, size_t max)
{
int i;
int cmp;
int cmp = 0;
for (i = 0; i < max && *s1++ && *s2++; i++);
for (i = 0; i < max && *s1++ && *s2++; i++)
{
cmp = (*s1 - *s2);
if (cmp != 0) return cmp;

View File

@@ -488,6 +488,12 @@ int fb_find_mode(struct fb_var_screeninfo *var,
dbg("fb_find_mode\r\n");
/*
* FIXME: temporarily use unused variables here to make compiler happy
*/
(void) yres_specified;
(void) bpp_specified;
/* Set up defaults */
if (!db)
{

View File

@@ -8,6 +8,7 @@
#include "x86emu_regs.h"
#include "pci.h"
#include "pci_ids.h"
#include "x86pcibios.h"
#define USE_SDRAM
#define DIRECT_ACCESS

View File

@@ -418,6 +418,7 @@ get_data_segment(struct X86EMU *emu)
return emu->x86.R_SS;
}
X86EMU_halt_sys(emu);
return 0L;
}
/****************************************************************************
PARAMETERS:
@@ -636,6 +637,7 @@ decode_rm_byte_register(struct X86EMU *emu, int reg)
default:
X86EMU_halt_sys(emu);
}
return 0L;
}
static uint8_t *
@@ -683,6 +685,7 @@ decode_rm_word_register(struct X86EMU *emu, int reg)
default:
X86EMU_halt_sys(emu);
}
return 0;
}
static uint16_t *
@@ -730,6 +733,7 @@ decode_rm_long_register(struct X86EMU *emu, int reg)
default:
X86EMU_halt_sys(emu);
}
return 0L;
}
static uint32_t *
@@ -775,6 +779,7 @@ decode_rh_seg_register(struct X86EMU *emu)
default:
X86EMU_halt_sys(emu);
}
return 0;
}
/*
*