Received: by 2002:a25:ca44:0:0:0:0:0 with SMTP id a65csp966430ybg; Wed, 29 Jul 2020 02:18:27 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxMg2SztTn2XH73gt5m9Ovy/t/nzdfBaZPv+bUIBbeSTbXhsIEdoge4RjcgVCy76tbTY16c X-Received: by 2002:a17:907:aaa:: with SMTP id bz10mr9269839ejc.304.1596014307623; Wed, 29 Jul 2020 02:18:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1596014307; cv=none; d=google.com; s=arc-20160816; b=jm7MZ+wYVi26MTaPmFQyaZJH+bCR+u+J9m7q2uO+r/zRaDEEeM1NuQ2hm7xnMn13Db NJhj9uI94Nl81pGM6n3BXKk5Yn2VOu1MDTS/8dVWZh6UQKSnF1aRdFrV5zSgqnQf0Jil LA7V+PGfl4QYfyEUIMjikUqrR2qJQ06aCxb/nvg1VMqqDH7QrZXOovZhHaQ2OsAUXHaY tHTCs71nxnB0EoZkNYwPyZ06bIgwHzLZhXPh6rfNUwTcHwzTt3XoEuL4fKhYJsveyMze Uqv9oSx8Rhica2+ir6bq0mWSYrmeNO4dCqX8Rnmcq3jdgUUCSn0v4XuXOSnBAdPEYNii 0CrA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:date:subject:cc :to:from; bh=6VHgmOnLmFUmwuY018HrjpriVGxjU8X8p7oIVjG6rX4=; b=JXZctoNXnuLzmgih5ARHquLFw1ovDRuEfcgqHlcyASfjsa3K8y2E/FPWxttYych0xh vOEKea9fXCO0VZT2M1VTuJ0/v/3T/sh0lJThBLN6q4/VtFPkJlodobA0A76nVqxKg7YH uMu9HlOQtwtDhEw2WZce2WStx50fvUE6/v4M6242LmeAN6LLt+n6nPky7BGic37SYGP1 MN2q+vyvwvq4H3l6s3c/ObHRFkdyvgisUNnXHqF1WozLos37JsHFzjs9adONqtuBkc3G wlhLlFgqp5payXp5ZtjWpvkc7UI/aGHz4Sl/5GPmSoqlLCCPDPMZArtV0XGqukJ1OasT VBgg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id v6si728555eju.570.2020.07.29.02.18.04; Wed, 29 Jul 2020 02:18:27 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-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-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728052AbgG2JR4 (ORCPT + 99 others); Wed, 29 Jul 2020 05:17:56 -0400 Received: from szxga04-in.huawei.com ([45.249.212.190]:8850 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727914AbgG2JRz (ORCPT ); Wed, 29 Jul 2020 05:17:55 -0400 Received: from DGGEMS405-HUB.china.huawei.com (unknown [172.30.72.58]) by Forcepoint Email with ESMTP id D9CD7C6CDDC368B2FDA7; Wed, 29 Jul 2020 17:17:52 +0800 (CST) Received: from huawei.com (10.175.104.57) by DGGEMS405-HUB.china.huawei.com (10.3.19.205) with Microsoft SMTP Server id 14.3.487.0; Wed, 29 Jul 2020 17:17:51 +0800 From: Li Heng To: , , CC: , , Subject: [PATCH -next] scsi: Remove unneeded cast from memory allocation Date: Wed, 29 Jul 2020 17:19:14 +0800 Message-ID: <1596014354-59935-1-git-send-email-liheng40@huawei.com> X-Mailer: git-send-email 2.7.4 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.175.104.57] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Remove casting the values returned by memory allocation function. Coccinelle emits WARNING: ./drivers/message/fusion/mptfc.c:766:17-30: WARNING: casting value returned by memory allocation function to (FCPortPage0_t *) is useless. ./drivers/message/fusion/mptfc.c:907:17-30: WARNING: casting value returned by memory allocation function to (FCPortPage1_t *) is useless. Signed-off-by: Li Heng --- drivers/message/fusion/mptfc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/message/fusion/mptfc.c b/drivers/message/fusion/mptfc.c index 4314a33..34ca9af 100644 --- a/drivers/message/fusion/mptfc.c +++ b/drivers/message/fusion/mptfc.c @@ -763,7 +763,7 @@ mptfc_GetFcPortPage0(MPT_ADAPTER *ioc, int portnum) data_sz = hdr.PageLength * 4; rc = -ENOMEM; - ppage0_alloc = (FCPortPage0_t *) pci_alloc_consistent(ioc->pcidev, data_sz, &page0_dma); + ppage0_alloc = pci_alloc_consistent(ioc->pcidev, data_sz, &page0_dma); if (ppage0_alloc) { try_again: @@ -904,7 +904,7 @@ mptfc_GetFcPortPage1(MPT_ADAPTER *ioc, int portnum) if (data_sz < sizeof(FCPortPage1_t)) data_sz = sizeof(FCPortPage1_t); - page1_alloc = (FCPortPage1_t *) pci_alloc_consistent(ioc->pcidev, + page1_alloc = pci_alloc_consistent(ioc->pcidev, data_sz, &page1_dma); if (!page1_alloc) -- 2.7.4