Skip to content

Commit

Permalink
[PATCH] USB: Fix kmalloc's flags type in USB
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Olav Kongas authored and Greg Kroah-Hartman committed Jul 12, 2005
1 parent 17f8bb7 commit 5db539e
Show file tree
Hide file tree
Showing 26 changed files with 81 additions and 75 deletions.
2 changes: 1 addition & 1 deletion drivers/usb/core/buffer.c
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ void hcd_buffer_destroy (struct usb_hcd *hcd)
void *hcd_buffer_alloc (
struct usb_bus *bus,
size_t size,
int mem_flags,
unsigned mem_flags,
dma_addr_t *dma
)
{
Expand Down
2 changes: 1 addition & 1 deletion drivers/usb/core/hcd.c
Original file line number Diff line number Diff line change
Expand Up @@ -1112,7 +1112,7 @@ static void urb_unlink (struct urb *urb)
* expects usb_submit_urb() to have sanity checked and conditioned all
* inputs in the urb
*/
static int hcd_submit_urb (struct urb *urb, int mem_flags)
static int hcd_submit_urb (struct urb *urb, unsigned mem_flags)
{
int status;
struct usb_hcd *hcd = urb->dev->bus->hcpriv;
Expand Down
8 changes: 4 additions & 4 deletions drivers/usb/core/hcd.h
Original file line number Diff line number Diff line change
Expand Up @@ -142,12 +142,12 @@ struct hcd_timeout { /* timeouts we allocate */

struct usb_operations {
int (*get_frame_number) (struct usb_device *usb_dev);
int (*submit_urb) (struct urb *urb, int mem_flags);
int (*submit_urb) (struct urb *urb, unsigned mem_flags);
int (*unlink_urb) (struct urb *urb, int status);

/* allocate dma-consistent buffer for URB_DMA_NOMAPPING */
void *(*buffer_alloc)(struct usb_bus *bus, size_t size,
int mem_flags,
unsigned mem_flags,
dma_addr_t *dma);
void (*buffer_free)(struct usb_bus *bus, size_t size,
void *addr, dma_addr_t dma);
Expand Down Expand Up @@ -200,7 +200,7 @@ struct hc_driver {
int (*urb_enqueue) (struct usb_hcd *hcd,
struct usb_host_endpoint *ep,
struct urb *urb,
int mem_flags);
unsigned mem_flags);
int (*urb_dequeue) (struct usb_hcd *hcd, struct urb *urb);

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

void *hcd_buffer_alloc (struct usb_bus *bus, size_t size,
int mem_flags, dma_addr_t *dma);
unsigned mem_flags, dma_addr_t *dma);
void hcd_buffer_free (struct usb_bus *bus, size_t size,
void *addr, dma_addr_t dma);

Expand Down
2 changes: 1 addition & 1 deletion drivers/usb/core/message.c
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,7 @@ int usb_sg_init (
struct scatterlist *sg,
int nents,
size_t length,
int mem_flags
unsigned mem_flags
)
{
int i;
Expand Down
4 changes: 2 additions & 2 deletions drivers/usb/core/urb.c
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ void usb_init_urb(struct urb *urb)
*
* The driver must call usb_free_urb() when it is finished with the urb.
*/
struct urb *usb_alloc_urb(int iso_packets, int mem_flags)
struct urb *usb_alloc_urb(int iso_packets, unsigned mem_flags)
{
struct urb *urb;

Expand Down Expand Up @@ -224,7 +224,7 @@ struct urb * usb_get_urb(struct urb *urb)
* GFP_NOIO, unless b) or c) apply
*
*/
int usb_submit_urb(struct urb *urb, int mem_flags)
int usb_submit_urb(struct urb *urb, unsigned mem_flags)
{
int pipe, temp, max;
struct usb_device *dev;
Expand Down
2 changes: 1 addition & 1 deletion drivers/usb/core/usb.c
Original file line number Diff line number Diff line change
Expand Up @@ -1129,7 +1129,7 @@ int __usb_get_extra_descriptor(char *buffer, unsigned size,
void *usb_buffer_alloc (
struct usb_device *dev,
size_t size,
int mem_flags,
unsigned mem_flags,
dma_addr_t *dma
)
{
Expand Down
9 changes: 5 additions & 4 deletions drivers/usb/gadget/dummy_hcd.c
Original file line number Diff line number Diff line change
Expand Up @@ -470,7 +470,7 @@ static int dummy_disable (struct usb_ep *_ep)
}

static struct usb_request *
dummy_alloc_request (struct usb_ep *_ep, int mem_flags)
dummy_alloc_request (struct usb_ep *_ep, unsigned mem_flags)
{
struct dummy_ep *ep;
struct dummy_request *req;
Expand Down Expand Up @@ -507,7 +507,7 @@ dummy_alloc_buffer (
struct usb_ep *_ep,
unsigned bytes,
dma_addr_t *dma,
int mem_flags
unsigned mem_flags
) {
char *retval;
struct dummy_ep *ep;
Expand Down Expand Up @@ -540,7 +540,8 @@ fifo_complete (struct usb_ep *ep, struct usb_request *req)
}

static int
dummy_queue (struct usb_ep *_ep, struct usb_request *_req, int mem_flags)
dummy_queue (struct usb_ep *_ep, struct usb_request *_req,
unsigned mem_flags)
{
struct dummy_ep *ep;
struct dummy_request *req;
Expand Down Expand Up @@ -998,7 +999,7 @@ static int dummy_urb_enqueue (
struct usb_hcd *hcd,
struct usb_host_endpoint *ep,
struct urb *urb,
int mem_flags
unsigned mem_flags
) {
struct dummy *dum;
struct urbp *urbp;
Expand Down
18 changes: 9 additions & 9 deletions drivers/usb/gadget/ether.c
Original file line number Diff line number Diff line change
Expand Up @@ -945,11 +945,11 @@ config_buf (enum usb_device_speed speed,

/*-------------------------------------------------------------------------*/

static void eth_start (struct eth_dev *dev, int gfp_flags);
static int alloc_requests (struct eth_dev *dev, unsigned n, int gfp_flags);
static void eth_start (struct eth_dev *dev, unsigned gfp_flags);
static int alloc_requests (struct eth_dev *dev, unsigned n, unsigned gfp_flags);

static int
set_ether_config (struct eth_dev *dev, int gfp_flags)
set_ether_config (struct eth_dev *dev, unsigned gfp_flags)
{
int result = 0;
struct usb_gadget *gadget = dev->gadget;
Expand Down Expand Up @@ -1079,7 +1079,7 @@ static void eth_reset_config (struct eth_dev *dev)
* that returns config descriptors, and altsetting code.
*/
static int
eth_set_config (struct eth_dev *dev, unsigned number, int gfp_flags)
eth_set_config (struct eth_dev *dev, unsigned number, unsigned gfp_flags)
{
int result = 0;
struct usb_gadget *gadget = dev->gadget;
Expand Down Expand Up @@ -1596,7 +1596,7 @@ static void defer_kevent (struct eth_dev *dev, int flag)
static void rx_complete (struct usb_ep *ep, struct usb_request *req);

static int
rx_submit (struct eth_dev *dev, struct usb_request *req, int gfp_flags)
rx_submit (struct eth_dev *dev, struct usb_request *req, unsigned gfp_flags)
{
struct sk_buff *skb;
int retval = -ENOMEM;
Expand Down Expand Up @@ -1722,7 +1722,7 @@ static void rx_complete (struct usb_ep *ep, struct usb_request *req)
}

static int prealloc (struct list_head *list, struct usb_ep *ep,
unsigned n, int gfp_flags)
unsigned n, unsigned gfp_flags)
{
unsigned i;
struct usb_request *req;
Expand Down Expand Up @@ -1761,7 +1761,7 @@ static int prealloc (struct list_head *list, struct usb_ep *ep,
return 0;
}

static int alloc_requests (struct eth_dev *dev, unsigned n, int gfp_flags)
static int alloc_requests (struct eth_dev *dev, unsigned n, unsigned gfp_flags)
{
int status;

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

static void rx_fill (struct eth_dev *dev, int gfp_flags)
static void rx_fill (struct eth_dev *dev, unsigned gfp_flags)
{
struct usb_request *req;
unsigned long flags;
Expand Down Expand Up @@ -2022,7 +2022,7 @@ static int rndis_control_ack (struct net_device *net)

#endif /* RNDIS */

static void eth_start (struct eth_dev *dev, int gfp_flags)
static void eth_start (struct eth_dev *dev, unsigned gfp_flags)
{
DEBUG (dev, "%s\n", __FUNCTION__);

Expand Down
6 changes: 3 additions & 3 deletions drivers/usb/gadget/goku_udc.c
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,7 @@ static int goku_ep_disable(struct usb_ep *_ep)
/*-------------------------------------------------------------------------*/

static struct usb_request *
goku_alloc_request(struct usb_ep *_ep, int gfp_flags)
goku_alloc_request(struct usb_ep *_ep, unsigned gfp_flags)
{
struct goku_request *req;

Expand Down Expand Up @@ -327,7 +327,7 @@ goku_free_request(struct usb_ep *_ep, struct usb_request *_req)
*/
static void *
goku_alloc_buffer(struct usb_ep *_ep, unsigned bytes,
dma_addr_t *dma, int gfp_flags)
dma_addr_t *dma, unsigned gfp_flags)
{
void *retval;
struct goku_ep *ep;
Expand Down Expand Up @@ -789,7 +789,7 @@ static void abort_dma(struct goku_ep *ep, int status)
/*-------------------------------------------------------------------------*/

static int
goku_queue(struct usb_ep *_ep, struct usb_request *_req, int gfp_flags)
goku_queue(struct usb_ep *_ep, struct usb_request *_req, unsigned gfp_flags)
{
struct goku_request *req;
struct goku_ep *ep;
Expand Down
6 changes: 3 additions & 3 deletions drivers/usb/gadget/lh7a40x_udc.c
Original file line number Diff line number Diff line change
Expand Up @@ -1106,7 +1106,7 @@ static int lh7a40x_ep_disable(struct usb_ep *_ep)
}

static struct usb_request *lh7a40x_alloc_request(struct usb_ep *ep,
int gfp_flags)
unsigned gfp_flags)
{
struct lh7a40x_request *req;

Expand Down Expand Up @@ -1134,7 +1134,7 @@ static void lh7a40x_free_request(struct usb_ep *ep, struct usb_request *_req)
}

static void *lh7a40x_alloc_buffer(struct usb_ep *ep, unsigned bytes,
dma_addr_t * dma, int gfp_flags)
dma_addr_t * dma, unsigned gfp_flags)
{
char *retval;

Expand All @@ -1158,7 +1158,7 @@ static void lh7a40x_free_buffer(struct usb_ep *ep, void *buf, dma_addr_t dma,
* NOTE: Sets INDEX register
*/
static int lh7a40x_queue(struct usb_ep *_ep, struct usb_request *_req,
int gfp_flags)
unsigned gfp_flags)
{
struct lh7a40x_request *req;
struct lh7a40x_ep *ep;
Expand Down
6 changes: 3 additions & 3 deletions drivers/usb/gadget/net2280.c
Original file line number Diff line number Diff line change
Expand Up @@ -376,7 +376,7 @@ static int net2280_disable (struct usb_ep *_ep)
/*-------------------------------------------------------------------------*/

static struct usb_request *
net2280_alloc_request (struct usb_ep *_ep, int gfp_flags)
net2280_alloc_request (struct usb_ep *_ep, unsigned gfp_flags)
{
struct net2280_ep *ep;
struct net2280_request *req;
Expand Down Expand Up @@ -463,7 +463,7 @@ net2280_alloc_buffer (
struct usb_ep *_ep,
unsigned bytes,
dma_addr_t *dma,
int gfp_flags
unsigned gfp_flags
)
{
void *retval;
Expand Down Expand Up @@ -897,7 +897,7 @@ done (struct net2280_ep *ep, struct net2280_request *req, int status)
/*-------------------------------------------------------------------------*/

static int
net2280_queue (struct usb_ep *_ep, struct usb_request *_req, int gfp_flags)
net2280_queue (struct usb_ep *_ep, struct usb_request *_req, unsigned gfp_flags)
{
struct net2280_request *req;
struct net2280_ep *ep;
Expand Down
6 changes: 3 additions & 3 deletions drivers/usb/gadget/omap_udc.c
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,7 @@ static int omap_ep_disable(struct usb_ep *_ep)
/*-------------------------------------------------------------------------*/

static struct usb_request *
omap_alloc_request(struct usb_ep *ep, int gfp_flags)
omap_alloc_request(struct usb_ep *ep, unsigned gfp_flags)
{
struct omap_req *req;

Expand Down Expand Up @@ -298,7 +298,7 @@ omap_alloc_buffer(
struct usb_ep *_ep,
unsigned bytes,
dma_addr_t *dma,
int gfp_flags
unsigned gfp_flags
)
{
void *retval;
Expand Down Expand Up @@ -937,7 +937,7 @@ static void dma_channel_release(struct omap_ep *ep)
/*-------------------------------------------------------------------------*/

static int
omap_ep_queue(struct usb_ep *_ep, struct usb_request *_req, int gfp_flags)
omap_ep_queue(struct usb_ep *_ep, struct usb_request *_req, unsigned gfp_flags)
{
struct omap_ep *ep = container_of(_ep, struct omap_ep, ep);
struct omap_req *req = container_of(_req, struct omap_req, req);
Expand Down
6 changes: 3 additions & 3 deletions drivers/usb/gadget/pxa2xx_udc.c
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,7 @@ static int pxa2xx_ep_disable (struct usb_ep *_ep)
* pxa2xx_ep_alloc_request - allocate a request data structure
*/
static struct usb_request *
pxa2xx_ep_alloc_request (struct usb_ep *_ep, int gfp_flags)
pxa2xx_ep_alloc_request (struct usb_ep *_ep, unsigned gfp_flags)
{
struct pxa2xx_request *req;

Expand Down Expand Up @@ -367,7 +367,7 @@ pxa2xx_ep_free_request (struct usb_ep *_ep, struct usb_request *_req)
*/
static void *
pxa2xx_ep_alloc_buffer(struct usb_ep *_ep, unsigned bytes,
dma_addr_t *dma, int gfp_flags)
dma_addr_t *dma, unsigned gfp_flags)
{
char *retval;

Expand Down Expand Up @@ -874,7 +874,7 @@ static void dma_nodesc_handler(int dmach, void *_ep, struct pt_regs *r)
/*-------------------------------------------------------------------------*/

static int
pxa2xx_ep_queue(struct usb_ep *_ep, struct usb_request *_req, int gfp_flags)
pxa2xx_ep_queue(struct usb_ep *_ep, struct usb_request *_req, unsigned gfp_flags)
{
struct pxa2xx_request *req;
struct pxa2xx_ep *ep;
Expand Down
8 changes: 4 additions & 4 deletions drivers/usb/gadget/zero.c
Original file line number Diff line number Diff line change
Expand Up @@ -612,7 +612,7 @@ static void source_sink_complete (struct usb_ep *ep, struct usb_request *req)
}

static struct usb_request *
source_sink_start_ep (struct usb_ep *ep, int gfp_flags)
source_sink_start_ep (struct usb_ep *ep, unsigned gfp_flags)
{
struct usb_request *req;
int status;
Expand Down Expand Up @@ -640,7 +640,7 @@ source_sink_start_ep (struct usb_ep *ep, int gfp_flags)
}

static int
set_source_sink_config (struct zero_dev *dev, int gfp_flags)
set_source_sink_config (struct zero_dev *dev, unsigned gfp_flags)
{
int result = 0;
struct usb_ep *ep;
Expand Down Expand Up @@ -744,7 +744,7 @@ static void loopback_complete (struct usb_ep *ep, struct usb_request *req)
}

static int
set_loopback_config (struct zero_dev *dev, int gfp_flags)
set_loopback_config (struct zero_dev *dev, unsigned gfp_flags)
{
int result = 0;
struct usb_ep *ep;
Expand Down Expand Up @@ -845,7 +845,7 @@ static void zero_reset_config (struct zero_dev *dev)
* by limiting configuration choices (like the pxa2xx).
*/
static int
zero_set_config (struct zero_dev *dev, unsigned number, int gfp_flags)
zero_set_config (struct zero_dev *dev, unsigned number, unsigned gfp_flags)
{
int result = 0;
struct usb_gadget *gadget = dev->gadget;
Expand Down
2 changes: 1 addition & 1 deletion drivers/usb/host/ehci-hcd.c
Original file line number Diff line number Diff line change
Expand Up @@ -960,7 +960,7 @@ static int ehci_urb_enqueue (
struct usb_hcd *hcd,
struct usb_host_endpoint *ep,
struct urb *urb,
int mem_flags
unsigned mem_flags
) {
struct ehci_hcd *ehci = hcd_to_ehci (hcd);
struct list_head qtd_list;
Expand Down
2 changes: 1 addition & 1 deletion drivers/usb/host/ehci-q.c
Original file line number Diff line number Diff line change
Expand Up @@ -898,7 +898,7 @@ submit_async (
struct usb_host_endpoint *ep,
struct urb *urb,
struct list_head *qtd_list,
int mem_flags
unsigned mem_flags
) {
struct ehci_qtd *qtd;
int epnum;
Expand Down
Loading

0 comments on commit 5db539e

Please sign in to comment.