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-next>] [day] [month] [year] [list]
Message-Id: <d366844155ca5af8525058f3376737ad7f94943e.1284406639.git.joe@perches.com>
Date:	Mon, 13 Sep 2010 12:47:58 -0700
From:	Joe Perches <joe@...ches.com>
To:	linux-kernel@...r.kernel.org
Cc:	Greg Kroah-Hartman <gregkh@...e.de>, linux-usb@...r.kernel.org
Subject: [PATCH 20/25] drivers/usb: Use static const char arrays

Signed-off-by: Joe Perches <joe@...ches.com>
---
 drivers/usb/atm/ueagle-atm.c   |   14 +++++---------
 drivers/usb/otg/langwell_otg.c |    2 +-
 2 files changed, 6 insertions(+), 10 deletions(-)

diff --git a/drivers/usb/atm/ueagle-atm.c b/drivers/usb/atm/ueagle-atm.c
index ea071a5..00d2516 100644
--- a/drivers/usb/atm/ueagle-atm.c
+++ b/drivers/usb/atm/ueagle-atm.c
@@ -1574,20 +1574,16 @@ static int uea_stat_e4(struct uea_softc *sc)
 
 static void cmvs_file_name(struct uea_softc *sc, char *const cmv_name, int ver)
 {
-	char file_arr[] = "CMVxy.bin";
+	char file_arr[sizeof("CMVxy.bin")];
 	char *file;
 
 	kparam_block_sysfs_write(cmv_file);
 	/* set proper name corresponding modem version and line type */
 	if (cmv_file[sc->modem_index] == NULL) {
-		if (UEA_CHIP_VERSION(sc) == ADI930)
-			file_arr[3] = '9';
-		else if (UEA_CHIP_VERSION(sc) == EAGLE_IV)
-			file_arr[3] = '4';
-		else
-			file_arr[3] = 'e';
-
-		file_arr[4] = IS_ISDN(sc) ? 'i' : 'p';
+		sprintf(file_arr, "CMV%c%c.bin",
+			(UEA_CHIP_VERSION(sc) == ADI930) ? '9' :
+			(UEA_CHIP_VERSION(sc) == EAGLE_IV) ? '4' : 'e',
+			IS_ISDN(sc) ? 'i' : 'p');
 		file = file_arr;
 	} else
 		file = cmv_file[sc->modem_index];
diff --git a/drivers/usb/otg/langwell_otg.c b/drivers/usb/otg/langwell_otg.c
index 8791880..ce01172 100644
--- a/drivers/usb/otg/langwell_otg.c
+++ b/drivers/usb/otg/langwell_otg.c
@@ -2035,7 +2035,7 @@ static int langwell_otg_probe(struct pci_dev *pdev,
 	int			retval;
 	u32			val32;
 	struct langwell_otg	*lnw;
-	char			qname[] = "langwell_otg_queue";
+	static const char	qname[] = "langwell_otg_queue";
 
 	retval = 0;
 	dev_dbg(&pdev->dev, "\notg controller is detected.\n");
-- 
1.7.3.rc1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ