Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1649985

Re: [PATCH] tpm, tpm_infineon: remove useless snprintf() calls

From Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
Newsgroups linux.kernel
Subject Re: [PATCH] tpm, tpm_infineon: remove useless snprintf() calls
Date 2017-05-25 00:00 +0200
Message-ID <tKMtX-7Lj-21@gated-at.bofh.it> (permalink)
References <tKMaC-7Ek-3@gated-at.bofh.it>
Organization Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo

Show all headers | View raw


On Wed, May 24, 2017 at 02:29:16PM -0700, Jarkko Sakkinen wrote:
> The memory copy from rodata to stack is useless.
> 
> Signed-off-by: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>

I already applied this, reviewed-by would be nice for this one but given
how obvious this change is, it is not mandatory. I take my chances on
this one as a maitainer.

/Jarkko

> ---
>  drivers/char/tpm/tpm_infineon.c | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/char/tpm/tpm_infineon.c b/drivers/char/tpm/tpm_infineon.c
> index e3cf9f3545c5..3b1b9f9322d5 100644
> --- a/drivers/char/tpm/tpm_infineon.c
> +++ b/drivers/char/tpm/tpm_infineon.c
> @@ -397,7 +397,7 @@ static int tpm_inf_pnp_probe(struct pnp_dev *dev,
>  	int vendorid[2];
>  	int version[2];
>  	int productid[2];
> -	char chipname[20];
> +	const char *chipname;
>  	struct tpm_chip *chip;
>  
>  	/* read IO-ports through PnP */
> @@ -488,13 +488,13 @@ static int tpm_inf_pnp_probe(struct pnp_dev *dev,
>  
>  	switch ((productid[0] << 8) | productid[1]) {
>  	case 6:
> -		snprintf(chipname, sizeof(chipname), " (SLD 9630 TT 1.1)");
> +		chipname = " (SLD 9630 TT 1.1)";
>  		break;
>  	case 11:
> -		snprintf(chipname, sizeof(chipname), " (SLB 9635 TT 1.2)");
> +		chipname = " (SLB 9635 TT 1.2)";
>  		break;
>  	default:
> -		snprintf(chipname, sizeof(chipname), " (unknown chip)");
> +		chipname = " (unknown chip)";
>  		break;
>  	}
>  
> -- 
> 2.11.0
> 

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH] tpm, tpm_infineon: remove useless snprintf() calls Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com> - 2017-05-24 23:40 +0200
  Re: [PATCH] tpm, tpm_infineon: remove useless snprintf() calls Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com> - 2017-05-25 00:00 +0200
    Aw: Re: [PATCH] tpm, tpm_infineon: remove useless snprintf() calls "Peter Huewe" <PeterHuewe@gmx.de> - 2017-05-25 07:40 +0200
      Re: Re: [PATCH] tpm, tpm_infineon: remove useless snprintf() calls Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com> - 2017-05-25 18:50 +0200

csiph-web