Skip to contentSkip to conversation

block: remove some unnecessary codes

PATCH Superseded [email protected] 2 participants 3 messages May 10, 2012 Block layer

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 block: remove some unnecessary codes

From: Zhi Yong Wu <[email protected]>

---
 block/partition-generic.c |    2 --
 1 files changed, 0 insertions(+), 2 deletions(-)
block/partition-generic.c +0 -2
index 6df5d69..4c03880 100644
@@ -473,7 +473,6 @@ rescan:
 	/* add partitions */
 	for (p = 1; p < state->limit; p++) {
 		sector_t size, from;
-		struct partition_meta_info *info = NULL;
 
 		size = state->parts[p].size;
 		if (!size)
@@ -509,7 +508,6 @@ rescan:
 		}
 
 		if (state->parts[p].has_info)
-			info = &state->parts[p].info;
 		part = add_partition(disk, p, from, size,
 				     state->parts[p].flags,
 				     &state->parts[p].info);
Signature · 1 line
1.7.6
#1 lore raw

You should also remove the if statement on line 511.

Quoted 36 lines · On Thu, 10 May 2012, [email protected] wrote:

From: Zhi Yong Wu <[email protected]>

---
 block/partition-generic.c |    2 --
 1 files changed, 0 insertions(+), 2 deletions(-)
block/partition-generic.c +0 -3
index 6df5d69..4c03880 100644
@@ -473,7 +473,6 @@ rescan:
 	/* add partitions */
 	for (p = 1; p < state->limit; p++) {
 		sector_t size, from;
-		struct partition_meta_info *info = NULL;
 
 		size = state->parts[p].size;
 		if (!size)
@@ -509,7 +508,6 @@ rescan:
 		}
 
 		if (state->parts[p].has_info)
-			info = &state->parts[p].info;
 		part = add_partition(disk, p, from, size,
 				     state->parts[p].flags,
 				     &state->parts[p].info);
--

1.7.6

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

#2 lore raw
Quoted 1 line · Thiago Rafel Becker

You should also remove the if statement on line 511.

Yeah, good comment. thanks. pls see v2.

Quoted 39 lines · On Thu, 10 May 2012, [email protected] wrote:
Quoted 37 lines

From: Zhi Yong Wu <[email protected]>

---
 block/partition-generic.c |    2 --

 1 files changed, 0 insertions(+), 2 deletions(-)
block/partition-generic.c +0 -3
index 6df5d69..4c03880 100644
@@ -473,7 +473,6 @@ rescan:
       /* add partitions */
       for (p = 1; p < state->limit; p++) {
               sector_t size, from;
-             struct partition_meta_info *info = NULL;
 
               size = state->parts[p].size;
               if (!size)
@@ -509,7 +508,6 @@ rescan:
               }
 
               if (state->parts[p].has_info)
-                     info = &state->parts[p].info;
               part = add_partition(disk, p, from, size,
                                    state->parts[p].flags,
                                    &state->parts[p].info);
--

1.7.6

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Signature · 3 lines
Regards,

Zhi Yong Wu