Reported by dcb314.
This fixes #128, #129, #130, #131, #132, #133.
Change-Id: I284d6dd87fba7c5775bea22d04412d685a2ab027
}
/* Allocate memory for headers and status */
- if ((r = virtio_blk_alloc_requests() != OK)) {
+ if ((r = virtio_blk_alloc_requests()) != OK) {
virtio_free_queues(blk_dev);
virtio_free_device(blk_dev);
return r;
cpu = m_ptr->m_lsys_krn_schedctl.cpu;
/* Try to schedule the process. */
- if((r = sched_proc(p, priority, quantum, cpu, FALSE) != OK))
+ if((r = sched_proc(p, priority, quantum, cpu, FALSE)) != OK)
return r;
p->p_scheduler = NULL;
} else {
memset(dev->queues, 0, num_queues * sizeof(dev->queues[0]));
- if ((r = init_phys_queues(dev) != OK)) {
+ if ((r = init_phys_queues(dev)) != OK) {
printf("%s: Could not initialize queues (%d)\n", dev->name, r);
free(dev->queues);
dev->queues = NULL;
virtio_irq_enable(struct virtio_device *dev)
{
int r;
- if ((r = sys_irqenable(&dev->irq_hook) != OK))
+ if ((r = sys_irqenable(&dev->irq_hook)) != OK)
panic("%s Unable to enable IRQ %d", dev->name, r);
}
virtio_irq_disable(struct virtio_device *dev)
{
int r;
- if ((r = sys_irqdisable(&dev->irq_hook) != OK))
+ if ((r = sys_irqdisable(&dev->irq_hook)) != OK)
panic("%s: Unable to disable IRQ %d", dev->name, r);
}
virtio_irq_register(struct virtio_device *dev)
{
int r;
- if ((r = sys_irqsetpolicy(dev->irq, 0, &dev->irq_hook) != OK))
+ if ((r = sys_irqsetpolicy(dev->irq, 0, &dev->irq_hook)) != OK)
panic("%s: Unable to register IRQ %d", dev->name, r);
}
virtio_irq_unregister(struct virtio_device *dev)
{
int r;
- if ((r = sys_irqrmpolicy(&dev->irq_hook) != OK))
+ if ((r = sys_irqrmpolicy(&dev->irq_hook)) != OK)
panic("%s: Unable to unregister IRQ %d", dev->name, r);
}
return ret;
}
- if ((ret = nic->netif.linkoutput(&nic->netif, pbuf) != ERR_OK)) {
+ if ((ret = nic->netif.linkoutput(&nic->netif, pbuf)) != ERR_OK) {
debug_print("raw linkoutput failed %d", ret);
ret = EIO;
} else
return ENOMEM;
debug_tcp_print("new tcp pcb %p\n", pcb);
- if ((ret = tcp_fill_new_socket(sock, pcb) != OK))
+ if ((ret = tcp_fill_new_socket(sock, pcb)) != OK)
tcp_abandon(pcb, 0);
return ret;
if (mkdir("nosearch", 0777) != 0) e(1000);
if ( (i = creat("nosearch/file", 0666)) < 0) e(1001);
if (close(i) < 0) e(1002);
- if ( (i = creat("file", 0666) < 0)) e(1003);
+ if ( (i = creat("file", 0666)) < 0) e(1003);
if (close(i) < 0) e(1004);
if (chmod("nosearch/file", 05777) < 0) e(1005);
if (chmod("file", 05777) < 0) e(1006);
/* Test ToLongName and ToLongPath */
does_truncate = does_fs_truncate();
if (does_truncate) {
- if ((fd = creat(ToLongName, 0777)) != 0) e(18);
+ if ((fd = creat(ToLongName, 0777)) == -1) e(18);
if (close(fd) != 0) e(19);
if (access(ToLongName, F_OK) != 0) e(20);
} else {