drm: refactor call to request_module

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>
Acked-by: Paul Menzel <paulepanter@users.sourceforge.net>
Signed-off-by: Dave Airlie <airlied@redhat.com>
This commit is contained in:
Kees Cook 2013-05-07 12:32:16 -07:00 committed by Dave Airlie
parent ebbd97ad88
commit d1fd3ddc46

View file

@ -54,16 +54,12 @@ int drm_i2c_encoder_init(struct drm_device *dev,
struct i2c_adapter *adap, struct i2c_adapter *adap,
const struct i2c_board_info *info) const struct i2c_board_info *info)
{ {
char modalias[sizeof(I2C_MODULE_PREFIX)
+ I2C_NAME_SIZE];
struct module *module = NULL; struct module *module = NULL;
struct i2c_client *client; struct i2c_client *client;
struct drm_i2c_encoder_driver *encoder_drv; struct drm_i2c_encoder_driver *encoder_drv;
int err = 0; int err = 0;
snprintf(modalias, sizeof(modalias), request_module("%s%s", I2C_MODULE_PREFIX, info->type);
"%s%s", I2C_MODULE_PREFIX, info->type);
request_module(modalias);
client = i2c_new_device(adap, info); client = i2c_new_device(adap, info);
if (!client) { if (!client) {