Received: by 2002:a25:ca44:0:0:0:0:0 with SMTP id a65csp966919ybg; Wed, 29 Jul 2020 02:19:23 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzdndgd7Ver6xRPdKNYRE9MmeeeLNTG+Un6Qk/lfimUfP+U+GdZCmF/vOFoWzDnI68pM9kT X-Received: by 2002:aa7:d2d2:: with SMTP id k18mr28983008edr.16.1596014362698; Wed, 29 Jul 2020 02:19:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1596014362; cv=none; d=google.com; s=arc-20160816; b=gMLzC7lVa3Oi/FrP3AaXtzHlI56qmch+jqpdsZYBQZn4yWAw4aOdzgkILmbiND6o0x xwNi5mBrrYSYVRczBefFNhQmRT9mE92MaJHjlTWHB8Z4sCysU9ydT2+7/5f9+9Bk+lz8 crBtCMiRihTrkzYA5ofwRWUFozERXd/fDr8n+Q3tR4rpVVFgSYovd7xJW9BS3BXhtGDK YtAsHrqOarjm9YEexZnY6EJbPcZQlq1/uE3updeEAmJ7vgyBnfadZ8dF0J7JfuQI2+Yy FBWgOKx3QtLEvDo1jbYA9gYbQmPQRDM3+DjNkSQTvEfNHEK7ydgJDmf2GkldcYKr6JBb 0axw== 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=OHTIe9c6VK/seAGv5v6fIJmdoN1h2RpGHec2GwGLxOs=; b=jWuGjkaBW+u8/AXB/QkJX2gU9THS13W4ALJhc6JPEFK3a8CbU3fDCFjLyYY8LZY4u7 iFES279puDBckHgnRZW0RvDJ6ANy01AReNw/RZMKquPxrTaFCy3VfnyRySRnutsbHWA4 kVqGf5sxws3YGY2fCeWvSv8y+cdYoNfXidevKLFlwXauUiWbc2l3OEsmb3UDd7rwdzXV Ci/xi7S+38zh1AznaqXSsvfJEHJf6Wxd73d1oYk3ilQrsVTMCjgz1bnTVPVVOuPjw4GC rPs9j+6zzv5uEpub7rcoJ9lfsxr3ySqIyBC+2y4cgqjyF6y6AEQrAFZfgZfj7EccbuAg 58zw== 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 l12si725168ejq.20.2020.07.29.02.19.00; Wed, 29 Jul 2020 02:19:22 -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 S1728107AbgG2JSd (ORCPT + 99 others); Wed, 29 Jul 2020 05:18:33 -0400 Received: from szxga06-in.huawei.com ([45.249.212.32]:43570 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728014AbgG2JSd (ORCPT ); Wed, 29 Jul 2020 05:18:33 -0400 Received: from DGGEMS412-HUB.china.huawei.com (unknown [172.30.72.58]) by Forcepoint Email with ESMTP id 8FA3DA2313EBFCBF4DC2; Wed, 29 Jul 2020 17:18:30 +0800 (CST) Received: from huawei.com (10.175.104.57) by DGGEMS412-HUB.china.huawei.com (10.3.19.212) with Microsoft SMTP Server id 14.3.487.0; Wed, 29 Jul 2020 17:18:26 +0800 From: Li Heng To: , , CC: , , Subject: [PATCH -next] scsi: Remove unneeded cast from memory allocation Date: Wed, 29 Jul 2020 17:19:50 +0800 Message-ID: <1596014390-18605-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/mptctl.c:2596:14-31: WARNING: casting value returned by memory allocation function to (SCSIDevicePage0_t *) is useless. ./drivers/message/fusion/mptctl.c:2660:15-32: WARNING: casting value returned by memory allocation function to (SCSIDevicePage3_t *) is useless. Signed-off-by: Li Heng --- drivers/message/fusion/mptctl.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/drivers/message/fusion/mptctl.c b/drivers/message/fusion/mptctl.c index 1074b88..dbf5255 100644 --- a/drivers/message/fusion/mptctl.c +++ b/drivers/message/fusion/mptctl.c @@ -2455,7 +2455,7 @@ mptctl_hp_hostinfo(MPT_ADAPTER *ioc, unsigned long arg, unsigned int data_size) } } - /* + /* * Gather ISTWI(Industry Standard Two Wire Interface) Data */ if ((mf = mpt_get_msg_frame(mptctl_id, ioc)) == NULL) { @@ -2593,7 +2593,7 @@ mptctl_hp_targetinfo(MPT_ADAPTER *ioc, unsigned long arg) /* Get the data transfer speeds */ data_sz = ioc->spi_data.sdp0length * 4; - pg0_alloc = (SCSIDevicePage0_t *) pci_alloc_consistent(ioc->pcidev, data_sz, &page_dma); + pg0_alloc = pci_alloc_consistent(ioc->pcidev, data_sz, &page_dma); if (pg0_alloc) { hdr.PageVersion = ioc->spi_data.sdp0version; hdr.PageLength = data_sz; @@ -2657,8 +2657,7 @@ mptctl_hp_targetinfo(MPT_ADAPTER *ioc, unsigned long arg) /* Issue the second config page request */ cfg.action = MPI_CONFIG_ACTION_PAGE_READ_CURRENT; data_sz = (int) cfg.cfghdr.hdr->PageLength * 4; - pg3_alloc = (SCSIDevicePage3_t *) pci_alloc_consistent( - ioc->pcidev, data_sz, &page_dma); + pg3_alloc = pci_alloc_consistent(ioc->pcidev, data_sz, &page_dma); if (pg3_alloc) { cfg.physAddr = page_dma; cfg.pageAddr = (karg.hdr.channel << 8) | karg.hdr.id; -- 2.7.4