Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp666521pxb; Tue, 5 Apr 2022 17:59:13 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy67+7VwWHat0WwA7/vOXCWQ4KQoZzwUZyB/OYgpm9zCgFGXuyvan/cH4p0JB+Kd3rQKLWk X-Received: by 2002:a17:907:eaa:b0:6e8:2f3:45f9 with SMTP id ho42-20020a1709070eaa00b006e802f345f9mr6168294ejc.323.1649206661087; Tue, 05 Apr 2022 17:57:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649206661; cv=none; d=google.com; s=arc-20160816; b=xPn4le8kT12RCvdid1O2kPzbUaBUXkHv+eBFoSiQ78C8LvGKP3jZpHiwsBPz6iF4iO i7enCLX4IF9gyqPt5I2UrHwd2y+ey3WFRFSJmE35DHcMhkwvdS9/vFUg8Aize96tYnsg mXLLlJIu3lW6yX7pCQch3NDTB1S9GNTM46/kpr42FIxMG3ntfMQNZriJdoddhtYPosxK BuwW5h5DtAef3lNgwClW4IEQlrqAOsJsKEoMbTc034tQ4QDjz9WRBLw8LqXXvxRvl1uK TLQxC9OJeIsSvPkvGI3figzt6zt/OrvWfn0JqYmgUO6UGUyyjAEkoEnuhyt+u2ceAbWm GBtQ== 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=ief0hJIO7AeXSS6Fm0la6U0i49pZiJoOajSry7iQkGc=; b=ULqv0Xyi2lY05FcXKp+ipxKDXT7DK4eoTwaR1Ui7OjjeAtwgbZ8ZEtQJ9j7DK2vKPk 6hb0DbIsuzmcu+MXw4q2ZLahld+7s3TBvEfAPsYTTw3zFsJfg5AlTp7KIJrpvfcp2iWJ L+s9sUevR28ONwVi+ZWc5svZ5mO//leMEOicO6RTos31iAeEtQ4ssjrTBHCwIdSPjyfh ku0b4zCZBiKhwpQS/YjYC7Wv+ox/zekw0v14cMdesA+TNZh2BNHpJPKFCmaqij/45bR+ 9OcxCVu6bSlfqAoTflWHz8fNdS4RkZvjoLmMhH8pTItxomXoeB0HH9DKtrWDo+mu0Two 5PRQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=RZVOVgjN; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id si16-20020a170906ced000b006e76fdf8fccsi7080340ejb.552.2022.04.05.17.57.14; Tue, 05 Apr 2022 17:57:41 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=RZVOVgjN; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1355899AbiDELPC (ORCPT + 99 others); Tue, 5 Apr 2022 07:15:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34730 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237266AbiDEIRw (ORCPT ); Tue, 5 Apr 2022 04:17:52 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 352BE69CC3; Tue, 5 Apr 2022 01:05:54 -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 A4E0A617E9; Tue, 5 Apr 2022 08:05:53 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id B6978C385A2; Tue, 5 Apr 2022 08:05:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1649145953; bh=JWSpzLHpWqKGkFwCTk0nOHoD9KufYRoCj9fLiLPPjJg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=RZVOVgjNdxEozwO9JKorxs7KgBc0GgvT/LGNwKZ/VBgllZUBG4+HDAT66msKVQ8jX QuilBZ48Ibh1Z3MZp2m1nHlOeahqGdvc60z1UfvxHhpYTxCabhLPRW39MEZG2osNlw eBSEaKV7YZoO7X8Mja3yG/DkEo/xAC+P7QMV/TYI= 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 0587/1126] scsi: pm8001: Fix payload initialization in pm80xx_encrypt_update() Date: Tue, 5 Apr 2022 09:22:14 +0200 Message-Id: <20220405070424.863273674@linuxfoundation.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220405070407.513532867@linuxfoundation.org> References: <20220405070407.513532867@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=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham 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 f8b12dfb476dad38ce755aaf5e2df46f06f1822e ] All fields of the kek_mgmt_req structure have the type __le32. So make sure to use cpu_to_le32() to initialize them. This suppresses the sparse warning: warning: incorrect type in assignment (different base types) expected restricted __le32 [addressable] [assigned] [usertype] new_curidx_ksop got int Link: https://lore.kernel.org/r/20220220031810.738362-10-damien.lemoal@opensource.wdc.com Fixes: f5860992db55 ("[SCSI] pm80xx: Added SPCv/ve specific hardware functionalities and relevant changes in common files") 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 | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/scsi/pm8001/pm80xx_hwi.c b/drivers/scsi/pm8001/pm80xx_hwi.c index 19f9fb4da9c1..cbb0cd2e71c1 100644 --- a/drivers/scsi/pm8001/pm80xx_hwi.c +++ b/drivers/scsi/pm8001/pm80xx_hwi.c @@ -1407,12 +1407,13 @@ static int pm80xx_encrypt_update(struct pm8001_hba_info *pm8001_ha) /* Currently only one key is used. New KEK index is 1. * Current KEK index is 1. Store KEK to NVRAM is 1. */ - payload.new_curidx_ksop = ((1 << 24) | (1 << 16) | (1 << 8) | - KEK_MGMT_SUBOP_KEYCARDUPDATE); + payload.new_curidx_ksop = + cpu_to_le32(((1 << 24) | (1 << 16) | (1 << 8) | + KEK_MGMT_SUBOP_KEYCARDUPDATE)); pm8001_dbg(pm8001_ha, DEV, "Saving Encryption info to flash. payload 0x%x\n", - payload.new_curidx_ksop); + le32_to_cpu(payload.new_curidx_ksop)); rc = pm8001_mpi_build_cmd(pm8001_ha, circularQ, opc, &payload, sizeof(payload), 0); -- 2.34.1