Received: by 2002:a05:6512:3d0e:0:0:0:0 with SMTP id d14csp41560lfv; Tue, 12 Apr 2022 16:27:54 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyuMKS7kvGEKg7X+j2JiILsyMYfaEzC8du2pmW8SmykShmQx/R2i17PIDldLrToeTbh25YF X-Received: by 2002:a17:90a:af86:b0:1c7:db8e:8589 with SMTP id w6-20020a17090aaf8600b001c7db8e8589mr7618639pjq.94.1649806073760; Tue, 12 Apr 2022 16:27:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649806073; cv=none; d=google.com; s=arc-20160816; b=XIyUshjd+3eZtAnRnbpaTM2QLo01IfBX1Y7lLxF75VlWtaFKbtbZnVxXS98DCF0JoP 9Ri7py866YR0VFblkym7FBJt/BvuSLmpINs91MNTjfdNUVRnCn1WQfol7VohiFuGuJ5q P9Effjuz+lQhCisTf14VD/lVwmD+VkxOAeXanc173kkhwhq1RWm2bOUUNmK/ijW8lPXs KN4TQF5PkH947Obaj7wmsHzwbsIWLVKI6/aJ81uBz/nUqCEOC+d/VSS0Yvw+5og9jfDG mRqQi5NnAb9607OGgugSberwwuqkwFgzziZj6uVLuhKCklmmwThrL/+PB4hZbm8zBDuK IXDQ== 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=iQDc0aeJ3hXWidGqmfDah42LnDYzUGjkLKWWRZVvFc8=; b=R+jnSk5+AcJBCPs6w+c+oH4oXisKDpRZVChzP12i5690koRb8Bvqj+yVotmiA4W2Hx yoVXFjGcPa8DISkH4V1jZVTadvyDItPLwkEqPYWULAkxj/jrLjWGezvy7Vxng3N17FTX MhYBBrhqY7jNRM271EAwPazzaUrUukGjLWdEqpLbqFn4huyurTzgxezOmmnbDM9keHe3 0o8yexArpDEEEzLtYzp7LB/W+MwfVqfA1n/43zs9GCjqcf2XkXMXAKbSYMc/bpj/pl1b FFNZLuZad1FH1WVcP7aV2oPjIVt2hZpGQxq2yeupDeCcedAeRFzBAxaoqxnShMKZN0nE lYNw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=HH+Npbek; 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 bg12-20020a056a02010c00b003992df12df8si4287160pgb.465.2022.04.12.16.27.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Apr 2022 16:27:53 -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=HH+Npbek; 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 05839106634; Tue, 12 Apr 2022 14:20:15 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229528AbiDLI7S (ORCPT + 99 others); Tue, 12 Apr 2022 04:59:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50170 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1357091AbiDLHjq (ORCPT ); Tue, 12 Apr 2022 03:39:46 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8708A9FCB; Tue, 12 Apr 2022 00:11:45 -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 2105361708; Tue, 12 Apr 2022 07:11:45 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 28D66C385A5; Tue, 12 Apr 2022 07:11:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1649747504; bh=c07T1VKAgPFpXfFZqznD8JY4cifFxI9tOTKw0rt5/t0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=HH+NpbekPY+JO82vVv+odCKfOwHuPGXZrBoY/kid8/r691Us9rTKoGoF/VAWHqPws Tn8ALgGODsaxld+ipPRGyWRxfXlZ83H1v7De0Rz2An3OdhMuy6/PcwO94cLnZrE6G1 IiQS5e/sc5fLQb6nQu/YiI88T8FxeDryJAoTRKeA= 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.17 101/343] scsi: pm8001: Fix pm80xx_pci_mem_copy() interface Date: Tue, 12 Apr 2022 08:28:39 +0200 Message-Id: <20220412062954.014428709@linuxfoundation.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220412062951.095765152@linuxfoundation.org> References: <20220412062951.095765152@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 908dbac20b48..9a0d65ac0174 100644 --- a/drivers/scsi/pm8001/pm80xx_hwi.c +++ b/drivers/scsi/pm8001/pm80xx_hwi.c @@ -67,18 +67,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