[PATCH] staging: dgnc: driver.c and .h: changes kzmalloc param for sparse

Lidza Louina lidza.louina at gmail.com
Tue Aug 27 15:20:06 UTC 2013


This patch changes the dgnc_driver_kzmalloc declaration.
The kernel's kmalloc function previously took an int
priority. That's been replaced with gfp_t flags.

The warning was caught by sparse.

Signed-off-by: Lidza Louina <lidza.louina at gmail.com>
---
 drivers/staging/dgnc/dgnc_driver.c | 4 ++--
 drivers/staging/dgnc/dgnc_driver.h | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/dgnc/dgnc_driver.c b/drivers/staging/dgnc/dgnc_driver.c
index 8032368..2812453 100644
--- a/drivers/staging/dgnc/dgnc_driver.c
+++ b/drivers/staging/dgnc/dgnc_driver.c
@@ -901,9 +901,9 @@ static void dgnc_init_globals(void)
  *
  * Malloc and clear memory,
  */
-void *dgnc_driver_kzmalloc(size_t size, int priority)
+void *dgnc_driver_kzmalloc(size_t size, gfp_t flags)
 {
-	void *p = kmalloc(size, priority);
+	void *p = kmalloc(size, flags);
 	if(p)
 		memset(p, 0, size);
 	return(p);
diff --git a/drivers/staging/dgnc/dgnc_driver.h b/drivers/staging/dgnc/dgnc_driver.h
index e77303c..6d9b86e 100644
--- a/drivers/staging/dgnc/dgnc_driver.h
+++ b/drivers/staging/dgnc/dgnc_driver.h
@@ -542,7 +542,7 @@ struct channel_t {
  *************************************************************************/
 
 extern int		dgnc_ms_sleep(ulong ms);
-extern void		*dgnc_driver_kzmalloc(size_t size, int priority);
+extern void		*dgnc_driver_kzmalloc(size_t size, gfp_t flags);
 extern char		*dgnc_ioctl_name(int cmd);
 
 /*
-- 
1.8.1.2



More information about the devel mailing list