* [PATCH] drm: refactor call to request_module
@ 2013-05-07 19:32 Kees Cook
2013-05-08 7:22 ` Paul Menzel
0 siblings, 1 reply; 3+ messages in thread
From: Kees Cook @ 2013-05-07 19:32 UTC (permalink / raw)
To: linux-kernel; +Cc: David Airlie, dri-devel
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 <keescook@chromium.org>
---
drivers/gpu/drm/drm_encoder_slave.c | 6 +-----
1 file changed, 1 insertion(+), 5 deletions(-)
diff --git a/drivers/gpu/drm/drm_encoder_slave.c b/drivers/gpu/drm/drm_encoder_slave.c
index 48c52f7..0cfb60f 100644
--- a/drivers/gpu/drm/drm_encoder_slave.c
+++ b/drivers/gpu/drm/drm_encoder_slave.c
@@ -54,16 +54,12 @@ int drm_i2c_encoder_init(struct drm_device *dev,
struct i2c_adapter *adap,
const struct i2c_board_info *info)
{
- char modalias[sizeof(I2C_MODULE_PREFIX)
- + I2C_NAME_SIZE];
struct module *module = NULL;
struct i2c_client *client;
struct drm_i2c_encoder_driver *encoder_drv;
int err = 0;
- snprintf(modalias, sizeof(modalias),
- "%s%s", I2C_MODULE_PREFIX, info->type);
- request_module(modalias);
+ request_module("%s%s", I2C_MODULE_PREFIX, info->type);
client = i2c_new_device(adap, info);
if (!client) {
--
1.7.9.5
--
Kees Cook
Chrome OS Security
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] drm: refactor call to request_module
2013-05-07 19:32 [PATCH] drm: refactor call to request_module Kees Cook
@ 2013-05-08 7:22 ` Paul Menzel
2013-05-08 15:35 ` Kees Cook
0 siblings, 1 reply; 3+ messages in thread
From: Paul Menzel @ 2013-05-08 7:22 UTC (permalink / raw)
To: Kees Cook; +Cc: linux-kernel, dri-devel
[-- Attachment #1: Type: text/plain, Size: 689 bytes --]
Am Dienstag, den 07.05.2013, 12:32 -0700 schrieb Kees Cook:
> This reduces the size of the stack frame when calling request_module().
> Performing the sprintf before the call is not needed.
Good fine. Do you have any hard numbers for the record?
Did you find this just by reading the code or are there any problems
with stack sizes on some systems?
(This patch would be good alone for decreasing the number of code
lines. ;-))
> Signed-off-by: Kees Cook <keescook@chromium.org>
> ---
> drivers/gpu/drm/drm_encoder_slave.c | 6 +-----
> 1 file changed, 1 insertion(+), 5 deletions(-)
Acked-by: Paul Menzel <paulepanter@users.sourceforge.net>
Thanks,
Paul
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 198 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] drm: refactor call to request_module
2013-05-08 7:22 ` Paul Menzel
@ 2013-05-08 15:35 ` Kees Cook
0 siblings, 0 replies; 3+ messages in thread
From: Kees Cook @ 2013-05-08 15:35 UTC (permalink / raw)
To: Paul Menzel; +Cc: LKML, dri-devel
On Wed, May 8, 2013 at 12:22 AM, Paul Menzel
<paulepanter@users.sourceforge.net> wrote:
> Am Dienstag, den 07.05.2013, 12:32 -0700 schrieb Kees Cook:
>> This reduces the size of the stack frame when calling request_module().
>> Performing the sprintf before the call is not needed.
>
> Good fine. Do you have any hard numbers for the record?
>
> Did you find this just by reading the code or are there any problems
> with stack sizes on some systems?
>
> (This patch would be good alone for decreasing the number of code
> lines. ;-))
No hard numbers; I just saw it while reviewing callers to request_module(). :)
>> Signed-off-by: Kees Cook <keescook@chromium.org>
>> ---
>> drivers/gpu/drm/drm_encoder_slave.c | 6 +-----
>> 1 file changed, 1 insertion(+), 5 deletions(-)
>
> Acked-by: Paul Menzel <paulepanter@users.sourceforge.net>
Thanks!
-Kees
--
Kees Cook
Chrome OS Security
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2013-05-08 15:35 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-05-07 19:32 [PATCH] drm: refactor call to request_module Kees Cook
2013-05-08 7:22 ` Paul Menzel
2013-05-08 15:35 ` Kees Cook
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®