Removing the warnings after running static code analyser.

-Changes to fix all the clarifyCalulation warnings.
-Fixes a part of issue number 480
dev/timer
kushalsingh007 9 years ago
parent 0b8271a08a
commit 390e030f84

@ -371,13 +371,13 @@ static void pagefault_handler(uint8_t intr_num, struct x86_pushad *orig_ctx, uns
}
#endif
else if (error_code & PF_EC_P) {
printf("Page fault: access violation while %s present page.\n", error_code & PF_EC_W ? "writing to" : "reading from");
printf("Page fault: access violation while %s present page.\n", (error_code & PF_EC_W) ? "writing to" : "reading from");
x86_print_registers(orig_ctx, error_code);
puts("Halting.");
x86_hlt();
}
else {
printf("Page fault: access violation while %s non-present page.\n", error_code & PF_EC_W ? "writing to" : "reading from");
printf("Page fault: access violation while %s non-present page.\n", (error_code & PF_EC_W) ? "writing to" : "reading from");
x86_print_registers(orig_ctx, error_code);
puts("Halting.");
x86_hlt();

@ -149,7 +149,7 @@ static void pci_setup_ios(struct x86_known_pci_device *dev)
io->bar_num = bar_num;
++dev->io_count;
unsigned addr_offs = tmp_bar & PCI_BAR_IO_SPACE ? PCI_BAR_ADDR_OFFS_IO : PCI_BAR_ADDR_OFFS_MEM;
unsigned addr_offs = (tmp_bar & PCI_BAR_IO_SPACE) ? PCI_BAR_ADDR_OFFS_IO : PCI_BAR_ADDR_OFFS_MEM;
uint32_t length_tmp = tmp_bar >> addr_offs;
uint32_t length = 1 << addr_offs;
while ((length_tmp & 1) == 0) {

@ -98,10 +98,10 @@ static void rtc_irq_handler(uint8_t irq_num)
(void) irq_num; /* == PIC_NUM_RTC */
uint8_t c = x86_cmos_read(RTC_REG_C);
DEBUG("RTC: c = 0x%02x, IRQ=%u, A=%u, P=%u, U=%u\n", c, c & RTC_REG_C_IRQ ? 1 : 0,
c & RTC_REG_C_IRQ_ALARM ? 1 : 0,
c & RTC_REG_C_IRQ_PERIODIC ? 1 : 0,
c & RTC_REG_C_IRQ_UPDATE ? 1 : 0);
DEBUG("RTC: c = 0x%02x, IRQ=%u, A=%u, P=%u, U=%u\n", c, (c & RTC_REG_C_IRQ) ? 1 : 0,
(c & RTC_REG_C_IRQ_ALARM) ? 1 : 0,
(c & RTC_REG_C_IRQ_PERIODIC) ? 1 : 0,
(c & RTC_REG_C_IRQ_UPDATE) ? 1 : 0);
if (!(c & RTC_REG_C_IRQ)) {
return;
}

@ -157,7 +157,7 @@ double decode_float_half(unsigned char *halfp)
val = mant == 0 ? INFINITY : NAN;
}
return half & 0x8000 ? -val : val;
return (half & 0x8000) ? -val : val;
}
/**

Loading…
Cancel
Save