Skip to contentSkip to conversation

scsi: fnic: delete the useless casting value returned

PATCH Applied Wang Qing 2 participants 2 messages Mar 12, 2021 – Mar 30, 2021

Subsystems (2)
lore
Share & tools
lore

Wang Qing

author
#0 lore raw

PATCH 1/1 scsi: fnic: delete the useless casting value returned

Fix the following coccicheck warning:
WARNING: casting value returned by memory allocation function is useless.

---
 drivers/scsi/fnic/fnic_debugfs.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/scsi/fnic/fnic_debugfs.c +1 -2
index 6c04936..e732650
@@ -58,8 +58,7 @@ int fnic_debugfs_init(void)
 						fnic_trace_debugfs_root);
 
 	/* Allocate memory to structure */
-	fc_trc_flag = (struct fc_trace_flag_type *)
-		vmalloc(sizeof(struct fc_trace_flag_type));
+	fc_trc_flag = vmalloc(sizeof(struct fc_trace_flag_type));
 
 	if (fc_trc_flag) {
 		fc_trc_flag->fc_row_file = 0;
Signature · 1 line
2.7.4
#1 lore raw
Quoted 2 lines · Wang Qing

Fix the following coccicheck warning:
WARNING: casting value returned by memory allocation function is useless.

Applied to 5.13/scsi-queue, thanks!

[1/1] scsi: fnic: delete the useless casting value returned

      https://git.kernel.org/mkp/scsi/c/3ba9f38ed43d
Signature · 1 line
Martin K. Petersen	Oracle Linux Engineering