lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <0b6de919-35a0-8ee3-9ea7-907c9b9a36f2@users.sourceforge.net>
Date:   Fri, 14 Oct 2016 13:45:32 +0200
From:   SF Markus Elfring <elfring@...rs.sourceforge.net>
To:     linux-media@...r.kernel.org,
        David Härdeman <david@...deman.nu>,
        Mauro Carvalho Chehab <mchehab@...nel.org>,
        Sean Young <sean@...s.org>
Cc:     LKML <linux-kernel@...r.kernel.org>,
        kernel-janitors@...r.kernel.org,
        Julia Lawall <julia.lawall@...6.fr>
Subject: [PATCH 5/5] [media] winbond-cir: Move a variable assignment in two
 functions

From: Markus Elfring <elfring@...rs.sourceforge.net>
Date: Fri, 14 Oct 2016 13:13:11 +0200

Move the assignment for the local variable "data" behind the source code
for condition checks by these functions.

Signed-off-by: Markus Elfring <elfring@...rs.sourceforge.net>
---
 drivers/media/rc/winbond-cir.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/media/rc/winbond-cir.c b/drivers/media/rc/winbond-cir.c
index 3d286b9..716b1fe 100644
--- a/drivers/media/rc/winbond-cir.c
+++ b/drivers/media/rc/winbond-cir.c
@@ -566,7 +566,7 @@ wbcir_set_carrier_report(struct rc_dev *dev, int enable)
 static int
 wbcir_txcarrier(struct rc_dev *dev, u32 carrier)
 {
-	struct wbcir_data *data = dev->priv;
+	struct wbcir_data *data;
 	unsigned long flags;
 	u8 val;
 	u32 freq;
@@ -592,6 +592,7 @@ wbcir_txcarrier(struct rc_dev *dev, u32 carrier)
 		break;
 	}
 
+	data = dev->priv;
 	spin_lock_irqsave(&data->spinlock, flags);
 	if (data->txstate != WBCIR_TXSTATE_INACTIVE) {
 		spin_unlock_irqrestore(&data->spinlock, flags);
@@ -611,7 +612,7 @@ wbcir_txcarrier(struct rc_dev *dev, u32 carrier)
 static int
 wbcir_txmask(struct rc_dev *dev, u32 mask)
 {
-	struct wbcir_data *data = dev->priv;
+	struct wbcir_data *data;
 	unsigned long flags;
 	u8 val;
 
@@ -637,6 +638,7 @@ wbcir_txmask(struct rc_dev *dev, u32 mask)
 		return -EINVAL;
 	}
 
+	data = dev->priv;
 	spin_lock_irqsave(&data->spinlock, flags);
 	if (data->txstate != WBCIR_TXSTATE_INACTIVE) {
 		spin_unlock_irqrestore(&data->spinlock, flags);
-- 
2.10.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ