Re: [PATCH] tpm: Drop explicit initialization of struct i2c_device_id::driver_data to 0

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri Sep 6, 2024 at 7:33 PM EEST, Uwe Kleine-König wrote:
> These drivers don't use the driver_data member of struct i2c_device_id,
> so don't explicitly initialize this member.
>
> This prepares putting driver_data in an anonymous union which requires
> either no initialization or named designators. But it's also a nice
> cleanup on its own.
>
> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@xxxxxxxxxxxx>

I think that works for me as a rationale.

> ---
>  drivers/char/tpm/st33zp24/i2c.c  | 2 +-
>  drivers/char/tpm/tpm_i2c_atmel.c | 2 +-
>  drivers/char/tpm/tpm_tis_i2c.c   | 2 +-
>  3 files changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/char/tpm/st33zp24/i2c.c b/drivers/char/tpm/st33zp24/i2c.c
> index 45ca33b3dcb2..81348487c125 100644
> --- a/drivers/char/tpm/st33zp24/i2c.c
> +++ b/drivers/char/tpm/st33zp24/i2c.c
> @@ -133,7 +133,7 @@ static void st33zp24_i2c_remove(struct i2c_client *client)
>  }
>  
>  static const struct i2c_device_id st33zp24_i2c_id[] = {
> -	{TPM_ST33_I2C, 0},
> +	{ TPM_ST33_I2C },
>  	{}
>  };
>  MODULE_DEVICE_TABLE(i2c, st33zp24_i2c_id);
> diff --git a/drivers/char/tpm/tpm_i2c_atmel.c b/drivers/char/tpm/tpm_i2c_atmel.c
> index 301a95b3734f..d1d27fdfe523 100644
> --- a/drivers/char/tpm/tpm_i2c_atmel.c
> +++ b/drivers/char/tpm/tpm_i2c_atmel.c
> @@ -186,7 +186,7 @@ static void i2c_atmel_remove(struct i2c_client *client)
>  }
>  
>  static const struct i2c_device_id i2c_atmel_id[] = {
> -	{I2C_DRIVER_NAME, 0},
> +	{ I2C_DRIVER_NAME },
>  	{}
>  };
>  MODULE_DEVICE_TABLE(i2c, i2c_atmel_id);
> diff --git a/drivers/char/tpm/tpm_tis_i2c.c b/drivers/char/tpm/tpm_tis_i2c.c
> index 9511c0d50185..6cd07dd34507 100644
> --- a/drivers/char/tpm/tpm_tis_i2c.c
> +++ b/drivers/char/tpm/tpm_tis_i2c.c
> @@ -375,7 +375,7 @@ static void tpm_tis_i2c_remove(struct i2c_client *client)
>  }
>  
>  static const struct i2c_device_id tpm_tis_i2c_id[] = {
> -	{ "tpm_tis_i2c", 0 },
> +	{ "tpm_tis_i2c" },
>  	{}
>  };
>  MODULE_DEVICE_TABLE(i2c, tpm_tis_i2c_id);
>
> base-commit: 9aaeb87ce1e966169a57f53a02ba05b30880ffb8

Reviewed-by: Jarkko Sakkinen <jarkko@xxxxxxxxxx>

BR, Jarkko





[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux Kernel]     [Linux Kernel Hardening]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux SCSI]

  Powered by Linux