[Skiboot] [PATCH 2/3] core/pci: Change capability data type to uint64_t

Stewart Smith stewart at linux.vnet.ibm.com
Fri Jun 16 15:16:08 AEST 2017


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?

-- 
Stewart Smith
OPAL Architect, IBM.



More information about the Skiboot mailing list