[PATCH v3] staging: dgnc: Replace kzalloc with kcalloc

Roberta Dobrescu roberta.dobrescu at gmail.com
Tue Sep 16 22:25:18 EEST 2014


This fixes the following checkpatch.pl warnings:
WARNING: Prefer kcalloc over kzalloc with multiply

Additionally fix the warnings about lines over 80 characters:
WARNING: line over 80 characters

Signed-off-by: Roberta Dobrescu <roberta.dobrescu at gmail.com>
---
Changes since v1:
        -change patch subject with a more specific one

Changes since v2:
        -add newlines in order to not exceed 80 characters

 drivers/staging/dgnc/dgnc_tty.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/dgnc/dgnc_tty.c b/drivers/staging/dgnc/dgnc_tty.c
index 639f970..7602cdf 100644
--- a/drivers/staging/dgnc/dgnc_tty.c
+++ b/drivers/staging/dgnc/dgnc_tty.c
@@ -268,11 +268,15 @@ int dgnc_tty_register(struct dgnc_board *brd)
 	 * tty_struct's and termios's.  Must be separated from
 	 * the Serial Driver so we don't get confused
 	 */
-	brd->PrintDriver.ttys = kzalloc(brd->maxports * sizeof(*brd->PrintDriver.ttys), GFP_KERNEL);
+	brd->PrintDriver.ttys = kcalloc(brd->maxports,
+					sizeof(*brd->PrintDriver.ttys),
+					GFP_KERNEL);
 	if (!brd->PrintDriver.ttys)
 		return -ENOMEM;
 	kref_init(&brd->PrintDriver.kref);
-	brd->PrintDriver.termios = kzalloc(brd->maxports * sizeof(*brd->PrintDriver.termios), GFP_KERNEL);
+	brd->PrintDriver.termios = kcalloc(brd->maxports,
+					   sizeof(*brd->PrintDriver.termios),
+					   GFP_KERNEL);
 	if (!brd->PrintDriver.termios)
 		return -ENOMEM;
 
-- 
1.9.1



More information about the firefly mailing list