From patchwork Thu Jun 10 08:03:35 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Leizhen \(ThunderTown\)" X-Patchwork-Id: 457826 Delivered-To: patch@linaro.org Received: by 2002:a02:735a:0:0:0:0:0 with SMTP id a26csp165789jae; Thu, 10 Jun 2021 01:04:20 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzykZuht9qj8EEHsmd3i7JUOLxLX9I6gLHcyLOGS1NSWAXneDOuyRKoCbsPhW7J+SiIan28 X-Received: by 2002:a17:906:19d0:: with SMTP id h16mr3361250ejd.193.1623312260122; Thu, 10 Jun 2021 01:04:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1623312260; cv=none; d=google.com; s=arc-20160816; b=UAnSGIzpEGwZW1WIEheq9P8nPYz8cKoQwRwA80AgMOt5kt0jQiQNMXjMfz1GQq+ZrE 77h0aczevtC6dV+09GaRksUiuO8jXgqTaYQ+UrD8fEi8PWb4peoLVKWqXe2DjLg5P6ts JIDlhHuJSMQwnhz5wqy8sNykBfTnYDMjZjX56JhSdpPjdJv1tfOPsKqKYjqOJXAGuXJz aSjpOHaARF42yjs4xI6NcdLj9U1+cc77nqsKr8pCkjeiAXxtvpxKCTwNLCIJO6eyZMCZ /u/DfnXZ7V9UfzJfje6MAWM0EK+XqE7LzR02Kd+cU3CeNmsxCxwfdTd7xws4bkyHx3WQ qqPQ== 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 :message-id:date:subject:cc:to:from; bh=qljcwFQV78Y88AC4hpvoOlCLZKrb5J3a93AnnzZhdsY=; b=qIxdoelfru3VhIusoRI9J6K0zkg1pmGzmbBJOWqwhkJYo70hJ1ddcgCz+7U3lxtMea ZlYsBe61Kk7CwkDZdvwxbNaGCaxRc0UykYkAC2/m0Ext8qjCkQjqMwUrJIdyEoPfc+Js ZT1CTLoyb3RiSyqrjySuNsztpeuiD/E/bysFAAYyrZttmyRMUEMPC1bWiElBfcOsteQQ 9wBJjoSJ6/k/lcqbIAIbFOZjXqrXH/YvMohhES/zJpKjvR1TxZcjZqcFnVDOcWAHXEvC rS7R4oZ0vbWbQCXKlzrKNVOObt1+S1hsETI9aYvpYU4IONTeqpTJhdWQayP/TYNRhasr F5xQ== 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 u11si1794275edx.42.2021.06.10.01.04.19 for ; Thu, 10 Jun 2021 01:04:20 -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 S230146AbhFJIFp (ORCPT ); Thu, 10 Jun 2021 04:05:45 -0400 Received: from szxga03-in.huawei.com ([45.249.212.189]:5367 "EHLO szxga03-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230184AbhFJIFo (ORCPT ); Thu, 10 Jun 2021 04:05:44 -0400 Received: from dggemv704-chm.china.huawei.com (unknown [172.30.72.56]) by szxga03-in.huawei.com (SkyGuard) with ESMTP id 4G0xGM1Pq8z6w68; Thu, 10 Jun 2021 15:59:55 +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; Thu, 10 Jun 2021 16:03:42 +0800 Received: from thunder-town.china.huawei.com (10.174.177.72) 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; Thu, 10 Jun 2021 16:03:42 +0800 From: Zhen Lei To: "James E . J . Bottomley" , "Martin K . Petersen" , linux-scsi CC: Zhen Lei Subject: [PATCH 1/1] scsi: pmcraid: remove unnecessary oom message Date: Thu, 10 Jun 2021 16:03:35 +0800 Message-ID: <20210610080335.16133-1-thunder.leizhen@huawei.com> X-Mailer: git-send-email 2.26.0.windows.1 MIME-Version: 1.0 X-Originating-IP: [10.174.177.72] X-ClientProxiedBy: dggems701-chm.china.huawei.com (10.3.19.178) 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);