]> git.sur5r.net Git - u-boot/commit
usb: gadget: sdp: fix pointer cast warnings for 64bit archs
authorAndre Heider <a.heider@gmail.com>
Thu, 15 Feb 2018 09:17:29 +0000 (10:17 +0100)
committerMarek Vasut <marex@denx.de>
Wed, 21 Feb 2018 19:28:15 +0000 (20:28 +0100)
commita64a614db70f1c758aea0a1620c4fcd49e037d47
tree32822dac227b7dd37df75a27ead5420e665d8124
parent24ccd0c8fd6285636edb94d0ece2cbcf062d64eb
usb: gadget: sdp: fix pointer cast warnings for 64bit archs

The SDP protocol contains multiple 32bit pointers. Add a helper function
to get a valid pointer from these values and use it.

This fixes the following warnings:

drivers/usb/gadget/f_sdp.c: In function ‘sdp_rx_data_complete’:
drivers/usb/gadget/f_sdp.c:347:10: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
   memcpy((void *)sdp->dnl_address, req->buf + 1, datalen);
          ^
drivers/usb/gadget/f_sdp.c: In function ‘sdp_jump_imxheader’:
drivers/usb/gadget/f_sdp.c:625:10: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
  entry = (void *)headerv2->entry;
          ^
drivers/usb/gadget/f_sdp.c: In function ‘sdp_handle_in_ep’:
drivers/usb/gadget/f_sdp.c:668:20: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
   memcpy(&data[1], (void *)sdp_func->dnl_address, datalen);
                    ^
drivers/usb/gadget/f_sdp.c:679:31: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
   status = sdp_jump_imxheader((void *)sdp_func->jmp_address);
                               ^

Signed-off-by: Andre Heider <a.heider@gmail.com>
drivers/usb/gadget/f_sdp.c