提交 2eb25a6c 编写于 作者: V Victor Fusco 提交者: David S. Miller

[Bluetooth]: Fix sparse warnings (__nocast type)

This patch fixes the sparse warnings "implicit cast to nocast type"
for the priority or gfp_mask parameters of the memory allocations.
Signed-off-by: NVictor Fusco <victor@cetuc.puc-rio.br>
Signed-off-by: NDomen Puncer <domen@coderock.org>
Signed-off-by: NMarcel Holtmann <marcel@holtmann.org>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 3a5e903c
...@@ -307,7 +307,8 @@ static void bpa10x_complete(struct urb *urb, struct pt_regs *regs) ...@@ -307,7 +307,8 @@ static void bpa10x_complete(struct urb *urb, struct pt_regs *regs)
read_unlock(&data->lock); read_unlock(&data->lock);
} }
static inline struct urb *bpa10x_alloc_urb(struct usb_device *udev, unsigned int pipe, size_t size, int flags, void *data) static inline struct urb *bpa10x_alloc_urb(struct usb_device *udev, unsigned int pipe,
size_t size, unsigned int __nocast flags, void *data)
{ {
struct urb *urb; struct urb *urb;
struct usb_ctrlrequest *cr; struct usb_ctrlrequest *cr;
......
...@@ -127,7 +127,7 @@ static struct usb_device_id blacklist_ids[] = { ...@@ -127,7 +127,7 @@ static struct usb_device_id blacklist_ids[] = {
{ } /* Terminating entry */ { } /* Terminating entry */
}; };
static struct _urb *_urb_alloc(int isoc, int gfp) static struct _urb *_urb_alloc(int isoc, unsigned int __nocast gfp)
{ {
struct _urb *_urb = kmalloc(sizeof(struct _urb) + struct _urb *_urb = kmalloc(sizeof(struct _urb) +
sizeof(struct usb_iso_packet_descriptor) * isoc, gfp); sizeof(struct usb_iso_packet_descriptor) * isoc, gfp);
......
...@@ -135,7 +135,7 @@ struct bt_skb_cb { ...@@ -135,7 +135,7 @@ struct bt_skb_cb {
}; };
#define bt_cb(skb) ((struct bt_skb_cb *)(skb->cb)) #define bt_cb(skb) ((struct bt_skb_cb *)(skb->cb))
static inline struct sk_buff *bt_skb_alloc(unsigned int len, int how) static inline struct sk_buff *bt_skb_alloc(unsigned int len, unsigned int __nocast how)
{ {
struct sk_buff *skb; struct sk_buff *skb;
......
...@@ -230,7 +230,7 @@ int rfcomm_send_rpn(struct rfcomm_session *s, int cr, u8 dlci, ...@@ -230,7 +230,7 @@ int rfcomm_send_rpn(struct rfcomm_session *s, int cr, u8 dlci,
u8 xon_char, u8 xoff_char, u16 param_mask); u8 xon_char, u8 xoff_char, u16 param_mask);
/* ---- RFCOMM DLCs (channels) ---- */ /* ---- RFCOMM DLCs (channels) ---- */
struct rfcomm_dlc *rfcomm_dlc_alloc(int prio); struct rfcomm_dlc *rfcomm_dlc_alloc(unsigned int __nocast prio);
void rfcomm_dlc_free(struct rfcomm_dlc *d); void rfcomm_dlc_free(struct rfcomm_dlc *d);
int rfcomm_dlc_open(struct rfcomm_dlc *d, bdaddr_t *src, bdaddr_t *dst, u8 channel); int rfcomm_dlc_open(struct rfcomm_dlc *d, bdaddr_t *src, bdaddr_t *dst, u8 channel);
int rfcomm_dlc_close(struct rfcomm_dlc *d, int reason); int rfcomm_dlc_close(struct rfcomm_dlc *d, int reason);
......
...@@ -372,7 +372,7 @@ static struct proto l2cap_proto = { ...@@ -372,7 +372,7 @@ static struct proto l2cap_proto = {
.obj_size = sizeof(struct l2cap_pinfo) .obj_size = sizeof(struct l2cap_pinfo)
}; };
static struct sock *l2cap_sock_alloc(struct socket *sock, int proto, int prio) static struct sock *l2cap_sock_alloc(struct socket *sock, int proto, unsigned int __nocast prio)
{ {
struct sock *sk; struct sock *sk;
......
...@@ -229,7 +229,7 @@ static void rfcomm_dlc_clear_state(struct rfcomm_dlc *d) ...@@ -229,7 +229,7 @@ static void rfcomm_dlc_clear_state(struct rfcomm_dlc *d)
d->rx_credits = RFCOMM_DEFAULT_CREDITS; d->rx_credits = RFCOMM_DEFAULT_CREDITS;
} }
struct rfcomm_dlc *rfcomm_dlc_alloc(int prio) struct rfcomm_dlc *rfcomm_dlc_alloc(unsigned int __nocast prio)
{ {
struct rfcomm_dlc *d = kmalloc(sizeof(*d), prio); struct rfcomm_dlc *d = kmalloc(sizeof(*d), prio);
if (!d) if (!d)
......
...@@ -284,7 +284,7 @@ static struct proto rfcomm_proto = { ...@@ -284,7 +284,7 @@ static struct proto rfcomm_proto = {
.obj_size = sizeof(struct rfcomm_pinfo) .obj_size = sizeof(struct rfcomm_pinfo)
}; };
static struct sock *rfcomm_sock_alloc(struct socket *sock, int proto, int prio) static struct sock *rfcomm_sock_alloc(struct socket *sock, int proto, unsigned int __nocast prio)
{ {
struct rfcomm_dlc *d; struct rfcomm_dlc *d;
struct sock *sk; struct sock *sk;
......
...@@ -286,7 +286,7 @@ static inline void rfcomm_set_owner_w(struct sk_buff *skb, struct rfcomm_dev *de ...@@ -286,7 +286,7 @@ static inline void rfcomm_set_owner_w(struct sk_buff *skb, struct rfcomm_dev *de
skb->destructor = rfcomm_wfree; skb->destructor = rfcomm_wfree;
} }
static struct sk_buff *rfcomm_wmalloc(struct rfcomm_dev *dev, unsigned long size, int priority) static struct sk_buff *rfcomm_wmalloc(struct rfcomm_dev *dev, unsigned long size, unsigned int __nocast priority)
{ {
if (atomic_read(&dev->wmem_alloc) < rfcomm_room(dev->dlc)) { if (atomic_read(&dev->wmem_alloc) < rfcomm_room(dev->dlc)) {
struct sk_buff *skb = alloc_skb(size, priority); struct sk_buff *skb = alloc_skb(size, priority);
......
...@@ -418,7 +418,7 @@ static struct proto sco_proto = { ...@@ -418,7 +418,7 @@ static struct proto sco_proto = {
.obj_size = sizeof(struct sco_pinfo) .obj_size = sizeof(struct sco_pinfo)
}; };
static struct sock *sco_sock_alloc(struct socket *sock, int proto, int prio) static struct sock *sco_sock_alloc(struct socket *sock, int proto, unsigned int __nocast prio)
{ {
struct sock *sk; struct sock *sk;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册