Received: by 2002:a05:6512:3d0e:0:0:0:0 with SMTP id d14csp40764lfv; Tue, 12 Apr 2022 16:26:05 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwF8Ug9Ziw8u0hscdP4W2mjbffapfuzumK5wplFLLXkcY8zTGHmoy6+099CAXd4/XV3d2YJ X-Received: by 2002:a17:90b:1c02:b0:1c8:da30:5ed7 with SMTP id oc2-20020a17090b1c0200b001c8da305ed7mr7690236pjb.28.1649805965475; Tue, 12 Apr 2022 16:26:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649805965; cv=none; d=google.com; s=arc-20160816; b=l1iUlZHp0sDEKaWWCoUiLeOGCG+Jarjfc1XAYPrchbGutUVAg/ELMzC9am5XW3FVHz gYFkIgiZyAfzT+xmubYeYJE/HmgdCVUU7Atd604ztxHDp/YjuHmYpa5jqfG5P97CqCRd B+DM0mLnC40fIC6xdEoZopuMwVVDWPeNOYLMIjdR6+YyLhY36ATg0Zq6jizQWBJGk0pn hCwh6OoZOCenBeM91ELqsalDB+tYRgmcbjxdwPGaOqBoyla1LW0XD98prPsxHU7AC2Fv LfUH/saoAteQsP5CFFb07nZT0PiknZcMsY/w1pdDcwfv/AkxtmrGskUCKLUq3n/NfbEO htVw== 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=pn2t8AJtnbyxGLZJnbyw/ZmpXGrrQK9CUCC9M3PATLA=; b=fvdYZnlh9T7ypTQm6H5I9vZJpksCZYhwst/1L+LnL3Z4fqh465e5Q+80kfry+aN1oE 4JlJ603pXPVhCmCZ6JFilRdJlpjVo0sStpoRpc5QBqU91+PrJfbgeBAK09awjZJwtCbK K6Z6u5AH0LtOMxyw3cl2X8vPvVTiqum1Mrh8nKNGx5zlT3/9Rw7LYNf3TFWPFcII5H8N eCqOb4P64Hwf99aU6EFckckh2on2pW0rIpjh65e8FEtR1CgjpzX0K1mS6dNmpsZizUpB /g/wqfUt8B5PXwvqEJveEBM1OG8h4wbfkZvr3v8TfneplVwia2bq+5S31lpilsM0ofDj FhXQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=QBT7d31L; 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 125-20020a621483000000b0050575372d7dsi12155727pfu.336.2022.04.12.16.26.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Apr 2022 16:26:05 -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=QBT7d31L; 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 7F1D310076C; Tue, 12 Apr 2022 14:18:28 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1350040AbiDLHHZ (ORCPT + 99 others); Tue, 12 Apr 2022 03:07:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48596 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1351768AbiDLGyW (ORCPT ); Tue, 12 Apr 2022 02:54:22 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2D30539164; Mon, 11 Apr 2022 23:43:59 -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 9894160B5E; Tue, 12 Apr 2022 06:43:58 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id A3388C385A1; Tue, 12 Apr 2022 06:43:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1649745838; bh=6eu3vxfI6idRfDajOUpvyiZ8RE8bKuLgM5OgQyw/PRQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=QBT7d31LDzGtSNXyjMrbWnJiN2VuG48FL78RyQX9ikgLnEDhEfie9BCh2j0zoujOp PVqERCwEEOvM5PboRPUmo7U9rbU7TDVIYY4jBPK7KNoAp+Pr5h41/Y+9UA54wF0PIQ nc9MrTB/KFGIIz4gU3bZ7KUcT0mpeOHd5bE7gB9I= 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.15 067/277] scsi: pm8001: Fix pm80xx_pci_mem_copy() interface Date: Tue, 12 Apr 2022 08:27:50 +0200 Message-Id: <20220412062943.987313432@linuxfoundation.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220412062942.022903016@linuxfoundation.org> References: <20220412062942.022903016@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 b0a108e1a3d9..df140eca341f 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