Received: by 2002:a05:6a10:6d10:0:0:0:0 with SMTP id gq16csp806471pxb; Tue, 12 Apr 2022 14:00:12 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz62rNSYXHmBfRG7oxnitg5jkD6P0tFPXbEjPU7aMeoVI/N53qSsnByXCwYui8Sher85LU1 X-Received: by 2002:a17:903:244e:b0:158:897b:40ec with SMTP id l14-20020a170903244e00b00158897b40ecmr4668427pls.121.1649797212128; Tue, 12 Apr 2022 14:00:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649797212; cv=none; d=google.com; s=arc-20160816; b=KsL7EICU6L2WlnS091P9lfaYThM6kNDVClqMKnaukrecS7arROKEih6tYoUHWTexRw 0egLvVm72xzpo9LFLW76yCYoh28wkb6VZVPElJjxuI8Z1q229IWXvqNxdIT2SQ0uyGAM 28rySHP1Vwwb2+Z9lR8tqSKsV5YbGXxunaY1yEf9tEJrCoO/D/E+8kHtrivCwYpXtBaL +yroCvMsF1vW4nYZHMjgp8uq9qoiUGoSn/ewl6h1MtCW7Vc8wZyDe5I30wYh3CoA3q4Q r/euwi3vYD/WIPEzh5hFK03bmMvW1KnotnBsXiNdV8T9iy7rRH8vSX5jI+TlSslnitrp yPLw== 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=7R4NOap7CnJBvUaYoA3s2o0KBJRQTuYikhE/qzMsJgM=; b=HhsNmkLiHsHdnjI+tanzH4y/6BxcdeSIIk3LYnK9jWdRSoHyFe5OH8ghjCZZxhzx2B zqv7glMOrF9TRY92qXM2fe5cWO1zcxZ7u2+KEcNQYScyDNVokXgLVLAjGB5D8EOG3Cn8 oHhxynmg08mEikUGGueU9aHlGbKpSD8YCds+E5fLv7ZHMXz9vynUyumZLS99SvcpK5v7 DL1bOzk4HPSFI5QGYp6gmFHQD5B+XxthAm7UV/AJJ3f2O2FrelnMC3lqR5JjZ6SREiyy 6eK+8RMME54uLDVGNILVr+e+63bgwgQvc1Zmap3Ia9V9Utk8IDpQk2vxdFFUOSrMYKFv YuSA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=1kLtQpKw; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 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. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id c36-20020a631c64000000b003816043f036si3721500pgm.555.2022.04.12.14.00.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Apr 2022 14:00:12 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=1kLtQpKw; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 5A803D372E; Tue, 12 Apr 2022 13:22:33 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1349792AbiDLGkM (ORCPT + 99 others); Tue, 12 Apr 2022 02:40:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50760 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1350399AbiDLGh7 (ORCPT ); Tue, 12 Apr 2022 02:37:59 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5655A15FD6; Mon, 11 Apr 2022 23:34:34 -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 5441E61890; Tue, 12 Apr 2022 06:34:34 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 558D2C385A6; Tue, 12 Apr 2022 06:34:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1649745273; bh=a+uHOV3S+wzgELtM9/J/Au4uHNeGFKSUUdWscUaa3vw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=1kLtQpKwpjnnNSDG4D5Nw/ZOVteo67jj1/gUifgCEjDfNFoMiuhtptnr4d95kisda hTVuO+MssjQrmyIiGHZD1q5uEZ4oInIpa03zmI3PA6nXNSaw3TJObiYw1lhHdesQod GuKZ+fGoBM/zsplUEq0yypHRFqJyTxzaL3aI96kg= 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.10 040/171] scsi: pm8001: Fix pm80xx_pci_mem_copy() interface Date: Tue, 12 Apr 2022 08:28:51 +0200 Message-Id: <20220412062929.046626942@linuxfoundation.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220412062927.870347203@linuxfoundation.org> References: <20220412062927.870347203@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 b5e60553acdc..a10c6f6b6f25 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