Skip to contentSkip to conversation

mfd: lpc_ich: Fix arguments to kmalloc

PATCH In review Emil Goode 2 participants 2 messages Feb 6, 2013

Subsystems (3)
lore
Share & tools
lore

Emil Goode

author
#0 lore raw

PATCH 1/1 mfd: lpc_ich: Fix arguments to kmalloc

This patch changes the order of the arguments to kmalloc, the allocation flag should be the second argument.

Sparse warnings:

drivers/mfd/lpc_ich.c:881:24: warning:
incorrect type in argument 1 (different base types) drivers/mfd/lpc_ich.c:881:24:
expected unsigned long [unsigned] [usertype] size
drivers/mfd/lpc_ich.c:881:24: got restricted gfp_t

drivers/mfd/lpc_ich.c:881:36: warning:
incorrect type in argument 2 (different base types) drivers/mfd/lpc_ich.c:881:36:
expected restricted gfp_t [usertype] flags
drivers/mfd/lpc_ich.c:881:36: got unsigned long

---
 drivers/mfd/lpc_ich.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/mfd/lpc_ich.c +1 -1
index a0cfdf9..3af8590 100644
@@ -878,7 +878,7 @@ static int lpc_ich_probe(struct pci_dev *dev,
 	int ret;
 	bool cell_added = false;
 
-	priv = kmalloc(GFP_KERNEL, sizeof(struct lpc_ich_priv));
+	priv = kmalloc(sizeof(struct lpc_ich_priv), GFP_KERNEL);
 	if (!priv)
 		return -ENOMEM;
 
Signature · 1 line
1.7.10.4
#1 lore raw

HI Emil,

Quoted 17 lines · Emil Goode

This patch changes the order of the arguments to kmalloc, the allocation flag should be the second argument.

Sparse warnings:

drivers/mfd/lpc_ich.c:881:24: warning:
incorrect type in argument 1 (different base types) drivers/mfd/lpc_ich.c:881:24:
expected unsigned long [unsigned] [usertype] size
drivers/mfd/lpc_ich.c:881:24: got restricted gfp_t

drivers/mfd/lpc_ich.c:881:36: warning:
incorrect type in argument 2 (different base types) drivers/mfd/lpc_ich.c:881:36:
expected restricted gfp_t [usertype] flags
drivers/mfd/lpc_ich.c:881:36: got unsigned long

Quoted 4 lines
---
 drivers/mfd/lpc_ich.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

This patch does not apply to my for-next branch.

Cheers,
Samuel.

Signature · 2 lines
Intel Open Source Technology Centre
http://oss.intel.com/