From: Michal MalĂ˝ Date: Tue, 26 Aug 2014 00:20:06 +0000 (+0200) Subject: Remove the helper variable X-Git-Url: https://gitweb.devoid-pointer.net/?a=commitdiff_plain;h=0eb7d4263fc223f61917a4cd0171f5c2464acf21;p=KLGD.git Remove the helper variable --- diff --git a/klgd.c b/klgd.c index 2050663..4586ec2 100644 --- a/klgd.c +++ b/klgd.c @@ -32,17 +32,16 @@ static void klgd_schedule_update(struct klgd_main_private *priv); struct klgd_command * klgd_alloc_cmd(const size_t length) { struct klgd_command *cmd = kzalloc(sizeof(struct klgd_command), GFP_KERNEL); - char *bytes; if (!cmd) return NULL; /* Cast away the const-ness */ - bytes = kzalloc(sizeof(char) * length, GFP_KERNEL); - if (!bytes) { + *(char **)(&cmd->bytes) = kzalloc(sizeof(char) * length, GFP_KERNEL); + if (!cmd->bytes) { kfree(cmd); return NULL; } - *(char **)(&cmd->bytes) = bytes; + cmd->length = length; return cmd; }