[Skiboot] [PATCH 2/3] core/pci: Change capability data type to uint64_t
Gavin Shan
gwshan at linux.vnet.ibm.com
Mon Jun 19 13:37:07 AEST 2017
On Fri, Jun 16, 2017 at 03:16:08PM +1000, Stewart Smith wrote:
>Gavin Shan <gwshan at linux.vnet.ibm.com> writes:
>> This changes the capability data type from "void *" to "uint64_t"
>> so that it can hold pointer and data at the same time. No logicial
>> changes.
>>
>> Signed-off-by: Gavin Shan <gwshan at linux.vnet.ibm.com>
>> ---
>> core/pci-iov.c | 2 +-
>> core/pci.c | 4 ++--
>> include/pci.h | 8 ++++----
>> 3 files changed, 7 insertions(+), 7 deletions(-)
>>
>> diff --git a/core/pci-iov.c b/core/pci-iov.c
>> index 14c810b..7b1d6dd 100644
>> --- a/core/pci-iov.c
>> +++ b/core/pci-iov.c
>> @@ -253,5 +253,5 @@ void pci_init_iov_cap(struct phb *phb, struct pci_device *pd)
>> iov->pos = pos;
>> iov->enabled = false;
>> pci_iov_update_parameters(iov);
>> - pci_set_cap(pd, PCIECAP_ID_SRIOV, pos, iov, true);
>> + pci_set_cap(pd, PCIECAP_ID_SRIOV, pos, (uint64_t)iov, true);
>
>I don't htink uint64_t is any better than void* for when it's being used
>as a pointer anyway.
>
>Is there a way to make this a bit clearer and more typesafe?
>
As Ben suggested, it's going to removed as it's used by SRIOV only.
The IOV struct will be associated with the PF directly.
Cheers,
Gavin
More information about the Skiboot
mailing list