From patchwork Wed Jun 16 06:37:02 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Leizhen \(ThunderTown\)" X-Patchwork-Id: 461360 Delivered-To: patch@linaro.org Received: by 2002:a02:735a:0:0:0:0:0 with SMTP id a26csp312937jae; Tue, 15 Jun 2021 23:38:04 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxzNI2nzYcX/x5wdhOw3gtEBZRBUqnCMWwWJ2ssFzk6HO2dY+MPrOSC1SCdfc1zA0blNwcD X-Received: by 2002:a05:6402:26ce:: with SMTP id x14mr2341596edd.104.1623825484030; Tue, 15 Jun 2021 23:38:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1623825484; cv=none; d=google.com; s=arc-20160816; b=d445QV3UTvTzaJbHyQ2GHg82LHx9UhSZzYU4Ax7d+EsDVDmozuKBR4q3nIDoSnsolY 92zSeuVLfYfUG39IlwjioAw2tqOmCrEXhtB4+/R9H5+KICBZudveam8Cel+O/gglsp3h 0Kceqmkm2o1ROv2loh/G3OEhLxPhGzYXetAGIvX+RcSBWZDJBe3jSQsN27b+Zdqz5Tq7 1k8zL/e4sn3A5TOCigAqz9YtBPVBVqg4D6i0QVNrTNzo1F6qAps2Rv+5o8quLt0rv+4r Is0hp/w2qWUXR3JnzNJglzpOdto/p/iGTCJA93fT+P49VDISFCx08vFUmNkyvOxRV5Hr nTNQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=qljcwFQV78Y88AC4hpvoOlCLZKrb5J3a93AnnzZhdsY=; b=q1hIBoXXx8Ms/pp/9fGu0O57Rcvzhie2HTrZ06E449CGIAcVqzurFQFl2QEZ87RjJ+ 1g+A57IdZirG/afGRbJxdLgeAv5n6G16dfgQhvRJ0N0z6B9yT+CyYrnO21rArzpwodJP KcjHI7gCNOgs3EYvJwQdzJs00jGP/zMmIa3ZOGZ7PA6IHM6HFEif6XElaizqUYPaHrJH F4F98GkP09vO10VTBAYgxcu5VlEbYPCzWUVTn+9aorC/vjQDPYTG0e5Y9RnETgI/Aryl tOYoNQWw4hvAlkhmvG8tyrwY4L2AhGjKZZ2sdkJytmJLMa39xNX4UkxZkyhHc66N9swz gSKQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-scsi-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-scsi-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=huawei.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id z16si1386040edb.194.2021.06.15.23.38.03 for ; Tue, 15 Jun 2021 23:38:04 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-scsi-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-scsi-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-scsi-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231532AbhFPGkI (ORCPT ); Wed, 16 Jun 2021 02:40:08 -0400 Received: from szxga02-in.huawei.com ([45.249.212.188]:4930 "EHLO szxga02-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231383AbhFPGkD (ORCPT ); Wed, 16 Jun 2021 02:40:03 -0400 Received: from dggemv704-chm.china.huawei.com (unknown [172.30.72.57]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4G4b5M2PVNz70MW; Wed, 16 Jun 2021 14:34:47 +0800 (CST) Received: from dggpemm500006.china.huawei.com (7.185.36.236) by dggemv704-chm.china.huawei.com (10.3.19.47) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2176.2; Wed, 16 Jun 2021 14:37:56 +0800 Received: from thunder-town.china.huawei.com (10.174.179.0) by dggpemm500006.china.huawei.com (7.185.36.236) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2176.2; Wed, 16 Jun 2021 14:37:56 +0800 From: Zhen Lei To: Vishal Bhakta , VMware PV-Drivers , Karan Tilak Kumar , "Sesidhar Baddela" , Nilesh Javali , GR-QLogic-Storage-Upstream , "Adaptec OEM Raid Solutions" , Brian King , Satish Kharat , Hannes Reinecke , "Manish Rangankar" , Adam Radford , "James E . J . Bottomley" , "Martin K . Petersen" , linux-scsi CC: Zhen Lei Subject: [PATCH v2 08/20] scsi: pmcraid: remove unnecessary oom message Date: Wed, 16 Jun 2021 14:37:02 +0800 Message-ID: <20210616063714.778-9-thunder.leizhen@huawei.com> X-Mailer: git-send-email 2.26.0.windows.1 In-Reply-To: <20210616063714.778-1-thunder.leizhen@huawei.com> References: <20210616063714.778-1-thunder.leizhen@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.174.179.0] X-ClientProxiedBy: dggems704-chm.china.huawei.com (10.3.19.181) To dggpemm500006.china.huawei.com (7.185.36.236) X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org Fixes scripts/checkpatch.pl warning: WARNING: Possible unnecessary 'out of memory' message Remove it can help us save a bit of memory. Signed-off-by: Zhen Lei --- drivers/scsi/pmcraid.c | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) -- 2.26.0.106.g9fadedd diff --git a/drivers/scsi/pmcraid.c b/drivers/scsi/pmcraid.c index bffd9a9349e7245..4754e72babc82cf 100644 --- a/drivers/scsi/pmcraid.c +++ b/drivers/scsi/pmcraid.c @@ -3601,11 +3601,8 @@ static long pmcraid_ioctl_passthrough( buffer_size = sizeof(struct pmcraid_passthrough_ioctl_buffer); buffer = kmalloc(buffer_size, GFP_KERNEL); - - if (!buffer) { - pmcraid_err("no memory for passthrough buffer\n"); + if (!buffer) return -ENOMEM; - } request_offset = offsetof(struct pmcraid_passthrough_ioctl_buffer, request_buffer); @@ -3903,11 +3900,8 @@ static long pmcraid_chr_ioctl( int retval = -ENOTTY; hdr = kmalloc(sizeof(struct pmcraid_ioctl_header), GFP_KERNEL); - - if (!hdr) { - pmcraid_err("failed to allocate memory for ioctl header\n"); + if (!hdr) return -ENOMEM; - } retval = pmcraid_check_ioctl_buffer(cmd, argp, hdr);