linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] fs/partitions: use ADDPART_FLAG_RAID instead of magic number
@ 2010-04-17 22:28 Cesar Eduardo Barros
  2010-04-17 22:44 ` David Miller
  0 siblings, 1 reply; 2+ messages in thread
From: Cesar Eduardo Barros @ 2010-04-17 22:28 UTC (permalink / raw)
  To: linux-kernel
  Cc: Andries Brouwer, Fabio Massimo Di Nitto, David S. Miller,
	Cesar Eduardo Barros

ADDPART_FLAG_RAID was introduced in commit d18d768, and most places were
converted to use it instead of a hardcoded value. However, some places seem
to have been missed.

Change all of them to the symbolic names via the following semantic patch:

@@
struct parsed_partitions *state;
expression E;
@@
(
- state->parts[E].flags = 1
+ state->parts[E].flags = ADDPART_FLAG_RAID
|
- state->parts[E].flags |= 1
+ state->parts[E].flags |= ADDPART_FLAG_RAID
|
- state->parts[E].flags = 2
+ state->parts[E].flags = ADDPART_FLAG_WHOLEDISK
|
- state->parts[E].flags |= 2
+ state->parts[E].flags |= ADDPART_FLAG_WHOLEDISK
)

Signed-off-by: Cesar Eduardo Barros <cesarb@cesarb.net>
---
 fs/partitions/efi.c   |    2 +-
 fs/partitions/mac.c   |    2 +-
 fs/partitions/msdos.c |    2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/fs/partitions/efi.c b/fs/partitions/efi.c
index 91babda..f5867f8 100644
--- a/fs/partitions/efi.c
+++ b/fs/partitions/efi.c
@@ -631,7 +631,7 @@ efi_partition(struct parsed_partitions *state, struct block_device *bdev)
 		/* If this is a RAID volume, tell md */
 		if (!efi_guidcmp(ptes[i].partition_type_guid,
 				 PARTITION_LINUX_RAID_GUID))
-			state->parts[i+1].flags = 1;
+			state->parts[i + 1].flags = ADDPART_FLAG_RAID;
 	}
 	kfree(ptes);
 	kfree(gpt);
diff --git a/fs/partitions/mac.c b/fs/partitions/mac.c
index d4a0fad..dece9b4 100644
--- a/fs/partitions/mac.c
+++ b/fs/partitions/mac.c
@@ -75,7 +75,7 @@ int mac_partition(struct parsed_partitions *state, struct block_device *bdev)
 			be32_to_cpu(part->block_count) * (secsize/512));
 
 		if (!strnicmp(part->type, "Linux_RAID", 10))
-			state->parts[slot].flags = 1;
+			state->parts[slot].flags = ADDPART_FLAG_RAID;
 #ifdef CONFIG_PPC_PMAC
 		/*
 		 * If this is the first bootable partition, tell the
diff --git a/fs/partitions/msdos.c b/fs/partitions/msdos.c
index 90be97f..efe3df7 100644
--- a/fs/partitions/msdos.c
+++ b/fs/partitions/msdos.c
@@ -509,7 +509,7 @@ int msdos_partition(struct parsed_partitions *state, struct block_device *bdev)
 		}
 		put_partition(state, slot, start, size);
 		if (SYS_IND(p) == LINUX_RAID_PARTITION)
-			state->parts[slot].flags = 1;
+			state->parts[slot].flags = ADDPART_FLAG_RAID;
 		if (SYS_IND(p) == DM6_PARTITION)
 			printk("[DM]");
 		if (SYS_IND(p) == EZD_PARTITION)
-- 
1.6.6.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] fs/partitions: use ADDPART_FLAG_RAID instead of magic number
  2010-04-17 22:28 [PATCH] fs/partitions: use ADDPART_FLAG_RAID instead of magic number Cesar Eduardo Barros
@ 2010-04-17 22:44 ` David Miller
  0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2010-04-17 22:44 UTC (permalink / raw)
  To: cesarb; +Cc: linux-kernel, aeb, fabbione

From: Cesar Eduardo Barros <cesarb@cesarb.net>
Date: Sat, 17 Apr 2010 19:28:09 -0300

> ADDPART_FLAG_RAID was introduced in commit d18d768, and most places were
> converted to use it instead of a hardcoded value. However, some places seem
> to have been missed.
> 
> Change all of them to the symbolic names via the following semantic patch:
 ...
> Signed-off-by: Cesar Eduardo Barros <cesarb@cesarb.net>

Acked-by: David S. Miller <davem@davemloft.net>

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2010-04-17 22:44 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-04-17 22:28 [PATCH] fs/partitions: use ADDPART_FLAG_RAID instead of magic number Cesar Eduardo Barros
2010-04-17 22:44 ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).