[PATCH 20/25] drivers/usb: Use static const char arrays

From: Joe Perches
Date: Mon Sep 13 2010 - 15:50:14 EST


Signed-off-by: Joe Perches <joe@xxxxxxxxxxx>
---
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@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/