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: <2362b245-fcde-3327-11e1-f54985c95dd6@users.sourceforge.net>
Date:   Fri, 17 Nov 2017 10:50:23 +0100
From:   SF Markus Elfring <elfring@...rs.sourceforge.net>
To:     alsa-devel@...a-project.org, Bhumika Goyal <bhumirks@...il.com>,
        David Howells <dhowells@...hat.com>,
        Jaroslav Kysela <perex@...ex.cz>, Takashi Iwai <tiwai@...e.com>
Cc:     LKML <linux-kernel@...r.kernel.org>,
        kernel-janitors@...r.kernel.org
Subject: [PATCH 3/4] ALSA: riptide: Reduce the scope for two variables in
 snd_riptide_proc_read()

From: Markus Elfring <elfring@...rs.sourceforge.net>
Date: Fri, 17 Nov 2017 09:55:27 +0100

Move the definitions for the local variables "lval" and "rval" into
an if branch so that the corresponding setting will only be performed
on concrete demand in this function.

Signed-off-by: Markus Elfring <elfring@...rs.sourceforge.net>
---
 sound/pci/riptide/riptide.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/sound/pci/riptide/riptide.c b/sound/pci/riptide/riptide.c
index 3d00488ff137..774fba5bba48 100644
--- a/sound/pci/riptide/riptide.c
+++ b/sound/pci/riptide/riptide.c
@@ -1921,5 +1921,4 @@ snd_riptide_proc_read(struct snd_info_entry *entry,
 	unsigned char p[256];
-	unsigned short rval = 0, lval = 0;
 	unsigned int rate;
 
 	if (!chip)
@@ -1934,6 +1933,8 @@ snd_riptide_proc_read(struct snd_info_entry *entry,
 
 	cif = chip->cif;
 	if (cif) {
+		unsigned short rval = 0, lval = 0;
+
 		snd_iprintf(buffer,
 			    "\nVersion: ASIC: %d CODEC: %d AUXDSP: %d PROG: %d",
 			    chip->firmware.firmware.ASIC,
-- 
2.15.0

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ