From: Greg KH <gregkh@suse.de>
To: Joe Perches <joe@perches.com>
Cc: linux-kernel@vger.kernel.org, linux-usb@vger.kernel.org
Subject: Re: [PATCH 20/25] drivers/usb: Use static const char arrays
Date: Mon, 13 Sep 2010 13:38:41 -0700 [thread overview]
Message-ID: <20100913203841.GA17589@suse.de> (raw)
In-Reply-To: <d366844155ca5af8525058f3376737ad7f94943e.1284406639.git.joe@perches.com>
On Mon, Sep 13, 2010 at 12:47:58PM -0700, Joe Perches wrote:
> Signed-off-by: Joe Perches <joe@perches.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');
I despise : ? logic wherever possible, so no, I will not take this
patch, sorry.
thanks,
greg k-h
next prev parent reply other threads:[~2010-09-13 20:39 UTC|newest]
Thread overview: 51+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <cover.1284406638.git.joe@perches.com>
2010-09-13 19:47 ` [PATCH 01/25] arch/mips: Use static const char arrays Joe Perches
2010-09-18 22:54 ` Ralf Baechle
2010-09-18 23:44 ` Joe Perches
2010-09-13 19:47 ` [PATCH 02/25] arch/powerpc: " Joe Perches
2010-09-14 2:02 ` Stephen Rothwell
2010-09-14 2:04 ` Stephen Rothwell
2010-09-13 19:47 ` [PATCH 03/25] drivers/acpi: " Joe Perches
2010-09-13 19:47 ` [PATCH 04/25] drivers/char: " Joe Perches
2010-09-14 2:06 ` Stephen Rothwell
2010-09-13 19:47 ` [PATCH 05/25] drivers/i2c: " Joe Perches
2010-09-13 19:56 ` Russell King - ARM Linux
2010-09-13 20:08 ` Jonathan Cameron
2010-09-13 20:16 ` Joe Perches
2010-09-14 7:36 ` Lothar Waßmann
2010-09-14 12:57 ` Jonathan Cameron
2010-09-14 19:48 ` Russell King - ARM Linux
2010-09-14 23:23 ` Ben Dooks
2010-09-13 19:47 ` [PATCH 06/25] drivers/isdn: " Joe Perches
2010-09-13 19:47 ` [PATCH 07/25] drivers/media: " Joe Perches
2010-09-13 21:50 ` Mauro Carvalho Chehab
2010-09-13 22:07 ` [PATCH 07/25] drivers/media/video/zoran: Don't use initialized char array Joe Perches
2010-09-13 19:47 ` [PATCH 08/25] drivers/net/atl1c: Use static const char arrays Joe Perches
2010-09-13 19:47 ` [PATCH 09/25] drivers/net/atl1e: " Joe Perches
2010-09-13 19:47 ` [PATCH 10/25] drivers/net/(intel): " Joe Perches
2010-09-13 19:47 ` [PATCH 11/25] drivers/net/netxen: " Joe Perches
2010-09-13 19:47 ` [PATCH 12/25] drivers/net/qlcnic: " Joe Perches
2010-09-13 19:47 ` [PATCH 13/25] drivers/net/spider_net.c: " Joe Perches
2010-09-13 19:47 ` [PATCH 14/25] drivers/net/vnxnet3: " Joe Perches
2010-09-13 19:50 ` [Pv-drivers] " Bhavesh Davda
2010-09-13 20:07 ` Shreyas Bhatewara
2010-09-13 19:47 ` [PATCH 15/25] drivers/net/wireless/ipw2x00: " Joe Perches
2010-09-14 18:41 ` John W. Linville
2010-09-13 19:47 ` [PATCH 16/25] drivers/s390/char: " Joe Perches
2010-09-13 19:47 ` [PATCH 17/25] drivers/scsi: " Joe Perches
2010-09-13 19:47 ` [PATCH 18/25] drivers/serial/suncore.c: " Joe Perches
2010-09-13 20:36 ` Alan Cox
2010-09-13 20:22 ` Joe Perches
2010-09-13 21:11 ` Nick Bowler
2010-09-13 21:17 ` Joe Perches
2010-09-13 19:47 ` [PATCH 19/25] drivers/staging: " Joe Perches
2010-09-13 19:47 ` [PATCH 20/25] drivers/usb: " Joe Perches
2010-09-13 20:38 ` Greg KH [this message]
2010-09-13 19:47 ` [PATCH 21/25] drivers/video: " Joe Perches
2010-09-15 19:02 ` James Simmons
2010-09-13 19:48 ` [PATCH 22/25] net/dsa: " Joe Perches
2010-09-13 19:48 ` [PATCH 23/25] net/sunrpc: " Joe Perches
2010-09-13 19:48 ` [PATCH 24/25] sound: " Joe Perches
2010-09-13 20:30 ` Takashi Iwai
2010-09-13 20:47 ` Joe Perches
2010-09-13 21:33 ` Takashi Iwai
2010-09-13 19:48 ` [PATCH 25/25] tools/perf/util: " Joe Perches
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20100913203841.GA17589@suse.de \
--to=gregkh@suse.de \
--cc=joe@perches.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox