Skip to contentSkip to conversation

tpm: Remove unnecessary (void*) conversions

PATCH In review Su Hui 2 participants 2 messages Apr 27, 2023

Subsystems (2)
lore
Share & tools
lore

Su Hui

author
#0 lore raw

PATCH 1/1 tpm: Remove unnecessary (void*) conversions

From: Suhui <[email protected]>

No need cast (void*) to (struct seq_file*) or (struct tpm_chip*).

---
 drivers/char/tpm/eventlog/common.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/char/tpm/eventlog/common.c +2 -2
index 8512ec76d526..df6eb8167e30 100644
@@ -55,8 +55,8 @@ static int tpm_bios_measurements_open(struct inode *inode,
 static int tpm_bios_measurements_release(struct inode *inode,
 					 struct file *file)
 {
-	struct seq_file *seq = (struct seq_file *)file->private_data;
-	struct tpm_chip *chip = (struct tpm_chip *)seq->private;
+	struct seq_file *seq = file->private_data;
+	struct tpm_chip *chip = seq->private;
 
 	put_device(&chip->dev);
 
Signature · 1 line
2.30.2
maintainer
#1 lore raw
Quoted 14 lines · Su Hui

From: Suhui <[email protected]>

No need cast (void*) to (struct seq_file*) or (struct tpm_chip*).

---
 drivers/char/tpm/eventlog/common.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/char/tpm/eventlog/common.c +0 -0
index 8512ec76d526..df6eb8167e30 100644

drivers/char/tpm/eventlog/common.c static int tpm_bios_measurements_open(struct inode *inode, · line 62

Quoted 10 lines
drivers/char/tpm/eventlog/common.c +2 -2
@@ -55,8 +55,8 @@ static int tpm_bios_measurements_open(struct inode *inode,
 static int tpm_bios_measurements_release(struct inode *inode,
 					 struct file *file)
 {
-	struct seq_file *seq = (struct seq_file *)file->private_data;
-	struct tpm_chip *chip = (struct tpm_chip *)seq->private;
+	struct seq_file *seq = file->private_data;
+	struct tpm_chip *chip = seq->private;
 
 	put_device(&chip->dev);
 

And not enough value to remove casting as an independent change.

In future please check with scripts/get_maintainers.pl that you have all the mailing lists required. In this case you are missing linux-kernel and linux-integrity.

BR, Jarkko