diff mbox series

scsi: fnic: delete the useless casting value returned

Message ID 1615515500-946-1-git-send-email-wangqing@vivo.com (mailing list archive)
State Accepted
Headers show
Series scsi: fnic: delete the useless casting value returned | expand

Commit Message

王擎 March 12, 2021, 2:18 a.m. UTC
Fix the following coccicheck warning:
WARNING: casting value returned by memory allocation function is useless.

Signed-off-by: Wang Qing <wangqing@vivo.com>
---
 drivers/scsi/fnic/fnic_debugfs.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

Comments

Martin K. Petersen March 30, 2021, 3:54 a.m. UTC | #1
On Fri, 12 Mar 2021 10:18:19 +0800, Wang Qing wrote:

> 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
diff mbox series

Patch

diff --git a/drivers/scsi/fnic/fnic_debugfs.c b/drivers/scsi/fnic/fnic_debugfs.c
index 6c04936..e732650
--- a/drivers/scsi/fnic/fnic_debugfs.c
+++ b/drivers/scsi/fnic/fnic_debugfs.c
@@ -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;