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

USB: avoid needless address-taking of function parameters

There's no need to take the address of the function params or local variables
when the direct value byteswapping routines are available.

Signed-off-by: Harvey Harrison <harvey.harrison@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

authored by

Harvey Harrison and committed by
Greg Kroah-Hartman
da2bbdcc aa459e6a

+13 -13
+3 -3
drivers/net/usb/kaweth.c
··· 283 283 284 284 dr->bRequestType= requesttype; 285 285 dr->bRequest = request; 286 - dr->wValue = cpu_to_le16p(&value); 287 - dr->wIndex = cpu_to_le16p(&index); 288 - dr->wLength = cpu_to_le16p(&size); 286 + dr->wValue = cpu_to_le16(value); 287 + dr->wIndex = cpu_to_le16(index); 288 + dr->wLength = cpu_to_le16(size); 289 289 290 290 return kaweth_internal_control_msg(kaweth->dev, 291 291 pipe,
+6 -6
drivers/net/usb/pegasus.c
··· 150 150 pegasus->dr.bRequestType = PEGASUS_REQT_READ; 151 151 pegasus->dr.bRequest = PEGASUS_REQ_GET_REGS; 152 152 pegasus->dr.wValue = cpu_to_le16(0); 153 - pegasus->dr.wIndex = cpu_to_le16p(&indx); 154 - pegasus->dr.wLength = cpu_to_le16p(&size); 153 + pegasus->dr.wIndex = cpu_to_le16(indx); 154 + pegasus->dr.wLength = cpu_to_le16(size); 155 155 pegasus->ctrl_urb->transfer_buffer_length = size; 156 156 157 157 usb_fill_control_urb(pegasus->ctrl_urb, pegasus->usb, ··· 208 208 pegasus->dr.bRequestType = PEGASUS_REQT_WRITE; 209 209 pegasus->dr.bRequest = PEGASUS_REQ_SET_REGS; 210 210 pegasus->dr.wValue = cpu_to_le16(0); 211 - pegasus->dr.wIndex = cpu_to_le16p(&indx); 212 - pegasus->dr.wLength = cpu_to_le16p(&size); 211 + pegasus->dr.wIndex = cpu_to_le16(indx); 212 + pegasus->dr.wLength = cpu_to_le16(size); 213 213 pegasus->ctrl_urb->transfer_buffer_length = size; 214 214 215 215 usb_fill_control_urb(pegasus->ctrl_urb, pegasus->usb, ··· 261 261 pegasus->dr.bRequestType = PEGASUS_REQT_WRITE; 262 262 pegasus->dr.bRequest = PEGASUS_REQ_SET_REG; 263 263 pegasus->dr.wValue = cpu_to_le16(data); 264 - pegasus->dr.wIndex = cpu_to_le16p(&indx); 264 + pegasus->dr.wIndex = cpu_to_le16(indx); 265 265 pegasus->dr.wLength = cpu_to_le16(1); 266 266 pegasus->ctrl_urb->transfer_buffer_length = 1; 267 267 ··· 476 476 477 477 for (i = 0; i < 3; i++) { 478 478 read_eprom_word(pegasus, i, &w16); 479 - ((__le16 *) id)[i] = cpu_to_le16p(&w16); 479 + ((__le16 *) id)[i] = cpu_to_le16(w16); 480 480 } 481 481 } 482 482
+3 -3
drivers/usb/core/message.c
··· 139 139 140 140 dr->bRequestType = requesttype; 141 141 dr->bRequest = request; 142 - dr->wValue = cpu_to_le16p(&value); 143 - dr->wIndex = cpu_to_le16p(&index); 144 - dr->wLength = cpu_to_le16p(&size); 142 + dr->wValue = cpu_to_le16(value); 143 + dr->wIndex = cpu_to_le16(index); 144 + dr->wLength = cpu_to_le16(size); 145 145 146 146 /* dbg("usb_control_msg"); */ 147 147
+1 -1
drivers/usb/gadget/net2280.c
··· 669 669 670 670 /* 2280 may be polling VALID_BIT through ep->dma->dmadesc */ 671 671 wmb (); 672 - td->dmacount = cpu_to_le32p (&dmacount); 672 + td->dmacount = cpu_to_le32(dmacount); 673 673 } 674 674 675 675 static const u32 dmactl_default =