Skip to contentSkip to conversation

elevator.c: use ELV_NAME_MAX instead of magic number 16 for chosen_elevator

PATCH In review Wang Sheng-Hui 2 participants 3 messages Sep 4, 2011 – Sep 8, 2011 Block layer

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 elevator.c: use ELV_NAME_MAX instead of magic number 16 for chosen_elevator

We have ELV_NAME_MAX defined to 16, and hence we should use it instead of the magic nubmer 16 for elevator's name string.

The patch is against 3.1-rc3.

---
 block/elevator.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
block/elevator.c +1 -1
index a3b64bc..cb332cb 100644
@@ -182,7 +182,7 @@ static void elevator_attach(struct request_queue *q, struct elevator_queue *eq,
 	eq->elevator_data = data;
 }
 
-static char chosen_elevator[16];
+static char chosen_elevator[ELV_NAME_MAX];
 
 static int __init elevator_setup(char *str)
 {
Signature · 1 line
1.7.1
#1 lore raw
Quoted 15 lines · Wang Sheng-Hui

We have ELV_NAME_MAX defined to 16, and hence we should use it instead of the magic nubmer 16 for elevator's name string.

The patch is against 3.1-rc3.

---
 block/elevator.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
block/elevator.c +0 -0
index a3b64bc..cb332cb 100644

block/elevator.c static void elevator_attach(struct request_queue *q, struct elevator_queue *eq, · line 188

Quoted 8 lines
block/elevator.c +1 -1
@@ -182,7 +182,7 @@ static void elevator_attach(struct request_queue *q, struct elevator_queue *eq,
 	eq->elevator_data = data;
 }
 
-static char chosen_elevator[16];
+static char chosen_elevator[ELV_NAME_MAX];
 
 static int __init elevator_setup(char *str)
 {

Any comment?

maintainer
#2 lore raw
Quoted 19 lines · Wang Sheng-Hui
Quoted 18 lines · Wang Sheng-Hui

We have ELV_NAME_MAX defined to 16, and hence we should use it instead of the magic nubmer 16 for elevator's name string.

The patch is against 3.1-rc3.

---
 block/elevator.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
block/elevator.c +0 -0
index a3b64bc..cb332cb 100644
@@ -182,7 +182,7 @@ static void elevator_attach(struct request_queue *q, struct elevator_queue *eq,
 	eq->elevator_data = data;
 }
 
Quoted 7 lines

block/elevator.c static void elevator_attach(struct request_queue *q, struct elevator_queue *eq, · line 188

Quoted 5 lines
block/elevator.c +1 -1
-static char chosen_elevator[16];
+static char chosen_elevator[ELV_NAME_MAX];
 
 static int __init elevator_setup(char *str)
 {

Any comment?

Looks fine, applied.

Signature · 1 line
Jens Axboe