From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752351Ab3GHNGH (ORCPT ); Mon, 8 Jul 2013 09:06:07 -0400 Received: from smtp.outflux.net ([198.145.64.163]:60273 "EHLO smtp.outflux.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751392Ab3GHNGG (ORCPT ); Mon, 8 Jul 2013 09:06:06 -0400 Date: Mon, 8 Jul 2013 06:05:12 -0700 From: Kees Cook To: akpm@linux-foundation.org Cc: linux-kernel@vger.kernel.org, David Woodhouse , James Hogan , Rusty Russell , linux-mtd@lists.infradead.org Subject: [RESEND][PATCH] mtd: refactor call to request_module Message-ID: <20130708130512.GA24315@www.outflux.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline X-HELO: www.outflux.net Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This reduces the size of the stack frame when calling request_module(). Performing the sprintf before the call is not needed. Signed-off-by: Kees Cook --- drivers/mtd/chips/gen_probe.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/mtd/chips/gen_probe.c b/drivers/mtd/chips/gen_probe.c index 74dbb6b..ffb36ba 100644 --- a/drivers/mtd/chips/gen_probe.c +++ b/drivers/mtd/chips/gen_probe.c @@ -211,9 +211,7 @@ static inline struct mtd_info *cfi_cmdset_unknown(struct map_info *map, probe_function = __symbol_get(probename); if (!probe_function) { - char modname[sizeof("cfi_cmdset_%4.4X")]; - sprintf(modname, "cfi_cmdset_%4.4X", type); - request_module(modname); + request_module("cfi_cmdset_%4.4X", type); probe_function = __symbol_get(probename); } -- 1.7.9.5 -- Kees Cook Chrome OS Security From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [2001:19d0:2:6:c0de::] (helo=smtp.outflux.net) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1UwB8j-0007yQ-Iw for linux-mtd@lists.infradead.org; Mon, 08 Jul 2013 13:06:01 +0000 Date: Mon, 8 Jul 2013 06:05:12 -0700 From: Kees Cook To: akpm@linux-foundation.org Subject: [RESEND][PATCH] mtd: refactor call to request_module Message-ID: <20130708130512.GA24315@www.outflux.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Cc: linux-mtd@lists.infradead.org, Rusty Russell , James Hogan , David Woodhouse , linux-kernel@vger.kernel.org List-Id: Linux MTD discussion mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , This reduces the size of the stack frame when calling request_module(). Performing the sprintf before the call is not needed. Signed-off-by: Kees Cook --- drivers/mtd/chips/gen_probe.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/mtd/chips/gen_probe.c b/drivers/mtd/chips/gen_probe.c index 74dbb6b..ffb36ba 100644 --- a/drivers/mtd/chips/gen_probe.c +++ b/drivers/mtd/chips/gen_probe.c @@ -211,9 +211,7 @@ static inline struct mtd_info *cfi_cmdset_unknown(struct map_info *map, probe_function = __symbol_get(probename); if (!probe_function) { - char modname[sizeof("cfi_cmdset_%4.4X")]; - sprintf(modname, "cfi_cmdset_%4.4X", type); - request_module(modname); + request_module("cfi_cmdset_%4.4X", type); probe_function = __symbol_get(probename); } -- 1.7.9.5 -- Kees Cook Chrome OS Security