[PATCH v2] 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&q

[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&q

[PATCH] scsi: message: fusion: 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: Sathya Prakash CC: Chaitra P B CC: Suganath Prabu Subramani CC: mpt-fusionlinux

[PATCH] scsi: aic7xxx: Remove unnecessary NULL check before kfree

2018-12-05 Thread Wen Yang
kfree(NULL) is safe, so removes NULL check before freeing the mem. This patch also fix the ifnullfree.cocci warnings. Signed-off-by: Wen Yang CC: Alex Deucher CC: Hannes Reinecke CC: "James E.J. Bottomley" CC: "Martin K. Petersen" CC: linux-scsi@vger.kern

[PATCH] scsi: wd719x: Fix sleeping under a spinlock

2018-12-04 Thread Wen Yang
ep parameter into the wd719x_chip_init() function. When we have spinlock and can't sleep, we pass in 0; in other cases, we pass in 1. Signed-off-by: Wen Yang CC: "James E.J. Bottomley" CC: "Martin K. Petersen" CC: linux-scsi@vger.kernel.org CC: linux-ker...@vger.kern

[PATCH] scsi: Fix bad alignments

2018-11-28 Thread Wen Yang
line 1827 Signed-off-by: Wen Yang CC: Julia Lawall CC: "James E.J. Bottomley" CC: "Martin K. Petersen" CC: Willem Riede CC: Kashyap Desai CC: Shivasharan S CC: linux-scsi@vger.kernel.org CC: linux-ker...@vger.kernel.org --- drivers/scsi/megaraid/megaraid_sas_base.c |

[PATCH] scsi: Fix semicolon.cocci warnings

2018-11-28 Thread Wen Yang
: Unneeded semicolon drivers/scsi/aha1542.c:640:2-3: Unneeded semicolon drivers/scsi/aha1542.c:464:3-4: Unneeded semicolon drivers/scsi/aha1542.c:476:2-3: Unneeded semicolon drivers/scsi/aha1542.c:506:2-3: Unneeded semicolon Generated by: scripts/coccinelle/misc/semicolon.cocci Signed-off-by: Wen Yang CC

[PATCH] scsi: qla2xxx: Use PTR_ERR_OR_ZERO to replace the open coded version

2018-11-27 Thread Wen Yang
PTR_ERR_OR_ZERO has implemented the same function, so use inlined function instead of open coded equivalent. Signed-off-by: Wen Yang CC: "James E.J. Bottomley" CC: "Martin K. Petersen" CC: qla2xxx-upstr...@qlogic.com CC: linux-scsi@vger.kernel.org CC: Wen Yang CC: linux-ke

[PATCH] scsi: ufs: Use PTR_ERR_OR_ZERO to replace the open coded version

2018-11-26 Thread Wen Yang
PTR_ERR_OR_ZERO has implemented the same function, so use inlined function instead of open coded equivalent. Signed-off-by: Wen Yang CC: Vinayak Holikatti CC: "James E.J. Bottomley" CC: "Martin K. Petersen" CC: linux-scsi@vger.kernel.org CC: Wen Yang CC: linux-ke

[PATCH v3] scsi: Introduce sdev_printk_ratelimited to throttle frequent printk

2018-04-02 Thread Wen Yang
printk, it's useless to print the same lines frequently after all. v2: fix some typos v3: limit the print only for the same device Suggested-by: Petr Mladek Suggested-by: Sergey Senozhatsky Signed-off-by: Wen Yang Signed-off-by: Jiang Biao Signed-off-by: Tan Hu Reviewed-by: Bart Van Assch

[PATCH v2] scsi: Introduce sdev_printk_ratelimited to throttle frequent printk

2018-04-01 Thread Wen Yang
printk, it's useless to print the same lines frequently after all. v2->v1: fix some typos Suggested-by: Petr Mladek Suggested-by: Sergey Senozhatsky Signed-off-by: Wen Yang Signed-off-by: Jiang Biao Signed-off-by: Tan Hu CC: BartVanAssche CC: Petr Mladek CC: Sergey Senozhatsky CC:

[PATCH] scsi: Introduce sdev_printk_ratelimited to throttle frequent printk

2018-03-28 Thread Wen Yang
x27;s useless to print the same lines frequently after all. Suggested-by: Petr Mladek Suggested-by: Sergey Senozhatsky Signed-off-by: Wen Yang Signed-off-by: Jiang Biao Signed-off-by: Tan Hu CC: BartVanAssche CC: Petr Mladek CC: Sergey Senozhatsky CC: Martin K. Petersen CC: "

[PATCH] scsi: Replace sdev_printk with printk_deferred to avoid

2018-03-08 Thread Wen Yang
ng because of the slow serial and unstable disks in such senario. Signed-off-by: Wen Yang Signed-off-by: Jiang Biao --- drivers/scsi/scsi_lib.c | 18 -- 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/drivers/scsi/scsi_lib.c b/drivers/scsi/scsi_lib.c index a86df9c..