[SLOF] [PATCH v1 07/27] virtio: add virtio 1.0 capability parsing

Nikunj A Dadhania nikunj at linux.vnet.ibm.com
Thu Jan 14 21:55:01 AEDT 2016


Alexey Kardashevskiy <aik at ozlabs.ru> writes:

> On 01/13/2016 10:16 PM, Nikunj A Dadhania wrote:
>> Signed-off-by: Nikunj A Dadhania <nikunj at linux.vnet.ibm.com>
>
> Sorry for commenting the same patch twice...
>
>
>> +	if (dev->common.cap_id && dev->notify.cap_id && dev->isr.cap_id && dev->device.cap_id)
>> +		dev->is_modern = 1;
>
>
> Nit: please use curly braces in both branches if you used then in one of them.

Sure

>
>
>> +	else {
>> +		dev->is_modern = 0;
>> +		dev->legacy.cap_id = 0;
>> +		dev->legacy.bar = 0;
>> +		addr = SLOF_pci_config_read32(PCI_BASE_ADDR_REG_0);
>> +		if (addr & PCI_BASE_ADDR_SPACE_IO) {
>> +			dev->legacy.is_io = 1;
>> +			addr = addr & PCI_BASE_ADDR_IO_MASK;
>> +		} else {
>> +			dev->legacy.is_io = 0;
>> +			addr = addr & PCI_BASE_ADDR_MEM_MASK;
>> +		}
>> +		dev->legacy.addr = (void *)addr;
>> +	}
>> +	return;
>> +}
>>
>>   /**
>>    * Calculate ring size according to queue size number
>> diff --git a/lib/libvirtio/virtio.h b/lib/libvirtio/virtio.h
>> index 56e044b..eee3144 100644
>> --- a/lib/libvirtio/virtio.h
>> +++ b/lib/libvirtio/virtio.h
>> @@ -74,7 +74,7 @@ struct vring_used {
>>
>>   /* Structure shared with SLOF and is 16bytes */
>>   struct virtio_cap {
>> -	uint64_t addr;
>> +	void *addr;
>
>
> You just added @addr in 06/27 and already changing it in the next patch :)

Oops, while fixing warning put it here. :)

Regards
Nikunj



More information about the SLOF mailing list