Re: [PATCH 2/6] Cast poniter type

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 7/19/2018 10:50 PM, Honggang LI wrote:
> From: Honggang Li <honli@xxxxxxxxxx>
> 
> make[2]: Entering directory '/home/honli/upstream-repos/opensm/libvendor'
> /bin/sh ../libtool  --tag=CC   --mode=compile gcc -DHAVE_CONFIG_H -I. -I../include -I../include/opensm  -I./../include -I./../../libibumad/include -I/usr/local/include  -Werror -Wall -Wwrite-strings -g -g -O2 -MT libosmvendor_la-osm_vendor_ibumad.lo -MD -MP -MF .deps/libosmvendor_la-osm_vendor_ibumad.Tpo -c -o libosmvendor_la-osm_vendor_ibumad.lo `test -f 'osm_vendor_ibumad.c' || echo './'`osm_vendor_ibumad.c
> libtool: compile:  gcc -DHAVE_CONFIG_H -I. -I../include -I../include/opensm -I./../include -I./../../libibumad/include -I/usr/local/include -Werror -Wall -Wwrite-strings -g -g -O2 -MT libosmvendor_la-osm_vendor_ibumad.lo -MD -MP -MF .deps/libosmvendor_la-osm_vendor_ibumad.Tpo -c osm_vendor_ibumad.c  -fPIC -DPIC -o .libs/libosmvendor_la-osm_vendor_ibumad.o
> osm_vendor_ibumad.c: In function ‘osm_vendor_open_port’:
> osm_vendor_ibumad.c:745:56: error: passing argument 2 of ‘umad_get_ca_portguids’ from incompatible pointer type [-Werror=incompatible-pointer-types]
>    if ((r = umad_get_ca_portguids(p_vend->ca_names[ca], portguids,
>                                                         ^~~~~~~~~
> In file included from ../include/vendor/osm_vendor_ibumad.h:44,
>                  from ../include/vendor/osm_vendor.h:65,
>                  from ../include/opensm/osm_madw.h:52,
>                  from osm_vendor_ibumad.c:66:
> /usr/include/infiniband/umad.h:178:56: note: expected ‘__be64 *’ {aka ‘long long unsigned int *’} but argument is of type ‘ib_net64_t *’ {aka ‘long unsigned int *’}
>  int umad_get_ca_portguids(const char *ca_name, __be64 *portguids, int max);
>                                                 ~~~~~~~~^~~~~~~~~
> cc1: all warnings being treated as errors

When libibumad was moved into rdma-core, the type of the portguids
parameter for the umad_get_ca_portguids API was changed from uint64_t to
__be64 and this was thought to be safe because it was thought that these
types were the same but that appears not to be the case here ;-(

On what CPU arch was this compiled ?

> Signed-off-by: Honggang Li <honli@xxxxxxxxxx>
> ---
>  libvendor/osm_vendor_ibumad.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/libvendor/osm_vendor_ibumad.c b/libvendor/osm_vendor_ibumad.c
> index 92696d3e6086..6a3665be81f6 100644
> --- a/libvendor/osm_vendor_ibumad.c
> +++ b/libvendor/osm_vendor_ibumad.c
> @@ -742,7 +742,7 @@ osm_vendor_open_port(IN osm_vendor_t * const p_vend,
>  	}
>  
>  	for (ca = 0; ca < p_vend->ca_count; ca++) {
> -		if ((r = umad_get_ca_portguids(p_vend->ca_names[ca], portguids,
> +		if ((r = umad_get_ca_portguids(p_vend->ca_names[ca], (__be64 *)portguids,

The above is fine for libibumads (umad.h) incorporated into rdma-core
but won't work with (older) libibumads (umad.h) prior to it's
incorporation into rdma-core. This seems to need some conditionalization
but I'm not sure what it would/could be conditionalized on as yet.

-- Hal

>  					       OSM_UMAD_MAX_PORTS_PER_CA + 1)) < 0) {
>  #ifdef __WIN__
>  			OSM_LOG(p_vend->p_log, OSM_LOG_VERBOSE,
> 
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Photo]     [Yosemite News]     [Yosemite Photos]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux