tpm, tpm_infineon: remove useless snprintf() calls
authorJarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
Wed, 24 May 2017 21:29:16 +0000 (14:29 -0700)
committerJarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
Tue, 13 Jun 2017 19:02:08 +0000 (22:02 +0300)
The memory copy from rodata to stack is useless.

Signed-off-by: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
Reviewed-by: Peter Huewe <peterhuewe@gmx.de>
drivers/char/tpm/tpm_infineon.c

index e3cf9f3545c57abfff68752effb73a4edff0c0bc..3b1b9f9322d5547120f35f490b7ec7b802d2b085 100644 (file)
@@ -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;
        }