提交 7b5b3f3d 编写于 作者: R Randy Dunlap 提交者: David S. Miller

[ATM]: fix sparse gfp nocast warnings

Fix implicit nocast warnings in atm code:
net/atm/atm_misc.c:35:44: warning: implicit cast to nocast type
drivers/atm/fore200e.c:183:33: warning: implicit cast to nocast type

Also use kzalloc() instead of kmalloc().
Signed-off-by: NRandy Dunlap <rdunlap@xenotime.net>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 a5181ab0
...@@ -178,14 +178,12 @@ fore200e_irq_itoa(int irq) ...@@ -178,14 +178,12 @@ fore200e_irq_itoa(int irq)
static void* static void*
fore200e_kmalloc(int size, int flags) fore200e_kmalloc(int size, unsigned int __nocast flags)
{ {
void* chunk = kmalloc(size, flags); void *chunk = kzalloc(size, flags);
if (chunk) if (!chunk)
memset(chunk, 0x00, size); printk(FORE200E "kmalloc() failed, requested size = %d, flags = 0x%x\n", size, flags);
else
printk(FORE200E "kmalloc() failed, requested size = %d, flags = 0x%x\n", size, flags);
return chunk; return chunk;
} }
......
...@@ -457,7 +457,7 @@ static inline void atm_dev_put(struct atm_dev *dev) ...@@ -457,7 +457,7 @@ static inline void atm_dev_put(struct atm_dev *dev)
int atm_charge(struct atm_vcc *vcc,int truesize); int atm_charge(struct atm_vcc *vcc,int truesize);
struct sk_buff *atm_alloc_charge(struct atm_vcc *vcc,int pdu_size, struct sk_buff *atm_alloc_charge(struct atm_vcc *vcc,int pdu_size,
int gfp_flags); unsigned int __nocast gfp_flags);
int atm_pcr_goal(struct atm_trafprm *tp); int atm_pcr_goal(struct atm_trafprm *tp);
void vcc_release_async(struct atm_vcc *vcc, int reply); void vcc_release_async(struct atm_vcc *vcc, int reply);
......
...@@ -25,7 +25,7 @@ int atm_charge(struct atm_vcc *vcc,int truesize) ...@@ -25,7 +25,7 @@ int atm_charge(struct atm_vcc *vcc,int truesize)
struct sk_buff *atm_alloc_charge(struct atm_vcc *vcc,int pdu_size, struct sk_buff *atm_alloc_charge(struct atm_vcc *vcc,int pdu_size,
int gfp_flags) unsigned int __nocast gfp_flags)
{ {
struct sock *sk = sk_atm(vcc); struct sock *sk = sk_atm(vcc);
int guess = atm_guess_pdu2truesize(pdu_size); int guess = atm_guess_pdu2truesize(pdu_size);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册