Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S945352AbcJSPgW (ORCPT ); Wed, 19 Oct 2016 11:36:22 -0400 Received: from vader.hardeman.nu ([95.142.160.32]:52955 "EHLO hardeman.nu" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S942983AbcJSPbU (ORCPT ); Wed, 19 Oct 2016 11:31:20 -0400 Mime-Version: 1.0 Date: Wed, 19 Oct 2016 13:04:26 +0000 Content-Type: text/plain; charset="utf-8" Message-ID: <78ddb54d61d871ad4b81c986dd9a32d4@hardeman.nu> X-Mailer: RainLoop/1.10.3.151 From: "=?utf-8?B?RGF2aWQgSMOkcmRlbWFu?=" Subject: Re: [PATCH 2/5] [media] winbond-cir: Move a variable assignment in wbcir_tx() To: "SF Markus Elfring" , linux-media@vger.kernel.org, "Mauro Carvalho Chehab" , "Sean Young" Cc: "LKML" , kernel-janitors@vger.kernel.org, "Julia Lawall" In-Reply-To: <26ee4adb-2637-52c3-ac83-ae121bed5eff@users.sourceforge.net> References: <26ee4adb-2637-52c3-ac83-ae121bed5eff@users.sourceforge.net> <566ABCD9.1060404@users.sourceforge.net> <1d7d6a2c-0f1e-3434-9023-9eab25bb913f@users.sourceforge.net> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by mail.home.local id u9JFaQB7018270 Content-Length: 1310 Lines: 38 October 14, 2016 1:42 PM, "SF Markus Elfring" wrote: > From: Markus Elfring > Date: Fri, 14 Oct 2016 07:34:46 +0200 > > Move the assignment for the local variable "data" behind the source code > for a memory allocation by this function. Sorry, I can't see what the point is? > Signed-off-by: Markus Elfring > --- > drivers/media/rc/winbond-cir.c | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > > diff --git a/drivers/media/rc/winbond-cir.c b/drivers/media/rc/winbond-cir.c > index 59050f5..fd997f0 100644 > --- a/drivers/media/rc/winbond-cir.c > +++ b/drivers/media/rc/winbond-cir.c > @@ -655,7 +655,7 @@ wbcir_txmask(struct rc_dev *dev, u32 mask) > static int > wbcir_tx(struct rc_dev *dev, unsigned *b, unsigned count) > { > - struct wbcir_data *data = dev->priv; > + struct wbcir_data *data; > unsigned *buf; > unsigned i; > unsigned long flags; > @@ -668,6 +668,7 @@ wbcir_tx(struct rc_dev *dev, unsigned *b, unsigned count) > for (i = 0; i < count; i++) > buf[i] = DIV_ROUND_CLOSEST(b[i], 10); > > + data = dev->priv; > /* Not sure if this is possible, but better safe than sorry */ > spin_lock_irqsave(&data->spinlock, flags); > if (data->txstate != WBCIR_TXSTATE_INACTIVE) { > -- > 2.10.1