From patchwork Fri Oct 14 11:42:16 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: SF Markus Elfring X-Patchwork-Id: 9376459 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id DDE2360779 for ; Fri, 14 Oct 2016 11:45:33 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id CD38E2A652 for ; Fri, 14 Oct 2016 11:45:33 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C08E02A65A; Fri, 14 Oct 2016 11:45:33 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 550D12A652 for ; Fri, 14 Oct 2016 11:45:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932105AbcJNLpA (ORCPT ); Fri, 14 Oct 2016 07:45:00 -0400 Received: from mout.web.de ([212.227.15.14]:58628 "EHLO mout.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754725AbcJNLm0 (ORCPT ); Fri, 14 Oct 2016 07:42:26 -0400 Received: from [192.168.1.2] ([78.49.117.2]) by smtp.web.de (mrweb003) with ESMTPSA (Nemesis) id 0MfYoV-1cJzsI3p2h-00P7ps; Fri, 14 Oct 2016 13:42:18 +0200 Subject: [PATCH 2/5] [media] winbond-cir: Move a variable assignment in wbcir_tx() To: linux-media@vger.kernel.org, =?UTF-8?Q?David_H=c3=a4rdeman?= , Mauro Carvalho Chehab , Sean Young References: <566ABCD9.1060404@users.sourceforge.net> <1d7d6a2c-0f1e-3434-9023-9eab25bb913f@users.sourceforge.net> Cc: LKML , kernel-janitors@vger.kernel.org, Julia Lawall From: SF Markus Elfring Message-ID: <26ee4adb-2637-52c3-ac83-ae121bed5eff@users.sourceforge.net> Date: Fri, 14 Oct 2016 13:42:16 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.4.0 MIME-Version: 1.0 In-Reply-To: <1d7d6a2c-0f1e-3434-9023-9eab25bb913f@users.sourceforge.net> X-Provags-ID: V03:K0:Nb4OIHSmFYipBLftJGWkV9884cX5Jf642U6mA+fj2T2Rj/6ApXp uoihWPrEaogeRneJ+YVOMSZ18k8na0bSKUITv7XnxKxSBMV+Py9NGAUZZPlO3eo0GlzTFuX Ef+s7vo+/wstQk10kTqIgBLsh9ZTP03Dc6AuiPPiXVe/FeiX8W2/ocogcO7VsYFpLOEgzkF ERm+4wmCSoldsAgc5IohA== X-UI-Out-Filterresults: notjunk:1; V01:K0:PlbRjRZn7q0=:/wDxMSfqCrrBdknpT+KKRe YK7je2AJeDliBOzwikFUbxflsGLzjWfuaLeLsrcN7YAx3Mzj1vsg5kjYGkz06Sanafkpyca54 aaM1Afz3O0D1LQCY+8bsfG4E/cEl0LH1vu4ba1oRyeqAJhGVB/QUt87nlXxPFw5nmRSybTD8p tNpOu3vxGj2cbKD8olY6rbl1N3+z41t1FcjkroBpsJ7bqfHQOE81RA0XtRz5titugiPmMqSXT A23PsVLLHYiDtmtuinPRDMS5SPqxNBa7wigdB0Vey6d9ae4t5iBeFAhht4E2XZpO9TUfrqAVl Iv+tvf4K83CMD2IQ+Ak5P3LbQoYlzLvQNHKOJDnNHH5BWTiX6/Ah0EedImlmWGB1iI8k/TqJ6 yiRipl4UBod307CEPfrAvaP63vMBnJRHifcIsjPzTHmX0DRyjVOMiNsyu2oaUFII/gsaBCfiF Ww8G9aHezdqkiWcaCALA+SSyeR8zWvZJGeqPWM8g4hCW/VVx9KUJlf57BBPZNX5+Z/usMazNv TPR8ynVXFiWqoGaRFToPTOse+Uu4UaNiH7KM3f1gp/w9tCiJMSVaHmqhwC7AV/yIbhAJwWZ9y yPos33R8S9Uc8+wOIqZtFsn2D+OnGLk+keY39zut32ssMHADSBfNShXDdQ75N3Kx0NcBj2Rxq hvhpX60M3LFP5WYw1k8GKNlU4aZRA3k6EBMsiXpEJecHX3ZDACy3ZdE4HgkJQpqYWggaLTbNC okI14YJXlxLwY877iYDwXsJTdPKGGekCce8mVpDooSRci+rdgbQEAEYlon4Kaij18CuoDKk7u WWAh9Vd Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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. 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) {