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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:	Mon, 13 Sep 2010 13:38:41 -0700
From:	Greg KH <gregkh@...e.de>
To:	Joe Perches <joe@...ches.com>
Cc:	linux-kernel@...r.kernel.org, linux-usb@...r.kernel.org
Subject: Re: [PATCH 20/25] drivers/usb: Use static const char arrays

On Mon, Sep 13, 2010 at 12:47:58PM -0700, Joe Perches wrote:
> 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');

I despise : ? logic wherever possible, so no, I will not take this
patch, sorry.

thanks,

greg k-h
--
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