[PATCH 1/1] staging: ion: debugfs sparse warning, proper mask

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From drivers/staging/android TODO file - sparse errors.

The current code attempts assignment of -1 to unsigned type gfp_t.
Assignment should be an enumerated type of GFP_KERNEL, GFP_ATOMIC,
GFP_HIGHMEM, or __GFP_HIGH.

The original 2014 patch by Gioh Kim adding debugfs support to android/ion
used __GFP_HIGHMEM as the mask, but was removed in a subsequent revert.
This patch removes the sparse errors, and fixes the assignment as noted
above.

Signed-off-by: Derek Yerger <dy@xxxxxxxxxx>
---
diff --git a/drivers/staging/android/ion/ion.c b/drivers/staging/android/ion/ion.c
index c97e82b..a9ca46f 100644
--- a/drivers/staging/android/ion/ion.c
+++ b/drivers/staging/android/ion/ion.c
@@ -1524,7 +1524,7 @@ static int debug_shrink_set(void *data, u64 val)
 	struct shrink_control sc;
 	int objs;

-	sc.gfp_mask = -1;
+	sc.gfp_mask = __GFP_HIGHMEM;
 	sc.nr_to_scan = val;

 	if (!val) {
@@ -1542,7 +1542,7 @@ static int debug_shrink_get(void *data, u64 *val)
 	struct shrink_control sc;
 	int objs;

-	sc.gfp_mask = -1;
+	sc.gfp_mask = __GFP_HIGHMEM;
 	sc.nr_to_scan = 0;

 	objs = heap->shrinker.count_objects(&heap->shrinker, &sc);
_______________________________________________
devel mailing list
devel@xxxxxxxxxxxxxxxxxxxxxx
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel



[Index of Archives]     [Linux Driver Backports]     [DMA Engine]     [Linux GPIO]     [Linux SPI]     [Video for Linux]     [Linux USB Devel]     [Linux Coverity]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux