* [PATCH 6/6] Staging: android: Add parenthesis to macros with complex values in pmem.c
@ 2012-01-21 4:23 Kashyap Gada
2012-01-21 8:24 ` Dan Carpenter
0 siblings, 1 reply; 2+ messages in thread
From: Kashyap Gada @ 2012-01-21 4:23 UTC (permalink / raw)
To: gregkh; +Cc: rebecca, jgennis, dima, devel, linux-kernel, Kashyap Gada
diff --git a/drivers/staging/android/pmem.c b/drivers/staging/android/pmem.c
index c589c0c..b685c18 100644
--- a/drivers/staging/android/pmem.c
+++ b/drivers/staging/android/pmem.c
@@ -38,17 +38,17 @@
* the file should not be released until put_pmem_file is called */
#define PMEM_FLAGS_BUSY 0x1
/* indicates that this is a suballocation of a larger master range */
-#define PMEM_FLAGS_CONNECTED 0x1 << 1
+#define PMEM_FLAGS_CONNECTED (x1 << 1)
/* indicates this is a master and not a sub allocation and that it is mmaped */
-#define PMEM_FLAGS_MASTERMAP 0x1 << 2
+#define PMEM_FLAGS_MASTERMAP (0x1 << 2)
/* submap and unsubmap flags indicate:
* 00: subregion has never been mmaped
* 10: subregion has been mmaped, reference to the mm was taken
* 11: subretion has ben released, refernece to the mm still held
* 01: subretion has been released, reference to the mm has been released
*/
-#define PMEM_FLAGS_SUBMAP 0x1 << 3
-#define PMEM_FLAGS_UNSUBMAP 0x1 << 4
+#define PMEM_FLAGS_SUBMAP (0x1 << 3)
+#define PMEM_FLAGS_UNSUBMAP (0x1 << 4)
struct pmem_data {
@@ -153,8 +153,8 @@ struct pmem_info {
static struct pmem_info pmem[PMEM_MAX_DEVICES];
static int id_count;
-#define PMEM_IS_FREE(id, index) !(pmem[id].bitmap[index].allocated)
-#define PMEM_ORDER(id, index) pmem[id].bitmap[index].order
+#define PMEM_IS_FREE(id, index) (!(pmem[id].bitmap[index].allocated))
+#define PMEM_ORDER(id, index) (pmem[id].bitmap[index].order)
#define PMEM_BUDDY_INDEX(id, index) (index ^ (1 << PMEM_ORDER(id, index)))
#define PMEM_NEXT_INDEX(id, index) (index + (1 << PMEM_ORDER(id, index)))
#define PMEM_OFFSET(index) (index * PMEM_MIN_ALLOC)
--
1.7.5.4
^ permalink raw reply related [flat|nested] 2+ messages in thread* Re: [PATCH 6/6] Staging: android: Add parenthesis to macros with complex values in pmem.c
2012-01-21 4:23 [PATCH 6/6] Staging: android: Add parenthesis to macros with complex values in pmem.c Kashyap Gada
@ 2012-01-21 8:24 ` Dan Carpenter
0 siblings, 0 replies; 2+ messages in thread
From: Dan Carpenter @ 2012-01-21 8:24 UTC (permalink / raw)
To: Kashyap Gada; +Cc: gregkh, devel, linux-kernel, dima, jgennis, rebecca
[-- Attachment #1: Type: text/plain, Size: 471 bytes --]
On Sat, Jan 21, 2012 at 04:23:32AM +0000, Kashyap Gada wrote:
> -#define PMEM_IS_FREE(id, index) !(pmem[id].bitmap[index].allocated)
> -#define PMEM_ORDER(id, index) pmem[id].bitmap[index].order
> +#define PMEM_IS_FREE(id, index) (!(pmem[id].bitmap[index].allocated))
> +#define PMEM_ORDER(id, index) (pmem[id].bitmap[index].order)
These are not needed. We're modifying checkpatch.pl to not complain
about these, but it hasn't been merged yet.
regards,
dan carpenter
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2012-01-21 8:23 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-01-21 4:23 [PATCH 6/6] Staging: android: Add parenthesis to macros with complex values in pmem.c Kashyap Gada
2012-01-21 8:24 ` Dan Carpenter
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox