From patchwork Sun Aug 21 02:33:29 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shawn Lin X-Patchwork-Id: 9291931 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 52DB5600CB for ; Sun, 21 Aug 2016 02:38:08 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 47B6228B35 for ; Sun, 21 Aug 2016 02:38:08 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3C5EF28BD5; Sun, 21 Aug 2016 02:38:08 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E02C728B35 for ; Sun, 21 Aug 2016 02:38:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752193AbcHUChv (ORCPT ); Sat, 20 Aug 2016 22:37:51 -0400 Received: from lucky1.263xmail.com ([211.157.147.131]:47506 "EHLO lucky1.263xmail.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751764AbcHUChu (ORCPT ); Sat, 20 Aug 2016 22:37:50 -0400 Received: from shawn.lin?rock-chips.com (unknown [192.168.167.224]) by lucky1.263xmail.com (Postfix) with ESMTP id 7FBA68E875; Sun, 21 Aug 2016 10:37:43 +0800 (CST) X-263anti-spam: KSV:0; X-MAIL-GRAY: 1 X-MAIL-DELIVERY: 0 X-KSVirus-check: 0 X-ABS-CHECKED: 4 X-ADDR-CHECKED: 0 Received: from localhost.localdomain (localhost [127.0.0.1]) by smtp.263.net (Postfix) with ESMTP id 76060369; Sun, 21 Aug 2016 10:37:43 +0800 (CST) X-RL-SENDER: shawn.lin@rock-chips.com X-FST-TO: linuxdrivers@attotech.com X-SENDER-IP: 58.22.7.114 X-LOGIN-NAME: shawn.lin@rock-chips.com X-UNIQUE-TAG: X-ATTACHMENT-NUM: 0 X-SENDER: lintao@rock-chips.com X-DNS-TYPE: 0 Received: from localhost.localdomain (unknown [58.22.7.114]) by smtp.263.net (Postfix) whith ESMTP id 96015VXMCV; Sun, 21 Aug 2016 10:37:44 +0800 (CST) From: Shawn Lin To: Bradley Grove , jejb@linux.vnet.ibm.com, "Martin K. Petersen" Cc: linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org, Shawn Lin Subject: [PATCH] scsi: not need to alloc zero buffer for local_atto_ioctl Date: Sun, 21 Aug 2016 10:33:29 +0800 Message-Id: <1471746809-31218-1-git-send-email-shawn.lin@rock-chips.com> X-Mailer: git-send-email 1.8.0 Sender: linux-scsi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP We don't need to use kzalloc as we will always memset the local_atto_ioctl later. Signed-off-by: Shawn Lin Acked-by: Bradley Grove --- drivers/scsi/esas2r/esas2r_main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/scsi/esas2r/esas2r_main.c b/drivers/scsi/esas2r/esas2r_main.c index 2aca4d1..5092c82 100644 --- a/drivers/scsi/esas2r/esas2r_main.c +++ b/drivers/scsi/esas2r/esas2r_main.c @@ -194,7 +194,7 @@ static ssize_t write_hw(struct file *file, struct kobject *kobj, int length = min(sizeof(struct atto_ioctl), count); if (!a->local_atto_ioctl) { - a->local_atto_ioctl = kzalloc(sizeof(struct atto_ioctl), + a->local_atto_ioctl = kmalloc(sizeof(struct atto_ioctl), GFP_KERNEL); if (a->local_atto_ioctl == NULL) { esas2r_log(ESAS2R_LOG_WARN,