Skip to contentSkip to conversation

iosched: remove redundant sprintf

PATCH Applied Kees Cook 2 participants 2 messages May 4, 2011 – May 6, 2011 Block layer

lore
Share & tools
lore

Kees Cook

author
#0 lore raw

PATCH 1/1 iosched: remove redundant sprintf

After the anticipatory scheduler was dropped, there was no need to special-case the request_module string. As such, drop the redundant sprintf and stack variable.

---
 block/elevator.c |    7 +------
 1 files changed, 1 insertions(+), 6 deletions(-)
block/elevator.c +1 -6
index 45ca1e3..2a0b653 100644
@@ -155,13 +155,8 @@ static struct elevator_type *elevator_get(const char *name)
 
 	e = elevator_find(name);
 	if (!e) {
-		char elv[ELV_NAME_MAX + strlen("-iosched")];
-
 		spin_unlock(&elv_list_lock);
-
-		snprintf(elv, sizeof(elv), "%s-iosched", name);
-
-		request_module("%s", elv);
+		request_module("%s-iosched", name);
 		spin_lock(&elv_list_lock);
 		e = elevator_find(name);
 	}
Signature · 5 lines
1.7.4.1

-- 
Kees Cook
Ubuntu Security Team
maintainer Applied
#1 lore raw
Quoted 3 lines · Kees Cook

After the anticipatory scheduler was dropped, there was no need to special-case the request_module string. As such, drop the redundant sprintf and stack variable.

Thanks, applied to for-2.6.40/core

Signature · 1 line
Jens Axboe