Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp1014438pxb; Wed, 6 Apr 2022 06:45:25 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxATxt06YobcvEZQkQQjcthCL1SbLWI9NQknmAzENnJl1IEgGAZ8Qsbd7RMWbZi12yzJW3F X-Received: by 2002:a05:6a00:16cd:b0:4e1:366:7ee8 with SMTP id l13-20020a056a0016cd00b004e103667ee8mr8865431pfc.9.1649252725627; Wed, 06 Apr 2022 06:45:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649252725; cv=none; d=google.com; s=arc-20160816; b=kV3x3RykBAu1f8Q6pMRmW1oo/+CtR10Ll8JuGiwPvFYgmUblZzjDfx/AIySwQubcPT MECwFE+Jf2XRTBNFCKwZibmdS9mumhU4iI/tKQtsgoCzZiFyVNRcAhzRhBl98GAAugvk XkBYshczdcCMhdsQYQ6MJYSfHJGf8XMr1ZsaKve3e0+uXirLHSv45BBi0XzcWD744mTG oI2ebsS2HCg+6m9KuCjJh3pRMw7BSewQSOXjwM72Q8pm26if2KyDQyTF9MdTdxfwx1vL eOe1I1zdnnhMdFAQI2kaLAoKLn/K5E4jx7+4q4r86scslwPVGwnE8GRvYcBpEGTNiN9m WCGQ== 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=c2EIck0kj15Whqsil0LgnaMyu4BMBTu+b3NxpX5beXc=; b=bUXvl6qP3onjMppTg340VztSFn5OLZDxYLEk4aT8FO7xwauTVRbS7R0pXNVAnt7wbb oL0/bAqGMRDlI9Q4MbDpqLtZO7VvkstG8DrWcthJlb+W0Y4yCX8egyNxdvVh7UYk8Yu7 H0ewiVkZHZ3AXjmQtuhJM1OlVw/IJl4k58PumZD0l9sNy1KuuGa4R2FfDek2NgY1Sm+R drL0udZlsRRrE4iNRvTuW/Va3hEOYm8/tO7o4KVaF7TCR43xe/kxi0RrUX/h999AoXM3 LMvVdZYTgRiFjKIVnPb0nVZmR3Zh9ZReJOrBiD1zjuoVjCdc3XG5KZcobH/ATGzGmWgX v3CQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=tmeNBzhO; 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 k68-20020a636f47000000b00382b76401ecsi18040459pgc.268.2022.04.06.06.45.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 Apr 2022 06:45:25 -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=tmeNBzhO; 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 5B29B57395C; Wed, 6 Apr 2022 04:33:31 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1836394AbiDFAgE (ORCPT + 99 others); Tue, 5 Apr 2022 20:36:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37026 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1349089AbiDEJtG (ORCPT ); Tue, 5 Apr 2022 05:49:06 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3373EA995C; Tue, 5 Apr 2022 02:40: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 ams.source.kernel.org (Postfix) with ESMTPS id E3699B81B14; Tue, 5 Apr 2022 09:40:32 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 58B88C385A1; Tue, 5 Apr 2022 09:40:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1649151631; bh=OThjdhWAJy2ZdOmn8E572dDHuYeVeeYjsuJEwal4jL0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=tmeNBzhO6aF12MDe7De6DhnG1c+FPS2Rg/jz+s7aZdJ9asZtjnwLkFpZ4btNV+sz+ IttXkVNMPqrPrOGM+03u4iAB88/WLtPSwpZ6IJBzjb3N+nua21W9lutLg/3f50y3F9 NvU9kLFjuYOLFXxIqi++hzwpu9pgwqFiTDlERCK8= 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 484/913] scsi: pm8001: Fix payload initialization in pm80xx_encrypt_update() Date: Tue, 5 Apr 2022 09:25:46 +0200 Message-Id: <20220405070354.363687172@linuxfoundation.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220405070339.801210740@linuxfoundation.org> References: <20220405070339.801210740@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 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 69789aa73fd1..e606a9b1c3af 100644 --- a/drivers/scsi/pm8001/pm80xx_hwi.c +++ b/drivers/scsi/pm8001/pm80xx_hwi.c @@ -1406,12 +1406,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