Elyes Haouas has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/69804 )
Change subject: src/device: Remove unnecessary space after casts ......................................................................
src/device: Remove unnecessary space after casts
Change-Id: I11593245fedc26489e3506d773aaff1ad34188b1 Signed-off-by: Elyes Haouas ehaouas@noos.fr --- M src/device/oprom/realmode/x86.c M src/device/oprom/x86emu/ops.c M src/device/oprom/x86emu/ops2.c M src/device/oprom/x86emu/prim_ops.c M src/device/oprom/x86emu/sys.c M src/device/oprom/yabel/biosemu.c M src/device/oprom/yabel/compat/functions.c M src/device/oprom/yabel/compat/of.h M src/device/oprom/yabel/device.c M src/device/oprom/yabel/device.h M src/device/oprom/yabel/interrupt.c M src/device/oprom/yabel/io.c M src/device/oprom/yabel/mem.c M src/device/oprom/yabel/pmm.c M src/device/oprom/yabel/vbe.c M src/device/pci_device.c M src/device/pci_rom.c 17 files changed, 205 insertions(+), 195 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/04/69804/1
diff --git a/src/device/oprom/realmode/x86.c b/src/device/oprom/realmode/x86.c index 7972011..5bfbcaa 100644 --- a/src/device/oprom/realmode/x86.c +++ b/src/device/oprom/realmode/x86.c @@ -168,14 +168,14 @@ static void write_idt_stub(void *target, u8 intnum) { unsigned char *codeptr; - codeptr = (unsigned char *) target; + codeptr = (unsigned char *)target; memcpy(codeptr, &__idt_handler, __idt_handler_size); codeptr[3] = intnum; /* modify int# in the code stub. */ }
static void setup_realmode_idt(void) { - struct realmode_idt *idts = (struct realmode_idt *) 0; + struct realmode_idt *idts = (struct realmode_idt *)0; int i;
/* Copy IDT stub code for each interrupt. This might seem wasteful diff --git a/src/device/oprom/x86emu/ops.c b/src/device/oprom/x86emu/ops.c index eeaa203..0f19f1e 100644 --- a/src/device/oprom/x86emu/ops.c +++ b/src/device/oprom/x86emu/ops.c @@ -1589,7 +1589,7 @@ u32 destval,imm;
destval = fetch_data_long(destoffset); - imm = (s8) fetch_byte_imm(); + imm = (s8)fetch_byte_imm(); DECODE_PRINTF2(",%x\n", imm); TRACE_AND_STEP(); destval = (*genop_long_operation[rh]) (destval, imm); @@ -1599,7 +1599,7 @@ u16 destval,imm;
destval = fetch_data_word(destoffset); - imm = (s8) fetch_byte_imm(); + imm = (s8)fetch_byte_imm(); DECODE_PRINTF2(",%x\n", imm); TRACE_AND_STEP(); destval = (*genop_word_operation[rh]) (destval, imm); @@ -1611,7 +1611,7 @@ u32 *destreg, imm;
destreg = DECODE_RM_LONG_REGISTER(rl); - imm = (s8) fetch_byte_imm(); + imm = (s8)fetch_byte_imm(); DECODE_PRINTF2(",%x\n", imm); TRACE_AND_STEP(); *destreg = (*genop_long_operation[rh]) (*destreg, imm); @@ -1619,7 +1619,7 @@ u16 *destreg, imm;
destreg = DECODE_RM_WORD_REGISTER(rl); - imm = (s8) fetch_byte_imm(); + imm = (s8)fetch_byte_imm(); DECODE_PRINTF2(",%x\n", imm); TRACE_AND_STEP(); *destreg = (*genop_word_operation[rh]) (*destreg, imm); @@ -3577,7 +3577,7 @@
START_OF_INSTR(); DECODE_PRINTF("INT 3\n"); - tmp = (u16) mem_access_word(3 * 4 + 2); + tmp = (u16)mem_access_word(3 * 4 + 2); /* access the segment register */ TRACE_AND_STEP(); if (_X86EMU_intrTab[3]) { @@ -4087,8 +4087,8 @@
START_OF_INSTR(); DECODE_PRINTF("LOOPNE\t"); - ip = (s8) fetch_byte_imm(); - ip += (s16) M.x86.R_IP; + ip = (s8)fetch_byte_imm(); + ip += (s16)M.x86.R_IP; DECODE_PRINTF2("%04x\n", ip); TRACE_AND_STEP(); if (M.x86.mode & SYSMODE_PREFIX_ADDR) @@ -4111,8 +4111,8 @@
START_OF_INSTR(); DECODE_PRINTF("LOOPE\t"); - ip = (s8) fetch_byte_imm(); - ip += (s16) M.x86.R_IP; + ip = (s8)fetch_byte_imm(); + ip += (s16)M.x86.R_IP; DECODE_PRINTF2("%04x\n", ip); TRACE_AND_STEP(); if (M.x86.mode & SYSMODE_PREFIX_ADDR) @@ -4135,8 +4135,8 @@
START_OF_INSTR(); DECODE_PRINTF("LOOP\t"); - ip = (s8) fetch_byte_imm(); - ip += (s16) M.x86.R_IP; + ip = (s8)fetch_byte_imm(); + ip += (s16)M.x86.R_IP; DECODE_PRINTF2("%04x\n", ip); TRACE_AND_STEP(); if (M.x86.mode & SYSMODE_PREFIX_ADDR) @@ -4183,7 +4183,7 @@
START_OF_INSTR(); DECODE_PRINTF("IN\t"); - port = (u8) fetch_byte_imm(); + port = (u8)fetch_byte_imm(); DECODE_PRINTF2("%x,AL\n", port); TRACE_AND_STEP(); M.x86.R_AL = (*sys_inb)(port); @@ -4201,7 +4201,7 @@
START_OF_INSTR(); DECODE_PRINTF("IN\t"); - port = (u8) fetch_byte_imm(); + port = (u8)fetch_byte_imm(); if (M.x86.mode & SYSMODE_PREFIX_DATA) { DECODE_PRINTF2("EAX,%x\n", port); } else { @@ -4227,7 +4227,7 @@
START_OF_INSTR(); DECODE_PRINTF("OUT\t"); - port = (u8) fetch_byte_imm(); + port = (u8)fetch_byte_imm(); DECODE_PRINTF2("%x,AL\n", port); TRACE_AND_STEP(); (*sys_outb)(port, M.x86.R_AL); @@ -4245,7 +4245,7 @@
START_OF_INSTR(); DECODE_PRINTF("OUT\t"); - port = (u8) fetch_byte_imm(); + port = (u8)fetch_byte_imm(); if (M.x86.mode & SYSMODE_PREFIX_DATA) { DECODE_PRINTF2("%x,EAX\n", port); } else { @@ -4273,13 +4273,13 @@ START_OF_INSTR(); DECODE_PRINTF("CALL\t"); if (M.x86.mode & SYSMODE_PREFIX_DATA) { - ip32 = (s32) fetch_long_imm(); - ip32 += (s16) M.x86.R_IP; /* CHECK SIGN */ + ip32 = (s32)fetch_long_imm(); + ip32 += (s16)M.x86.R_IP; /* CHECK SIGN */ DECODE_PRINTF2("%04x\n", (u16)ip32); CALL_TRACE(M.x86.saved_cs, M.x86.saved_ip, M.x86.R_CS, ip32, ""); } else { - ip16 = (s16) fetch_word_imm(); - ip16 += (s16) M.x86.R_IP; /* CHECK SIGN */ + ip16 = (s16)fetch_word_imm(); + ip16 += (s16)M.x86.R_IP; /* CHECK SIGN */ DECODE_PRINTF2("%04x\n", ip16); CALL_TRACE(M.x86.saved_cs, M.x86.saved_ip, M.x86.R_CS, ip16, ""); } @@ -5192,7 +5192,7 @@ destreg = DECODE_RM_WORD_REGISTER(rl); DECODE_PRINTF("\n"); TRACE_AND_STEP(); - M.x86.R_IP = (u16) (*destreg); + M.x86.R_IP = (u16)(*destreg); break; case 5: /* jmp far ptr ... */ DECODE_PRINTF("OPERATION UNDEFINED 0XFF\n"); diff --git a/src/device/oprom/x86emu/ops2.c b/src/device/oprom/x86emu/ops2.c index 6089b1f..76af341 100644 --- a/src/device/oprom/x86emu/ops2.c +++ b/src/device/oprom/x86emu/ops2.c @@ -290,8 +290,8 @@ /* conditional jump to word offset. */ START_OF_INSTR(); cond = x86emu_check_jump_condition(op2 & 0xF); - target = (s16) fetch_word_imm(); - target += (s16) M.x86.R_IP; + target = (s16)fetch_word_imm(); + target += (s16)M.x86.R_IP; DECODE_PRINTF2("%04x\n", target); TRACE_AND_STEP(); if (cond) { diff --git a/src/device/oprom/x86emu/prim_ops.c b/src/device/oprom/x86emu/prim_ops.c index 2350ac1..f5d5780 100644 --- a/src/device/oprom/x86emu/prim_ops.c +++ b/src/device/oprom/x86emu/prim_ops.c @@ -1203,7 +1203,7 @@ CONDITIONAL_SET_FLAG(cf, F_CF); set_szp_flags_8((u8)res); } else { - res = (u8) d; + res = (u8)d; }
if (cnt == 1) { @@ -1243,7 +1243,7 @@ CONDITIONAL_SET_FLAG(cf, F_CF); set_szp_flags_16((u16)res); } else { - res = (u16) d; + res = (u16)d; }
if (cnt == 1) { @@ -1316,7 +1316,7 @@ CONDITIONAL_SET_FLAG(cf, F_CF); set_szp_flags_8((u8)res); } else { - res = (u8) d; + res = (u8)d; }
if (cnt == 1) { @@ -2060,8 +2060,8 @@ x86emu_intr_raise(0); return; } - M.x86.R_AL = (s8) div; - M.x86.R_AH = (s8) mod; + M.x86.R_AL = (s8)div; + M.x86.R_AH = (s8)mod; }
/**************************************************************************** diff --git a/src/device/oprom/x86emu/sys.c b/src/device/oprom/x86emu/sys.c index 2f38ce5..28dbd44 100644 --- a/src/device/oprom/x86emu/sys.c +++ b/src/device/oprom/x86emu/sys.c @@ -71,7 +71,7 @@ //printf("%x:%x updating int vector 0x%x\n", // M.x86.R_CS, M.x86.R_IP, addr >> 2); } - retaddr = (u8 *) (M.mem_base + addr); + retaddr = (u8 *)(M.mem_base + addr);
return retaddr; } @@ -115,7 +115,7 @@ u8 *ptr;
ptr = mem_ptr(addr, 2); - val = *(u16 *) (ptr); + val = *(u16 *)(ptr);
DB(if (DEBUG_MEM_TRACE()) printf("%#08x 2 -> %#x\n", addr, val);) @@ -137,7 +137,7 @@ u8 *ptr;
ptr = mem_ptr(addr, 4); - val = *(u32 *) (ptr); + val = *(u32 *)(ptr);
DB(if (DEBUG_MEM_TRACE()) printf("%#08x 4 -> %#x\n", addr, val);) @@ -157,7 +157,7 @@ u8 *ptr;
ptr = mem_ptr(addr, 1); - *(u8 *) (ptr) = val; + *(u8 *)(ptr) = val;
DB(if (DEBUG_MEM_TRACE()) printf("%#08x 1 <- %#x\n", addr, val);) @@ -176,7 +176,7 @@ u8 *ptr;
ptr = mem_ptr(addr, 2); - *(u16 *) (ptr) = val; + *(u16 *)(ptr) = val;
DB(if (DEBUG_MEM_TRACE()) printf("%#08x 2 <- %#x\n", addr, val);) @@ -195,7 +195,7 @@ u8 *ptr;
ptr = mem_ptr(addr, 4); - *(u32 *) (ptr) = val; + *(u32 *)(ptr) = val;
DB(if (DEBUG_MEM_TRACE()) printf("%#08x 4 <- %#x\n", addr, val);) @@ -386,7 +386,7 @@ ****************************************************************************/ void X86EMU_prepareForInt(int num) { - push_word((u16) M.x86.R_FLG); + push_word((u16)M.x86.R_FLG); CLEAR_FLAG(F_IF); CLEAR_FLAG(F_TF); push_word(M.x86.R_CS); @@ -398,6 +398,6 @@
void X86EMU_setMemBase(void *base, size_t size) { - M.mem_base = (unsigned long) base; + M.mem_base = (unsigned long)base; M.mem_size = size; } diff --git a/src/device/oprom/yabel/biosemu.c b/src/device/oprom/yabel/biosemu.c index d0586c2..92add06 100644 --- a/src/device/oprom/yabel/biosemu.c +++ b/src/device/oprom/yabel/biosemu.c @@ -146,7 +146,7 @@ biosemu_add_special_memory(0, 0x500); // IVT + BDA biosemu_add_special_memory(OPTION_ROM_CODE_SEGMENT << 4, 0x10000); // option ROM
- rom_image = (u8 *) bios_device.img_addr; + rom_image = (u8 *)bios_device.img_addr; DEBUG_PRINTF("executing rom_image from %p\n", rom_image); DEBUG_PRINTF("biosmem at %p\n", biosmem);
@@ -163,8 +163,8 @@
X86EMU_setMemBase(biosmem, biosmem_size);
- DEBUG_PRINTF("membase set: %08x, size: %08x\n", (int) M.mem_base, - (int) M.mem_size); + DEBUG_PRINTF("membase set: %08x, size: %08x\n", (int)M.mem_base, + (int)M.mem_size);
// copy expansion ROM image to segment OPTION_ROM_CODE_SEGMENT // NOTE: this sometimes fails, some bytes are 0x00... so we compare diff --git a/src/device/oprom/yabel/compat/functions.c b/src/device/oprom/yabel/compat/functions.c index 5856597..f7d9d75 100644 --- a/src/device/oprom/yabel/compat/functions.c +++ b/src/device/oprom/yabel/compat/functions.c @@ -46,9 +46,9 @@
#if !CONFIG(YABEL_DIRECTHW) #if CONFIG_YABEL_VIRTMEM_LOCATION -u8* vmem = (u8 *) CONFIG_YABEL_VIRTMEM_LOCATION; +u8* vmem = (u8 *)CONFIG_YABEL_VIRTMEM_LOCATION; #else -u8* vmem = (u8 *) (16*1024*1024); /* default to 16MB */ +u8* vmem = (u8 *)(16*1024*1024); /* default to 16MB */ #endif #else u8* vmem = NULL; @@ -79,7 +79,7 @@ "rdtsc" : "=a"(eax), "=d"(edx) : /* no inputs, no clobber */); - act = ((u64) edx << 32) | eax; + act = ((u64)edx << 32) | eax; #endif return act; } diff --git a/src/device/oprom/yabel/compat/of.h b/src/device/oprom/yabel/compat/of.h index 8cec44f..c7d1aef 100644 --- a/src/device/oprom/yabel/compat/of.h +++ b/src/device/oprom/yabel/compat/of.h @@ -34,7 +34,7 @@ #ifndef OF_H #define OF_H #define p32 int -#define p32cast (int) (unsigned long) (void *) +#define p32cast (int)(unsigned long) (void *)
#define phandle_t p32 #define ihandle_t p32 diff --git a/src/device/oprom/yabel/device.c b/src/device/oprom/yabel/device.c index 2c98578..17dee99 100644 --- a/src/device/oprom/yabel/device.c +++ b/src/device/oprom/yabel/device.c @@ -315,8 +315,8 @@ bios_device.devfn, 0x0); #endif bios_device.pci_device_id = - (u16) ((pci_config_0 & 0xFFFF0000) >> 16); - bios_device.pci_vendor_id = (u16) (pci_config_0 & 0x0000FFFF); + (u16)((pci_config_0 & 0xFFFF0000) >> 16); + bios_device.pci_vendor_id = (u16)(pci_config_0 & 0x0000FFFF); DEBUG_PRINTF("PCI Device ID: %04x, PCI Vendor ID: %x\n", bios_device.pci_device_id, bios_device.pci_vendor_id); } @@ -354,27 +354,27 @@ return -1; } set_ci(); - u16 rom_signature = in16le((void *) rom_base_addr); + u16 rom_signature = in16le((void *)rom_base_addr); clr_ci(); if (rom_signature != 0xaa55) { printf ("Error: invalid Expansion ROM signature: %02x!\n", - *((u16 *) rom_base_addr)); + *((u16 *)rom_base_addr)); return -1; } set_ci(); // at offset 0x18 is the (16bit little-endian) pointer to the PCI Data Structure - pci_ds_offset = in16le((void *) (rom_base_addr + 0x18)); + pci_ds_offset = in16le((void *)(rom_base_addr + 0x18)); //copy the PCI Data Structure - memcpy(&pci_ds, (void *) (rom_base_addr + pci_ds_offset), + memcpy(&pci_ds, (void *)(rom_base_addr + pci_ds_offset), sizeof(pci_ds)); clr_ci(); #if CONFIG(X86EMU_DEBUG) DEBUG_PRINTF("PCI Data Structure @%lx:\n", rom_base_addr + pci_ds_offset); - dump((void *) &pci_ds, sizeof(pci_ds)); + dump((void *)&pci_ds, sizeof(pci_ds)); #endif - if (strncmp((const char *) pci_ds.signature, "PCIR", 4) != 0) { + if (strncmp((const char *)pci_ds.signature, "PCIR", 4) != 0) { printf("Invalid PCI Data Structure found!\n"); break; } diff --git a/src/device/oprom/yabel/device.h b/src/device/oprom/yabel/device.h index 37440a8..cf0e7a5 100644 --- a/src/device/oprom/yabel/device.h +++ b/src/device/oprom/yabel/device.h @@ -151,7 +151,7 @@ out32le(void *addr, u32 val) { #if ENV_X86 || ENV_ARM || ENV_ARM64 - *((u32*) addr) = cpu_to_le32(val); + *((u32*)addr) = cpu_to_le32(val); #else asm volatile ("stwbrx %0, 0, %1"::"r" (val), "r"(addr)); #endif @@ -162,7 +162,7 @@ { u32 val; #if ENV_X86 || ENV_ARM || ENV_ARM64 - val = cpu_to_le32(*((u32 *) addr)); + val = cpu_to_le32(*((u32 *)addr)); #else asm volatile ("lwbrx %0, 0, %1":"=r" (val):"r"(addr)); #endif @@ -173,7 +173,7 @@ out16le(void *addr, u16 val) { #if ENV_X86 || ENV_ARM || ENV_ARM64 - *((u16*) addr) = cpu_to_le16(val); + *((u16*)addr) = cpu_to_le16(val); #else asm volatile ("sthbrx %0, 0, %1"::"r" (val), "r"(addr)); #endif @@ -184,7 +184,7 @@ { u16 val; #if ENV_X86 || ENV_ARM || ENV_ARM64 - val = cpu_to_le16(*((u16*) addr)); + val = cpu_to_le16(*((u16*)addr)); #else asm volatile ("lhbrx %0, 0, %1":"=r" (val):"r"(addr)); #endif diff --git a/src/device/oprom/yabel/interrupt.c b/src/device/oprom/yabel/interrupt.c index 968e471..f78538d 100644 --- a/src/device/oprom/yabel/interrupt.c +++ b/src/device/oprom/yabel/interrupt.c @@ -55,7 +55,7 @@ DEBUG_PRINTF_INTR("%s(%x): executing interrupt handler @%08x\n", __func__, intNum, my_rdl(intNum * 4)); // push current R_FLG... will be popped by IRET - push_word((u16) M.x86.R_FLG); + push_word((u16)M.x86.R_FLG); CLEAR_FLAG(F_IF); CLEAR_FLAG(F_TF); // push current CS:IP to the stack, will be popped by IRET @@ -232,7 +232,7 @@ u8 char_code = 0; if (*keycode < 256) { scan_code = keycode_table[*keycode]; - char_code = (u8) * keycode & 0xff; + char_code = (u8)* keycode & 0xff; } else { switch (*keycode) { case 0x1b50: @@ -247,7 +247,7 @@ } } //assemble scan/char code in keycode - *keycode = (u64) ((((u16) scan_code) << 8) | char_code); + *keycode = (u64)((((u16) scan_code) << 8) | char_code); }
// handle int16 (Keyboard BIOS Interrupt) @@ -262,7 +262,7 @@ // we misuse the ring buffer, we use it as pointer to a u64 that stores // multi-byte keys (e.g. special keys in VT100 terminal) // and as long as a key is available (not 0) we don't read further keys - u64 *keycode = (u64 *) (M.mem_base + 0x41e); + u64 *keycode = (u64 *)(M.mem_base + 0x41e); s8 c; // function number in AH DEBUG_PRINTF_INTR("%s(): Keyboard Interrupt: function: %x.\n", @@ -273,7 +273,7 @@ case 0x00: // get keystroke if (*keycode) { - M.x86.R_AX = (u16) * keycode; + M.x86.R_AX = (u16)* keycode; // clear keycode *keycode = 0; } else { @@ -288,7 +288,7 @@ if (*keycode) { // already read, but not yet taken CLEAR_FLAG(F_ZF); - M.x86.R_AX = (u16) * keycode; + M.x86.R_AX = (u16)* keycode; } else { /* TODO: we need getchar... */ c = -1; //getchar(); @@ -318,7 +318,7 @@ SET_FLAG(F_ZF); } else { CLEAR_FLAG(F_ZF); - M.x86.R_AX = (u16) * keycode; + M.x86.R_AX = (u16)* keycode; //X86EMU_trace_on(); //M.x86.debug &= ~DEBUG_DECODE_NOPRINT_F; } @@ -430,7 +430,7 @@ #if CONFIG(PCI_OPTION_ROM_RUN_YABEL) pci_read_config8(dev, offs); #else - (u8) rtas_pci_config_read(bios_device.puid, 1, + (u8)rtas_pci_config_read(bios_device.puid, 1, bus, devfn, offs); #endif @@ -444,7 +444,7 @@ #if CONFIG(PCI_OPTION_ROM_RUN_YABEL) pci_read_config16(dev, offs); #else - (u16) rtas_pci_config_read(bios_device.puid, 2, + (u16)rtas_pci_config_read(bios_device.puid, 2, bus, devfn, offs); #endif @@ -458,7 +458,7 @@ #if CONFIG(PCI_OPTION_ROM_RUN_YABEL) pci_read_config32(dev, offs); #else - (u32) rtas_pci_config_read(bios_device.puid, 4, + (u32)rtas_pci_config_read(bios_device.puid, 4, bus, devfn, offs); #endif diff --git a/src/device/oprom/yabel/io.c b/src/device/oprom/yabel/io.c index 2a4e6f8..6577ee0 100644 --- a/src/device/oprom/yabel/io.c +++ b/src/device/oprom/yabel/io.c @@ -103,7 +103,7 @@ { unsigned int ret; /* since we are using inb instructions, we need the port number as 16bit value */ - u16 port = (u16)(uintptr_t) addr; + u16 port = (u16)(uintptr_t)addr;
switch (sz) { case 1: @@ -125,7 +125,7 @@ static int write_io(void *addr, unsigned int value, size_t sz) { - u16 port = (u16)(uintptr_t) addr; + u16 port = (u16)(uintptr_t)addr; switch (sz) { /* since we are using inb instructions, we need the port number as 16bit value */ case 1: @@ -177,7 +177,7 @@ case 0xCFE: case 0xCFF: // PCI Config Mechanism 1 Ports - return (u8) pci_cfg_read(addr, 1); + return (u8)pci_cfg_read(addr, 1); break; case 0x0a: CHECK_DBG(DEBUG_INTR) { @@ -189,7 +189,7 @@ DEBUG_PRINTF_IO ("%s(%04x) reading from bios_device.io_buffer\n", __func__, addr); - rval = *((u8 *) (bios_device.io_buffer + addr)); + rval = *((u8 *)(bios_device.io_buffer + addr)); DEBUG_PRINTF_IO("%s(%04x) I/O Buffer --> %02x\n", __func__, addr, rval); return rval; @@ -209,11 +209,11 @@ addr); //DEBUG_PRINTF_IO("%s(%04x): translated_addr: %llx\n", __func__, addr, translated_addr); u16 rval; - if ((translated_addr & (u64) 0x1) == 0) { + if ((translated_addr & (u64)0x1) == 0) { // 16 bit aligned access... u16 tempval = read_io((void *)translated_addr, 2); //little endian conversion - rval = in16le((void *) &tempval); + rval = in16le((void *)&tempval); } else { // unaligned access, read single bytes, little-endian rval = (read_io((void *)translated_addr, 1) << 8) @@ -227,14 +227,14 @@ case 0xCFC: case 0xCFE: //PCI Config Mechanism 1 - return (u16) pci_cfg_read(addr, 2); + return (u16)pci_cfg_read(addr, 2); break; default: DEBUG_PRINTF_IO ("%s(%04x) reading from bios_device.io_buffer\n", __func__, addr); u16 rval = - in16le((void *) bios_device.io_buffer + addr); + in16le((void *)bios_device.io_buffer + addr); DEBUG_PRINTF_IO("%s(%04x) I/O Buffer --> %04x\n", __func__, addr, rval); return rval; @@ -254,11 +254,11 @@ addr); //DEBUG_PRINTF_IO("%s(%04x): translated_addr: %llx\n", __func__, addr, translated_addr); u32 rval; - if ((translated_addr & (u64) 0x3) == 0) { + if ((translated_addr & (u64)0x3) == 0) { // 32 bit aligned access... - u32 tempval = read_io((void *) translated_addr, 4); + u32 tempval = read_io((void *)translated_addr, 4); //little endian conversion - rval = in32le((void *) &tempval); + rval = in32le((void *)&tempval); } else { // unaligned access, read single bytes, little-endian rval = (read_io((void *)(translated_addr), 1) << 24) @@ -280,7 +280,7 @@ ("%s(%04x) reading from bios_device.io_buffer\n", __func__, addr); u32 rval = - in32le((void *) bios_device.io_buffer + addr); + in32le((void *)bios_device.io_buffer + addr); DEBUG_PRINTF_IO("%s(%04x) I/O Buffer --> %08x\n", __func__, addr, rval); return rval; @@ -299,7 +299,7 @@ DEBUG_PRINTF_IO("%s(%x, %x): access to Device I/O\n", __func__, addr, val); //DEBUG_PRINTF_IO("%s(%04x): translated_addr: %llx\n", __func__, addr, translated_addr); - write_io((void *) translated_addr, val, 1); + write_io((void *)translated_addr, val, 1); DEBUG_PRINTF_IO("%s(%04x) Device I/O <-- %02x\n", __func__, addr, val); } else { @@ -315,7 +315,7 @@ DEBUG_PRINTF_IO ("%s(%04x,%02x) writing to bios_device.io_buffer\n", __func__, addr, val); - *((u8 *) (bios_device.io_buffer + addr)) = val; + *((u8 *)(bios_device.io_buffer + addr)) = val; break; } } @@ -331,17 +331,17 @@ DEBUG_PRINTF_IO("%s(%x, %x): access to Device I/O\n", __func__, addr, val); //DEBUG_PRINTF_IO("%s(%04x): translated_addr: %llx\n", __func__, addr, translated_addr); - if ((translated_addr & (u64) 0x1) == 0) { + if ((translated_addr & (u64)0x1) == 0) { // little-endian conversion - u16 tempval = in16le((void *) &val); + u16 tempval = in16le((void *)&val); // 16 bit aligned access... - write_io((void *) translated_addr, tempval, 2); + write_io((void *)translated_addr, tempval, 2); } else { // unaligned access, write single bytes, little-endian - write_io(((void *) (translated_addr + 1)), - (u8) ((val & 0xFF00) >> 8), 1); - write_io(((void *) translated_addr), - (u8) (val & 0x00FF), 1); + write_io(((void *)(translated_addr + 1)), + (u8)((val & 0xFF00) >> 8), 1); + write_io(((void *)translated_addr), + (u8)(val & 0x00FF), 1); } DEBUG_PRINTF_IO("%s(%04x) Device I/O <-- %04x\n", __func__, addr, val); @@ -356,7 +356,7 @@ DEBUG_PRINTF_IO ("%s(%04x,%04x) writing to bios_device.io_buffer\n", __func__, addr, val); - out16le((void *) bios_device.io_buffer + addr, val); + out16le((void *)bios_device.io_buffer + addr, val); break; } } @@ -372,21 +372,21 @@ DEBUG_PRINTF_IO("%s(%x, %x): access to Device I/O\n", __func__, addr, val); //DEBUG_PRINTF_IO("%s(%04x): translated_addr: %llx\n", __func__, addr, translated_addr); - if ((translated_addr & (u64) 0x3) == 0) { + if ((translated_addr & (u64)0x3) == 0) { // little-endian conversion - u32 tempval = in32le((void *) &val); + u32 tempval = in32le((void *)&val); // 32 bit aligned access... - write_io((void *) translated_addr, tempval, 4); + write_io((void *)translated_addr, tempval, 4); } else { // unaligned access, write single bytes, little-endian - write_io(((void *) translated_addr + 3), - (u8) ((val & 0xFF000000) >> 24), 1); - write_io(((void *) translated_addr + 2), - (u8) ((val & 0x00FF0000) >> 16), 1); - write_io(((void *) translated_addr + 1), - (u8) ((val & 0x0000FF00) >> 8), 1); - write_io(((void *) translated_addr), - (u8) (val & 0x000000FF), 1); + write_io(((void *)translated_addr + 3), + (u8)((val & 0xFF000000) >> 24), 1); + write_io(((void *)translated_addr + 2), + (u8)((val & 0x00FF0000) >> 16), 1); + write_io(((void *)translated_addr + 1), + (u8)((val & 0x0000FF00) >> 8), 1); + write_io(((void *)translated_addr), + (u8)(val & 0x000000FF), 1); } DEBUG_PRINTF_IO("%s(%04x) Device I/O <-- %08x\n", __func__, addr, val); @@ -400,7 +400,7 @@ DEBUG_PRINTF_IO ("%s(%04x,%08x) writing to bios_device.io_buffer\n", __func__, addr, val); - out32le((void *) bios_device.io_buffer + addr, val); + out32le((void *)bios_device.io_buffer + addr, val); break; } } @@ -462,7 +462,7 @@ break; } } else { - rval = (u32) rtas_pci_config_read(bios_device.puid, size, bus, devfn, offs); + rval = (u32)rtas_pci_config_read(bios_device.puid, size, bus, devfn, offs); }
DEBUG_PRINTF_IO @@ -545,9 +545,9 @@ nr_periods = time_diff / period_ticks; // if the number if ticks passed since last call is odd, we toggle bit 4 if ((nr_periods % 2) != 0) { - *((u8 *) (bios_device.io_buffer + 0x61)) ^= 0x10; + *((u8 *)(bios_device.io_buffer + 0x61)) ^= 0x10; } //finally read the value from the io_buffer - return *((u8 *) (bios_device.io_buffer + 0x61)); + return *((u8 *)(bios_device.io_buffer + 0x61)); } #endif diff --git a/src/device/oprom/yabel/mem.c b/src/device/oprom/yabel/mem.c index fa6959e..ae9f165 100644 --- a/src/device/oprom/yabel/mem.c +++ b/src/device/oprom/yabel/mem.c @@ -225,7 +225,7 @@ __func__, addr); //DEBUG_PRINTF_MEM("%s(%08x): translated_addr: %llx\n", __func__, addr, translated_addr); set_ci(); - rval = *((u8 *) translated_addr); + rval = *((u8 *)translated_addr); clr_ci(); DEBUG_PRINTF_MEM("%s(%08x) VGA --> %02x\n", __func__, addr, rval); @@ -237,7 +237,7 @@ HALT_SYS(); } else { /* read from virtual memory */ - rval = *((u8 *) (M.mem_base + addr)); + rval = *((u8 *)(M.mem_base + addr)); DEBUG_CHECK_VMEM_READ(addr, rval); return rval; } @@ -262,19 +262,19 @@ //read bytes a using my_rdb, because of the remapping to BARs //words may not be contiguous in memory, so we need to translate //every address... - rval = ((u8) my_rdb(addr)) | - (((u8) my_rdb(addr + 1)) << 8); + rval = ((u8)my_rdb(addr)) | + (((u8)my_rdb(addr + 1)) << 8); } else { - if ((translated_addr & (u64) 0x1) == 0) { + if ((translated_addr & (u64)0x1) == 0) { // 16 bit aligned access... set_ci(); - rval = in16le((void *) translated_addr); + rval = in16le((void *)translated_addr); clr_ci(); } else { // unaligned access, read single bytes set_ci(); - rval = (*((u8 *) translated_addr)) | - (*((u8 *) translated_addr + 1) << 8); + rval = (*((u8 *)translated_addr)) | + (*((u8 *)translated_addr + 1) << 8); clr_ci(); } } @@ -288,7 +288,7 @@ HALT_SYS(); } else { /* read from virtual memory */ - rval = in16le((void *) (M.mem_base + addr)); + rval = in16le((void *)(M.mem_base + addr)); DEBUG_CHECK_VMEM_READ(addr, rval); return rval; } @@ -313,23 +313,23 @@ //read bytes a using my_rdb, because of the remapping to BARs //dwords may not be contiguous in memory, so we need to translate //every address... - rval = ((u8) my_rdb(addr)) | - (((u8) my_rdb(addr + 1)) << 8) | - (((u8) my_rdb(addr + 2)) << 16) | - (((u8) my_rdb(addr + 3)) << 24); + rval = ((u8)my_rdb(addr)) | + (((u8)my_rdb(addr + 1)) << 8) | + (((u8)my_rdb(addr + 2)) << 16) | + (((u8)my_rdb(addr + 3)) << 24); } else { - if ((translated_addr & (u64) 0x3) == 0) { + if ((translated_addr & (u64)0x3) == 0) { // 32 bit aligned access... set_ci(); - rval = in32le((void *) translated_addr); + rval = in32le((void *)translated_addr); clr_ci(); } else { // unaligned access, read single bytes set_ci(); - rval = (*((u8 *) translated_addr)) | - (*((u8 *) translated_addr + 1) << 8) | - (*((u8 *) translated_addr + 2) << 16) | - (*((u8 *) translated_addr + 3) << 24); + rval = (*((u8 *)translated_addr)) | + (*((u8 *)translated_addr + 1) << 8) | + (*((u8 *)translated_addr + 2) << 16) | + (*((u8 *)translated_addr + 3) << 24); clr_ci(); } } @@ -344,12 +344,12 @@ HALT_SYS(); } else { /* read from virtual memory */ - rval = in32le((void *) (M.mem_base + addr)); + rval = in32le((void *)(M.mem_base + addr)); switch (addr) { case 0x46c: //BDA Time Data, update it, before reading update_time(rval); - rval = in32le((void *) (M.mem_base + addr)); + rval = in32le((void *)(M.mem_base + addr)); break; } DEBUG_CHECK_VMEM_READ(addr, rval); @@ -370,7 +370,7 @@ __func__, addr, val); //DEBUG_PRINTF_MEM("%s(%08x): translated_addr: %llx\n", __func__, addr, translated_addr); set_ci(); - *((u8 *) translated_addr) = val; + *((u8 *)translated_addr) = val; clr_ci(); } else if (addr > M.mem_size) { DEBUG_PRINTF("%s(%08x): Memory Access out of range!\n", @@ -380,7 +380,7 @@ } else { /* write to virtual memory */ DEBUG_CHECK_VMEM_WRITE(addr, val); - *((u8 *) (M.mem_base + addr)) = val; + *((u8 *)(M.mem_base + addr)) = val; } }
@@ -400,21 +400,21 @@ //read bytes a using my_rdb, because of the remapping to BARs //words may not be contiguous in memory, so we need to translate //every address... - my_wrb(addr, (u8) (val & 0x00FF)); - my_wrb(addr + 1, (u8) ((val & 0xFF00) >> 8)); + my_wrb(addr, (u8)(val & 0x00FF)); + my_wrb(addr + 1, (u8)((val & 0xFF00) >> 8)); } else { - if ((translated_addr & (u64) 0x1) == 0) { + if ((translated_addr & (u64)0x1) == 0) { // 16 bit aligned access... set_ci(); - out16le((void *) translated_addr, val); + out16le((void *)translated_addr, val); clr_ci(); } else { // unaligned access, write single bytes set_ci(); - *((u8 *) translated_addr) = - (u8) (val & 0x00FF); - *((u8 *) translated_addr + 1) = - (u8) ((val & 0xFF00) >> 8); + *((u8 *)translated_addr) = + (u8)(val & 0x00FF); + *((u8 *)translated_addr + 1) = + (u8)((val & 0xFF00) >> 8); clr_ci(); } } @@ -426,7 +426,7 @@ } else { /* write to virtual memory */ DEBUG_CHECK_VMEM_WRITE(addr, val); - out16le((void *) (M.mem_base + addr), val); + out16le((void *)(M.mem_base + addr), val); } } void @@ -445,27 +445,27 @@ //read bytes a using my_rdb, because of the remapping to BARs //words may not be contiguous in memory, so we need to translate //every address... - my_wrb(addr, (u8) (val & 0x000000FF)); - my_wrb(addr + 1, (u8) ((val & 0x0000FF00) >> 8)); - my_wrb(addr + 2, (u8) ((val & 0x00FF0000) >> 16)); - my_wrb(addr + 3, (u8) ((val & 0xFF000000) >> 24)); + my_wrb(addr, (u8)(val & 0x000000FF)); + my_wrb(addr + 1, (u8)((val & 0x0000FF00) >> 8)); + my_wrb(addr + 2, (u8)((val & 0x00FF0000) >> 16)); + my_wrb(addr + 3, (u8)((val & 0xFF000000) >> 24)); } else { - if ((translated_addr & (u64) 0x3) == 0) { + if ((translated_addr & (u64)0x3) == 0) { // 32 bit aligned access... set_ci(); - out32le((void *) translated_addr, val); + out32le((void *)translated_addr, val); clr_ci(); } else { // unaligned access, write single bytes set_ci(); - *((u8 *) translated_addr) = - (u8) (val & 0x000000FF); - *((u8 *) translated_addr + 1) = - (u8) ((val & 0x0000FF00) >> 8); - *((u8 *) translated_addr + 2) = - (u8) ((val & 0x00FF0000) >> 16); - *((u8 *) translated_addr + 3) = - (u8) ((val & 0xFF000000) >> 24); + *((u8 *)translated_addr) = + (u8)(val & 0x000000FF); + *((u8 *)translated_addr + 1) = + (u8)((val & 0x0000FF00) >> 8); + *((u8 *)translated_addr + 2) = + (u8)((val & 0x00FF0000) >> 16); + *((u8 *)translated_addr + 3) = + (u8)((val & 0xFF000000) >> 24); clr_ci(); } } @@ -477,7 +477,7 @@ } else { /* write to virtual memory */ DEBUG_CHECK_VMEM_WRITE(addr, val); - out32le((void *) (M.mem_base + addr), val); + out32le((void *)(M.mem_base + addr), val); } } #else diff --git a/src/device/oprom/yabel/pmm.c b/src/device/oprom/yabel/pmm.c index e30a86b..b24d4bc 100644 --- a/src/device/oprom/yabel/pmm.c +++ b/src/device/oprom/yabel/pmm.c @@ -65,7 +65,7 @@ { /* setup the PMM structure */ pmm_information_t *pis = - (pmm_information_t *) (M.mem_base + (((u32) segment) << 4) + + (pmm_information_t *)(M.mem_base + (((u32) segment) << 4) + offset); memset(pis, 0, sizeof(pmm_information_t)); /* set signature to $PMM */ @@ -86,14 +86,14 @@ * points to the code... it's that simple ;-) */ out32le(&(pis->entry_point_offset), - (u32) segment << 16 | (u32) (offset + pis->length)); + (u32)segment << 16 | (u32) (offset + pis->length)); /* checksum calculation */ u8 i; u8 checksum = 0; for (i = 0; i < pis->length; i++) { - checksum += *(((u8 *) pis) + i); + checksum += *(((u8 *)pis) + i); } - pis->checksum = ((u8) 0) - checksum; + pis->checksum = ((u8)0) - checksum; CHECK_DBG(DEBUG_PMM) { DEBUG_PRINTF_PMM("PMM Structure:\n"); dump((void *)pis, sizeof(pmm_information_t)); @@ -200,7 +200,7 @@ pmm_alloc->offset = next_offset; pmm_alloc->length = length; /* return the 32bit "physical" address, i.e. combination of segment and offset */ - rval = ((u32) (PMM_CONV_SEGMENT << 16)) | next_offset; + rval = ((u32)(PMM_CONV_SEGMENT << 16)) | next_offset; DEBUG_PRINTF_PMM ("%s: pmmAllocate: allocated memory at %x\n", __func__, rval); @@ -224,7 +224,7 @@ __func__, rval); /* return the 32bit "physical" address, i.e. combination of segment and offset */ rval = - ((u32) (PMM_CONV_SEGMENT << 16)) | + ((u32)(PMM_CONV_SEGMENT << 16)) | pmm_allocation_array[i].offset; } } @@ -240,7 +240,7 @@ /* since argument is the address of the PMM block (including the segment, * we need to remove the segment to get the offset */ - buffer = buffer ^ ((u32) PMM_CONV_SEGMENT << 16); + buffer = buffer ^ ((u32)PMM_CONV_SEGMENT << 16); DEBUG_PRINTF_PMM("%s: pmmDeallocate: PMM segment offset: %x\n", __func__, buffer); i = 0; @@ -292,8 +292,8 @@ exit: /* exit handler of this function, restore registers, put return value in DX:AX */ M.x86 = backup_regs; - M.x86.R_DX = (u16) ((rval >> 16) & 0xFFFF); - M.x86.R_AX = (u16) (rval & 0xFFFF); + M.x86.R_DX = (u16)((rval >> 16) & 0xFFFF); + M.x86.R_AX = (u16)(rval & 0xFFFF); CHECK_DBG(DEBUG_PMM) { DEBUG_PRINTF_PMM("%s: dump of pmm_allocation_array:\n", __func__); @@ -325,7 +325,7 @@ push_word(function); push_long(0); /* This is the return address for the ABI, unused in this implementation */ pmm_handleInt(); - addr = ((u32) M.x86.R_DX << 16) | M.x86.R_AX; + addr = ((u32)M.x86.R_DX << 16) | M.x86.R_AX; DEBUG_PRINTF_PMM("%s: allocated memory at: %04x:%04x\n", __func__, M.x86.R_DX, M.x86.R_AX); function = 1; /* pmmFind */ @@ -355,7 +355,7 @@ push_word(function); push_long(0); /* This is the return address for the ABI, unused in this implementation */ pmm_handleInt(); - addr = ((u32) M.x86.R_DX << 16) | M.x86.R_AX; + addr = ((u32)M.x86.R_DX << 16) | M.x86.R_AX; DEBUG_PRINTF_PMM("%s: allocated memory at: %04x:%04x\n", __func__, M.x86.R_DX, M.x86.R_AX); function = 0; /* pmmAllocate */ @@ -370,7 +370,7 @@ push_long(0); /* This is the return address for the ABI, unused in this implementation */ pmm_handleInt(); /* the address should be aligned to 0x800, so probably it is at offset 0x1800... */ - addr = ((u32) M.x86.R_DX << 16) | M.x86.R_AX; + addr = ((u32)M.x86.R_DX << 16) | M.x86.R_AX; DEBUG_PRINTF_PMM("%s: allocated memory at: %04x:%04x\n", __func__, M.x86.R_DX, M.x86.R_AX); function = 1; /* pmmFind */ @@ -378,7 +378,7 @@ push_word(function); push_long(0); /* This is the return address for the ABI, unused in this implementation */ pmm_handleInt(); - addr = ((u32) M.x86.R_DX << 16) | M.x86.R_AX; + addr = ((u32)M.x86.R_DX << 16) | M.x86.R_AX; function = 2; /* pmmDeallocate */ push_long(addr); push_word(function); @@ -393,7 +393,7 @@ push_word(function); push_long(0); /* This is the return address for the ABI, unused in this implementation */ pmm_handleInt(); - addr = ((u32) M.x86.R_DX << 16) | M.x86.R_AX; + addr = ((u32)M.x86.R_DX << 16) | M.x86.R_AX; function = 2; /* pmmDeallocate */ push_long(addr); push_word(function); @@ -414,7 +414,7 @@ push_word(function); push_long(0); /* This is the return address for the ABI, unused in this implementation */ pmm_handleInt(); - length = ((u32) M.x86.R_DX << 16) | M.x86.R_AX; + length = ((u32)M.x86.R_DX << 16) | M.x86.R_AX; length /= 16; /* length in paragraphs */ DEBUG_PRINTF_PMM("%s: largest possible length: %08x\n", __func__, length); @@ -427,7 +427,7 @@ push_word(function); push_long(0); /* This is the return address for the ABI, unused in this implementation */ pmm_handleInt(); - addr = ((u32) M.x86.R_DX << 16) | M.x86.R_AX; + addr = ((u32)M.x86.R_DX << 16) | M.x86.R_AX; DEBUG_PRINTF_PMM("%s: allocated memory at: %04x:%04x\n", __func__, M.x86.R_DX, M.x86.R_AX); function = 0; /* pmmAllocate */ @@ -442,7 +442,7 @@ push_long(0); /* This is the return address for the ABI, unused in this implementation */ pmm_handleInt(); /* this should fail, so 0x0 should be returned */ - addr = ((u32) M.x86.R_DX << 16) | M.x86.R_AX; + addr = ((u32)M.x86.R_DX << 16) | M.x86.R_AX; DEBUG_PRINTF_PMM ("%s: allocated memory at: %04x:%04x expected: 0000:0000\n", __func__, M.x86.R_DX, M.x86.R_AX); @@ -452,7 +452,7 @@ push_word(function); push_long(0); /* This is the return address for the ABI, unused in this implementation */ pmm_handleInt(); - addr = ((u32) M.x86.R_DX << 16) | M.x86.R_AX; + addr = ((u32)M.x86.R_DX << 16) | M.x86.R_AX; function = 2; /* pmmDeallocate */ push_long(addr); push_word(function); diff --git a/src/device/oprom/yabel/vbe.c b/src/device/oprom/yabel/vbe.c index 5f03e19..9ce284e 100644 --- a/src/device/oprom/yabel/vbe.c +++ b/src/device/oprom/yabel/vbe.c @@ -143,7 +143,7 @@ // offset 14: 32 bit le containing segment:offset of supported video mode table u16 *video_mode_ptr; video_mode_ptr = - (u16 *) (biosmem + + (u16 *)(biosmem + ((in16le(vbe_info_buffer + 16) << 4) + in16le(vbe_info_buffer + 14))); u32 i = 0; @@ -486,7 +486,7 @@ // byte[6] = monitor port number for DDC requests ("only" one byte... so lets hope we never have more than 255 monitors... // byte[7:8] = max. screen width (OF may want to limit this) // byte[9] = required color depth in bpp - if (strncmp((char *) input.signature, "DDC", 4) != 0) { + if (strncmp((char *)input.signature, "DDC", 4) != 0) { printf ("%s: Invalid input signature! expected: %s, is: %s\n", __func__, "DDC", input.signature); @@ -495,7 +495,7 @@ if (input.size_reserved != sizeof(screen_info_t)) { printf ("%s: Size of return struct is wrong, required: %d, available: %d\n", - __func__, (int) sizeof(screen_info_t), + __func__, (int)sizeof(screen_info_t), input.size_reserved); return -1; } @@ -648,9 +648,9 @@ (r * mc_size * mc_size) + (g * mc_size) + b; curr_color = 0; - curr_color |= ((u32) mixed_color_values[r]) << 16; //red value - curr_color |= ((u32) mixed_color_values[g]) << 8; //green value - curr_color |= (u32) mixed_color_values[b]; //blue value + curr_color |= ((u32)mixed_color_values[r]) << 16; //red value + curr_color |= ((u32)mixed_color_values[g]) << 8; //green value + curr_color |= (u32)mixed_color_values[b]; //blue value vbe_set_color(curr_color_index, curr_color); } @@ -661,21 +661,21 @@ // red for (r = 0; r < prim_size; r++) { curr_color_index = mc_size * mc_size * mc_size + r; - curr_color = ((u32) primary_color_values[r]) << 16; + curr_color = ((u32)primary_color_values[r]) << 16; vbe_set_color(curr_color_index, curr_color); } //green for (g = 0; g < prim_size; g++) { curr_color_index = mc_size * mc_size * mc_size + prim_size + g; - curr_color = ((u32) primary_color_values[g]) << 8; + curr_color = ((u32)primary_color_values[g]) << 8; vbe_set_color(curr_color_index, curr_color); } //blue for (b = 0; b < prim_size; b++) { curr_color_index = mc_size * mc_size * mc_size + prim_size * 2 + b; - curr_color = (u32) primary_color_values[b]; + curr_color = (u32)primary_color_values[b]; vbe_set_color(curr_color_index, curr_color); } // 10 shades of grey @@ -683,9 +683,9 @@ curr_color_index = mc_size * mc_size * mc_size + prim_size * 3 + i; curr_color = 0; - curr_color |= ((u32) primary_color_values[i]) << 16; //red - curr_color |= ((u32) primary_color_values[i]) << 8; //green - curr_color |= ((u32) primary_color_values[i]); //blue + curr_color |= ((u32)primary_color_values[i]) << 16; //red + curr_color |= ((u32)primary_color_values[i]) << 8; //green + curr_color |= ((u32)primary_color_values[i]); //blue vbe_set_color(curr_color_index, curr_color); }
diff --git a/src/device/pci_device.c b/src/device/pci_device.c index 8651586..9de2946 100644 --- a/src/device/pci_device.c +++ b/src/device/pci_device.c @@ -108,7 +108,7 @@ PCI_BASE_ADDRESS_MEM_LIMIT_64)) { /* Find the high bits that move. */ moving |= - ((resource_t) pci_moving_config32(dev, index + 4)) << 32; + ((resource_t)pci_moving_config32(dev, index + 4)) << 32; }
/* Find the resource constraints. @@ -496,13 +496,13 @@ resource_t moving_base, moving_limit, moving;
/* See if the bridge I/O resources are implemented. */ - moving_base = ((u32) pci_moving_config8(dev, PCI_IO_BASE)) << 8; + moving_base = ((u32)pci_moving_config8(dev, PCI_IO_BASE)) << 8; moving_base |= - ((u32) pci_moving_config16(dev, PCI_IO_BASE_UPPER16)) << 16; + ((u32)pci_moving_config16(dev, PCI_IO_BASE_UPPER16)) << 16;
- moving_limit = ((u32) pci_moving_config8(dev, PCI_IO_LIMIT)) << 8; + moving_limit = ((u32)pci_moving_config8(dev, PCI_IO_LIMIT)) << 8; moving_limit |= - ((u32) pci_moving_config16(dev, PCI_IO_LIMIT_UPPER16)) << 16; + ((u32)pci_moving_config16(dev, PCI_IO_LIMIT_UPPER16)) << 16;
moving = moving_base & moving_limit;
@@ -511,14 +511,14 @@
/* See if the bridge prefmem resources are implemented. */ moving_base = - ((resource_t) pci_moving_config16(dev, PCI_PREF_MEMORY_BASE)) << 16; + ((resource_t)pci_moving_config16(dev, PCI_PREF_MEMORY_BASE)) << 16; moving_base |= - ((resource_t) pci_moving_config32(dev, PCI_PREF_BASE_UPPER32)) << 32; + ((resource_t)pci_moving_config32(dev, PCI_PREF_BASE_UPPER32)) << 32;
moving_limit = - ((resource_t) pci_moving_config16(dev, PCI_PREF_MEMORY_LIMIT)) << 16; + ((resource_t)pci_moving_config16(dev, PCI_PREF_MEMORY_LIMIT)) << 16; moving_limit |= - ((resource_t) pci_moving_config32(dev, PCI_PREF_LIMIT_UPPER32)) << 32; + ((resource_t)pci_moving_config32(dev, PCI_PREF_LIMIT_UPPER32)) << 32;
moving = moving_base & moving_limit; /* Initialize the prefetchable memory constraints on the current bus. */ @@ -526,8 +526,8 @@ IORESOURCE_MEM | IORESOURCE_PREFETCH);
/* See if the bridge mem resources are implemented. */ - moving_base = ((u32) pci_moving_config16(dev, PCI_MEMORY_BASE)) << 16; - moving_limit = ((u32) pci_moving_config16(dev, PCI_MEMORY_LIMIT)) << 16; + moving_base = ((u32)pci_moving_config16(dev, PCI_MEMORY_BASE)) << 16; + moving_limit = ((u32)pci_moving_config16(dev, PCI_MEMORY_LIMIT)) << 16;
moving = moving_base & moving_limit;
diff --git a/src/device/pci_rom.c b/src/device/pci_rom.c index b8dafd1..8480626 100644 --- a/src/device/pci_rom.c +++ b/src/device/pci_rom.c @@ -159,10 +159,10 @@
do { /* Get next image. */ - rom_header = (struct rom_header *)((void *) rom_header + rom_header = (struct rom_header *)((void *)rom_header + image_size);
- rom_data = (struct pci_data *)((void *) rom_header + rom_data = (struct pci_data *)((void *)rom_header + le32_to_cpu(rom_header->data));
image_size = le32_to_cpu(rom_data->ilen) * 512; @@ -190,7 +190,7 @@ memcpy((void *)PCI_VGA_RAM_IMAGE_START, rom_header, rom_size); } - return (struct rom_header *) (PCI_VGA_RAM_IMAGE_START); + return (struct rom_header *)(PCI_VGA_RAM_IMAGE_START); }
printk(BIOS_DEBUG, "Copying non-VGA ROM image from %p to %p, 0x%x bytes\n", @@ -198,7 +198,7 @@
memcpy(pci_ram_image_start, rom_header, rom_size); pci_ram_image_start += rom_size; - return (struct rom_header *) (pci_ram_image_start-rom_size); + return (struct rom_header *)(pci_ram_image_start-rom_size); }
/* ACPI */