Skip to content

Commit 5db539e

Browse files
Olav Kongasgregkh
authored andcommitted
[PATCH] USB: Fix kmalloc's flags type in USB
Greg, This patch fixes the kmalloc() flags argument type in USB subsystem; hopefully all of its occurences. The patch was made against patch-2.6.12-git2 from Jun 20. Cleanup of flags for kmalloc() in USB subsystem. Signed-off-by: Olav Kongas <ok@artecdesign.ee> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
1 parent 17f8bb7 commit 5db539e

26 files changed

Lines changed: 81 additions & 75 deletions

‎drivers/usb/core/buffer.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ void hcd_buffer_destroy (struct usb_hcd *hcd)
106106
void *hcd_buffer_alloc (
107107
struct usb_bus *bus,
108108
size_t size,
109-
int mem_flags,
109+
unsigned mem_flags,
110110
dma_addr_t *dma
111111
)
112112
{

‎drivers/usb/core/hcd.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1112,7 +1112,7 @@ static void urb_unlink (struct urb *urb)
11121112
* expects usb_submit_urb() to have sanity checked and conditioned all
11131113
* inputs in the urb
11141114
*/
1115-
static int hcd_submit_urb (struct urb *urb, int mem_flags)
1115+
static int hcd_submit_urb (struct urb *urb, unsigned mem_flags)
11161116
{
11171117
int status;
11181118
struct usb_hcd *hcd = urb->dev->bus->hcpriv;

‎drivers/usb/core/hcd.h‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -142,12 +142,12 @@ struct hcd_timeout { /* timeouts we allocate */
142142

143143
struct usb_operations {
144144
int (*get_frame_number) (struct usb_device *usb_dev);
145-
int (*submit_urb) (struct urb *urb, int mem_flags);
145+
int (*submit_urb) (struct urb *urb, unsigned mem_flags);
146146
int (*unlink_urb) (struct urb *urb, int status);
147147

148148
/* allocate dma-consistent buffer for URB_DMA_NOMAPPING */
149149
void *(*buffer_alloc)(struct usb_bus *bus, size_t size,
150-
int mem_flags,
150+
unsigned mem_flags,
151151
dma_addr_t *dma);
152152
void (*buffer_free)(struct usb_bus *bus, size_t size,
153153
void *addr, dma_addr_t dma);
@@ -200,7 +200,7 @@ struct hc_driver {
200200
int (*urb_enqueue) (struct usb_hcd *hcd,
201201
struct usb_host_endpoint *ep,
202202
struct urb *urb,
203-
int mem_flags);
203+
unsigned mem_flags);
204204
int (*urb_dequeue) (struct usb_hcd *hcd, struct urb *urb);
205205

206206
/* hw synch, freeing endpoint resources that urb_dequeue can't */
@@ -247,7 +247,7 @@ int hcd_buffer_create (struct usb_hcd *hcd);
247247
void hcd_buffer_destroy (struct usb_hcd *hcd);
248248

249249
void *hcd_buffer_alloc (struct usb_bus *bus, size_t size,
250-
int mem_flags, dma_addr_t *dma);
250+
unsigned mem_flags, dma_addr_t *dma);
251251
void hcd_buffer_free (struct usb_bus *bus, size_t size,
252252
void *addr, dma_addr_t dma);
253253

‎drivers/usb/core/message.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -320,7 +320,7 @@ int usb_sg_init (
320320
struct scatterlist *sg,
321321
int nents,
322322
size_t length,
323-
int mem_flags
323+
unsigned mem_flags
324324
)
325325
{
326326
int i;

‎drivers/usb/core/urb.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ void usb_init_urb(struct urb *urb)
6060
*
6161
* The driver must call usb_free_urb() when it is finished with the urb.
6262
*/
63-
struct urb *usb_alloc_urb(int iso_packets, int mem_flags)
63+
struct urb *usb_alloc_urb(int iso_packets, unsigned mem_flags)
6464
{
6565
struct urb *urb;
6666

@@ -224,7 +224,7 @@ struct urb * usb_get_urb(struct urb *urb)
224224
* GFP_NOIO, unless b) or c) apply
225225
*
226226
*/
227-
int usb_submit_urb(struct urb *urb, int mem_flags)
227+
int usb_submit_urb(struct urb *urb, unsigned mem_flags)
228228
{
229229
int pipe, temp, max;
230230
struct usb_device *dev;

‎drivers/usb/core/usb.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1129,7 +1129,7 @@ int __usb_get_extra_descriptor(char *buffer, unsigned size,
11291129
void *usb_buffer_alloc (
11301130
struct usb_device *dev,
11311131
size_t size,
1132-
int mem_flags,
1132+
unsigned mem_flags,
11331133
dma_addr_t *dma
11341134
)
11351135
{

‎drivers/usb/gadget/dummy_hcd.c‎

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -470,7 +470,7 @@ static int dummy_disable (struct usb_ep *_ep)
470470
}
471471

472472
static struct usb_request *
473-
dummy_alloc_request (struct usb_ep *_ep, int mem_flags)
473+
dummy_alloc_request (struct usb_ep *_ep, unsigned mem_flags)
474474
{
475475
struct dummy_ep *ep;
476476
struct dummy_request *req;
@@ -507,7 +507,7 @@ dummy_alloc_buffer (
507507
struct usb_ep *_ep,
508508
unsigned bytes,
509509
dma_addr_t *dma,
510-
int mem_flags
510+
unsigned mem_flags
511511
) {
512512
char *retval;
513513
struct dummy_ep *ep;
@@ -540,7 +540,8 @@ fifo_complete (struct usb_ep *ep, struct usb_request *req)
540540
}
541541

542542
static int
543-
dummy_queue (struct usb_ep *_ep, struct usb_request *_req, int mem_flags)
543+
dummy_queue (struct usb_ep *_ep, struct usb_request *_req,
544+
unsigned mem_flags)
544545
{
545546
struct dummy_ep *ep;
546547
struct dummy_request *req;
@@ -998,7 +999,7 @@ static int dummy_urb_enqueue (
998999
struct usb_hcd *hcd,
9991000
struct usb_host_endpoint *ep,
10001001
struct urb *urb,
1001-
int mem_flags
1002+
unsigned mem_flags
10021003
) {
10031004
struct dummy *dum;
10041005
struct urbp *urbp;

‎drivers/usb/gadget/ether.c‎

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -945,11 +945,11 @@ config_buf (enum usb_device_speed speed,
945945

946946
/*-------------------------------------------------------------------------*/
947947

948-
static void eth_start (struct eth_dev *dev, int gfp_flags);
949-
static int alloc_requests (struct eth_dev *dev, unsigned n, int gfp_flags);
948+
static void eth_start (struct eth_dev *dev, unsigned gfp_flags);
949+
static int alloc_requests (struct eth_dev *dev, unsigned n, unsigned gfp_flags);
950950

951951
static int
952-
set_ether_config (struct eth_dev *dev, int gfp_flags)
952+
set_ether_config (struct eth_dev *dev, unsigned gfp_flags)
953953
{
954954
int result = 0;
955955
struct usb_gadget *gadget = dev->gadget;
@@ -1079,7 +1079,7 @@ static void eth_reset_config (struct eth_dev *dev)
10791079
* that returns config descriptors, and altsetting code.
10801080
*/
10811081
static int
1082-
eth_set_config (struct eth_dev *dev, unsigned number, int gfp_flags)
1082+
eth_set_config (struct eth_dev *dev, unsigned number, unsigned gfp_flags)
10831083
{
10841084
int result = 0;
10851085
struct usb_gadget *gadget = dev->gadget;
@@ -1596,7 +1596,7 @@ static void defer_kevent (struct eth_dev *dev, int flag)
15961596
static void rx_complete (struct usb_ep *ep, struct usb_request *req);
15971597

15981598
static int
1599-
rx_submit (struct eth_dev *dev, struct usb_request *req, int gfp_flags)
1599+
rx_submit (struct eth_dev *dev, struct usb_request *req, unsigned gfp_flags)
16001600
{
16011601
struct sk_buff *skb;
16021602
int retval = -ENOMEM;
@@ -1722,7 +1722,7 @@ static void rx_complete (struct usb_ep *ep, struct usb_request *req)
17221722
}
17231723

17241724
static int prealloc (struct list_head *list, struct usb_ep *ep,
1725-
unsigned n, int gfp_flags)
1725+
unsigned n, unsigned gfp_flags)
17261726
{
17271727
unsigned i;
17281728
struct usb_request *req;
@@ -1761,7 +1761,7 @@ static int prealloc (struct list_head *list, struct usb_ep *ep,
17611761
return 0;
17621762
}
17631763

1764-
static int alloc_requests (struct eth_dev *dev, unsigned n, int gfp_flags)
1764+
static int alloc_requests (struct eth_dev *dev, unsigned n, unsigned gfp_flags)
17651765
{
17661766
int status;
17671767

@@ -1777,7 +1777,7 @@ static int alloc_requests (struct eth_dev *dev, unsigned n, int gfp_flags)
17771777
return status;
17781778
}
17791779

1780-
static void rx_fill (struct eth_dev *dev, int gfp_flags)
1780+
static void rx_fill (struct eth_dev *dev, unsigned gfp_flags)
17811781
{
17821782
struct usb_request *req;
17831783
unsigned long flags;
@@ -2022,7 +2022,7 @@ static int rndis_control_ack (struct net_device *net)
20222022

20232023
#endif /* RNDIS */
20242024

2025-
static void eth_start (struct eth_dev *dev, int gfp_flags)
2025+
static void eth_start (struct eth_dev *dev, unsigned gfp_flags)
20262026
{
20272027
DEBUG (dev, "%s\n", __FUNCTION__);
20282028

‎drivers/usb/gadget/goku_udc.c‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -269,7 +269,7 @@ static int goku_ep_disable(struct usb_ep *_ep)
269269
/*-------------------------------------------------------------------------*/
270270

271271
static struct usb_request *
272-
goku_alloc_request(struct usb_ep *_ep, int gfp_flags)
272+
goku_alloc_request(struct usb_ep *_ep, unsigned gfp_flags)
273273
{
274274
struct goku_request *req;
275275

@@ -327,7 +327,7 @@ goku_free_request(struct usb_ep *_ep, struct usb_request *_req)
327327
*/
328328
static void *
329329
goku_alloc_buffer(struct usb_ep *_ep, unsigned bytes,
330-
dma_addr_t *dma, int gfp_flags)
330+
dma_addr_t *dma, unsigned gfp_flags)
331331
{
332332
void *retval;
333333
struct goku_ep *ep;
@@ -789,7 +789,7 @@ static void abort_dma(struct goku_ep *ep, int status)
789789
/*-------------------------------------------------------------------------*/
790790

791791
static int
792-
goku_queue(struct usb_ep *_ep, struct usb_request *_req, int gfp_flags)
792+
goku_queue(struct usb_ep *_ep, struct usb_request *_req, unsigned gfp_flags)
793793
{
794794
struct goku_request *req;
795795
struct goku_ep *ep;

‎drivers/usb/gadget/lh7a40x_udc.c‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1106,7 +1106,7 @@ static int lh7a40x_ep_disable(struct usb_ep *_ep)
11061106
}
11071107

11081108
static struct usb_request *lh7a40x_alloc_request(struct usb_ep *ep,
1109-
int gfp_flags)
1109+
unsigned gfp_flags)
11101110
{
11111111
struct lh7a40x_request *req;
11121112

@@ -1134,7 +1134,7 @@ static void lh7a40x_free_request(struct usb_ep *ep, struct usb_request *_req)
11341134
}
11351135

11361136
static void *lh7a40x_alloc_buffer(struct usb_ep *ep, unsigned bytes,
1137-
dma_addr_t * dma, int gfp_flags)
1137+
dma_addr_t * dma, unsigned gfp_flags)
11381138
{
11391139
char *retval;
11401140

@@ -1158,7 +1158,7 @@ static void lh7a40x_free_buffer(struct usb_ep *ep, void *buf, dma_addr_t dma,
11581158
* NOTE: Sets INDEX register
11591159
*/
11601160
static int lh7a40x_queue(struct usb_ep *_ep, struct usb_request *_req,
1161-
int gfp_flags)
1161+
unsigned gfp_flags)
11621162
{
11631163
struct lh7a40x_request *req;
11641164
struct lh7a40x_ep *ep;

0 commit comments

Comments
 (0)