> + } else {
> + struct vring_list *p_sg = &sg[1];
Not needed, you can just use sg[1].addr
> + void *p = op->buf_fl;
> + u16 count = op->count;
> +
> + while (count > blk_num_max) {
while (count > 0) {
u16 blk_num = min(count, blk_num_max);
> + } else {
> + break;
> + }
> + }
> +
> + if (status != VIRTIO_BLK_S_OK)
> + return DISK_RET_EBADTRACK;
Can be moved into the while loop, you don't need the break then.
> + if (count > 0) {
> + p_sg->addr = p;
> + p_sg->length = vdrive->drive.blksize * count;
> + virtio_blk_op_one_segment(vdrive, write, sg);
> + }
Not needed with the change above.
take care,
Gerd
_______________________________________________
SeaBIOS mailing list -- [email protected]
To unsubscribe send an email to [email protected]