]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
tpm: loongson: Add bufsiz parameter to tpm_loongson_send()
authorNathan Chancellor <nathan@kernel.org>
Wed, 17 Sep 2025 17:09:00 +0000 (10:09 -0700)
committerLee Jones <lee@kernel.org>
Thu, 25 Sep 2025 11:45:03 +0000 (12:45 +0100)
Commit 5c83b07df9c5 ("tpm: Add a driver for Loongson TPM device") has a
semantic conflict with commit 07d8004d6fb9 ("tpm: add bufsiz parameter
in the .send callback"), as the former change was developed against a
tree without the latter change. This results in a build error:

  drivers/char/tpm/tpm_loongson.c:48:17: error: initialization of 'int (*)(struct tpm_chip *, u8 *, size_t,  size_t)' {aka 'int (*)(struct tpm_chip *, unsigned char *, long unsigned int,  long unsigned int)'} from incompatible pointer type 'int (*)(struct tpm_chip *, u8 *, size_t)' {aka 'int (*)(struct tpm_chip *, unsigned char *, long unsigned int)'} [-Wincompatible-pointer-types]
     48 |         .send = tpm_loongson_send,
        |                 ^~~~~~~~~~~~~~~~~
  drivers/char/tpm/tpm_loongson.c:48:17: note: (near initialization for 'tpm_loongson_ops.send')
  drivers/char/tpm/tpm_loongson.c:31:12: note: 'tpm_loongson_send' declared here
     31 | static int tpm_loongson_send(struct tpm_chip *chip, u8 *buf, size_t count)
        |            ^~~~~~~~~~~~~~~~~

Add the expected bufsiz parameter to tpm_loongson_send() to resolve the
error.

Fixes: 5c83b07df9c5 ("tpm: Add a driver for Loongson TPM device")
Signed-off-by: Nathan Chancellor <nathan@kernel.org>
Reviewed-by: Jarkko Sakkinen <jarkko@kernel.org>
Signed-off-by: Lee Jones <lee@kernel.org>
drivers/char/tpm/tpm_loongson.c

index a4ec23639911ceb55dbe88b23365c066985858ee..9e50250763d16b2c52c0dcf1347eb6c7f98eeecd 100644 (file)
@@ -28,7 +28,7 @@ static int tpm_loongson_recv(struct tpm_chip *chip, u8 *buf, size_t count)
        return cmd_ret->data_len;
 }
 
-static int tpm_loongson_send(struct tpm_chip *chip, u8 *buf, size_t count)
+static int tpm_loongson_send(struct tpm_chip *chip, u8 *buf, size_t bufsiz, size_t count)
 {
        struct loongson_se_engine *tpm_engine = dev_get_drvdata(&chip->dev);
        struct tpm_loongson_cmd *cmd = tpm_engine->command;