Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

USB: mos7840: fix pointer casts

Silence compiler warnings on 64-bit systems introduced by commit
05cf0dec ("USB: mos7840: fix race in led handling") which uses the
usb-serial data pointer to temporarily store the device type during
probe but failed to add the required casts.

[gregkh - change uintptr_t to unsigned long]

Cc: stable@vger.kernel.org
Signed-off-by: Johan Hovold <jhovold@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Johan Hovold and committed by
Greg Kroah-Hartman
683a0e4d 05cf0dec

+3 -3
+3 -3
drivers/usb/serial/mos7840.c
··· 2221 2221 2222 2222 kfree(buf); 2223 2223 out: 2224 - usb_set_serial_data(serial, (void *)device_type); 2224 + usb_set_serial_data(serial, (void *)(unsigned long)device_type); 2225 2225 2226 2226 return 0; 2227 2227 } 2228 2228 2229 2229 static int mos7840_calc_num_ports(struct usb_serial *serial) 2230 2230 { 2231 - int device_type = (int)usb_get_serial_data(serial); 2231 + int device_type = (unsigned long)usb_get_serial_data(serial); 2232 2232 int mos7840_num_ports; 2233 2233 2234 2234 mos7840_num_ports = (device_type >> 4) & 0x000F; ··· 2239 2239 static int mos7840_port_probe(struct usb_serial_port *port) 2240 2240 { 2241 2241 struct usb_serial *serial = port->serial; 2242 - int device_type = (int)usb_get_serial_data(serial); 2242 + int device_type = (unsigned long)usb_get_serial_data(serial); 2243 2243 struct moschip_port *mos7840_port; 2244 2244 int status; 2245 2245 int pnum;