[PATCH] scsi: aic7xxx: Use kmemdup instead of duplicating its function

2018-12-06 Thread Wen Yang
kmemdup has implemented the function that kmalloc() + memcpy(). We prefer to kmemdup rather than code opened implementation. This issue was detected with the help of coccinelle. Signed-off-by: Wen Yang CC: Hannes Reinecke CC: "James E.J. Bottomley" CC: "Martin K. Petersen" CC: linux-scsi@vger

[PATCH] [SCSI] aic7xxx: use kmemdup

2016-05-19 Thread Muhammad Falak R Wani
Use kmemdup when some other buffer is immediately copied into allocated region. It replaces call to allocation followed by memcpy, by a single call to kmemdup. Signed-off-by: Muhammad Falak R Wani --- drivers/scsi/aic7xxx/aic7xxx_core.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)