Received: by 2002:a05:6a10:6d10:0:0:0:0 with SMTP id gq16csp24721pxb; Tue, 12 Apr 2022 15:45:56 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw88bm0iW/qZYukYl5HNMoggDnaeK7gZeGlx3DshFfRhcM/xOa+FhjSZJbr0dGCDBB8FDru X-Received: by 2002:a17:902:d5cd:b0:156:6263:bbc7 with SMTP id g13-20020a170902d5cd00b001566263bbc7mr41006243plh.160.1649803556150; Tue, 12 Apr 2022 15:45:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649803556; cv=none; d=google.com; s=arc-20160816; b=WwqCAV/p9WHGHwic1w/S7AfSk2QFpY7TT48FK+AJoLoK3NwMwEawsDCb6+Ic3PvGyL Q4z7vcwKHazO387J1qcGI69aNQad8OwIv0A7OyMYIpVqy7z/rVMdl/arBI/zOXnl3tEJ ZSF0EpTM+WHtXBCTD1Py05LmKThpYy6MQOVj48RAf+MGwvXXM28fenUwBS3YMWSpH/YM /XvAqGMAgJ23c1xQL9p7/Gywe77xCH2C0yThrQCy4Zxqajb38z7hdmU5Ik4BeWeGLR+I C7qpvmD7SH5bnrxt/6IDMCZMwUFT+XjF5qmtdymnlFUtc5K7aS1TmKgSn/4LtqYXY+2S J2kw== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=kr3iG8j6ee198a8laPUTlcWlvtxlN0rpcqGVpjvNL84=; b=uDCu16hcEZErQxLfXaJMUjhb1Irv7Ykz2OMjVvIQEqeVcTKlAMVSaFrX+u6N3SQVMK xQF0Tc8fds8M+vPHHHpKDzZQDV09yrbh/XqgcIjtKu+rcKCMDDKD3BIrnV6cOT1wI35b Id4xaeikJZQcLkAboZQkin+MfrtEzdqIW2sOlLr7NSUqTMp0IpXFXHDln5IWVeW4uvZE KR7GHrs0P+yv5ndcfBw+M2ISoImrIkONHwSQHa9svZAp4tNjcE1qA0yU+5a8iMtVtV8j bfSWquKd+2r6kLBeU7kfVH3gtKpdfB0QyXQjh1xiSXpKsLHDIgPtB0A+tinNtVsJjBmb xSAA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=ZCUdaLQD; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id lk14-20020a17090b33ce00b001cd44931fa4si1274259pjb.17.2022.04.12.15.45.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Apr 2022 15:45:56 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=ZCUdaLQD; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: from out1.vger.email (out1.vger.email [IPv6:2620:137:e000::1:20]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id B1FFD1B696D; Tue, 12 Apr 2022 14:27:04 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1377345AbiDLHty (ORCPT + 99 others); Tue, 12 Apr 2022 03:49:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46030 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1354486AbiDLHR7 (ORCPT ); Tue, 12 Apr 2022 03:17:59 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C727413F89; Mon, 11 Apr 2022 23:59:23 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id A7CAC615B8; Tue, 12 Apr 2022 06:59:22 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id B3909C385A6; Tue, 12 Apr 2022 06:59:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1649746762; bh=yi7wTzc1JGwip0XrlP6gry2kJYuP98mfD52o/JlFv/U=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ZCUdaLQDf2Ru2t306cUNNJlQ6tcng05MNWuUzvzeoe+83akyp5SPUwlg400OKCFjN Q3XmccJQ6mJMmRg5H8+VrS1Qrpyx99BkfF+7u/aYHCKfOD4JpLm4Igj0akKjamgPYz o2sfpR0wlIwOA6pO5/1S5O6Syboj7rR6qvSB0lEg= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Jack Wang , Damien Le Moal , "Martin K. Petersen" , Sasha Levin Subject: [PATCH 5.16 070/285] scsi: pm8001: Fix pm80xx_pci_mem_copy() interface Date: Tue, 12 Apr 2022 08:28:47 +0200 Message-Id: <20220412062945.688323155@linuxfoundation.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220412062943.670770901@linuxfoundation.org> References: <20220412062943.670770901@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Damien Le Moal [ Upstream commit 3762d8f6edcdb03994c919f9487fd6d336c06561 ] The declaration of the local variable destination1 in pm80xx_pci_mem_copy() as a pointer to a u32 results in the sparse warning: warning: incorrect type in assignment (different base types) expected unsigned int [usertype] got restricted __le32 [usertype] Furthermore, the destination" argument of pm80xx_pci_mem_copy() is wrongly declared with the const attribute. Fix both problems by changing the type of the "destination" argument to "__le32 *" and use this argument directly inside the pm80xx_pci_mem_copy() function, thus removing the need for the destination1 local variable. Link: https://lore.kernel.org/r/20220220031810.738362-6-damien.lemoal@opensource.wdc.com Reviewed-by: Jack Wang Signed-off-by: Damien Le Moal Signed-off-by: Martin K. Petersen Signed-off-by: Sasha Levin --- drivers/scsi/pm8001/pm80xx_hwi.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/drivers/scsi/pm8001/pm80xx_hwi.c b/drivers/scsi/pm8001/pm80xx_hwi.c index 48b0154211c7..00498e3660e1 100644 --- a/drivers/scsi/pm8001/pm80xx_hwi.c +++ b/drivers/scsi/pm8001/pm80xx_hwi.c @@ -66,18 +66,16 @@ int pm80xx_bar4_shift(struct pm8001_hba_info *pm8001_ha, u32 shift_value) } static void pm80xx_pci_mem_copy(struct pm8001_hba_info *pm8001_ha, u32 soffset, - const void *destination, + __le32 *destination, u32 dw_count, u32 bus_base_number) { u32 index, value, offset; - u32 *destination1; - destination1 = (u32 *)destination; - for (index = 0; index < dw_count; index += 4, destination1++) { + for (index = 0; index < dw_count; index += 4, destination++) { offset = (soffset + index); if (offset < (64 * 1024)) { value = pm8001_cr32(pm8001_ha, bus_base_number, offset); - *destination1 = cpu_to_le32(value); + *destination = cpu_to_le32(value); } } return; -- 2.35.1