Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp745383pxb; Tue, 5 Apr 2022 21:28:21 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyAVpFEG5U6FOWMWyqM510lA72x1f2NZF1d0FD0coGlL/bsVynxHbpas/mIjcqKHpBLnPiw X-Received: by 2002:a17:902:c411:b0:156:af97:1a4c with SMTP id k17-20020a170902c41100b00156af971a4cmr6855910plk.48.1649219300915; Tue, 05 Apr 2022 21:28:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649219300; cv=none; d=google.com; s=arc-20160816; b=KGGXsNLyyrc1FPrlInjwMF2XUTcCT2fDk8GSLr7kNLX5GHbZY+U3W5R8KdBzK8/kXN tgDMna0M5u48jrhQjvTZWWkRejpjVT4uYDSKG72x+zCGH3BG5e46Su02hg5VOGytaR6o yhl46O7Qa6WZVgxDEe4o38ATTExzsi3A0jS661iMsDcd0rYDmbns6hmY3+y+4vfGDOew 6sYI5tU4RkXBQlqsELXIm+f3F0DbxhWb9mPk0gvTnPvYypCmbJUH0VwtHFimsyxyyp/y Jy0uBvKHb4TaQVfsoJGNTDQW4CK68Irya/gfozgjVS9yznZBpcZ8FrP5RtjImZj+l5Sb Ljxg== 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=XMySII8sOzPeHWq2bemjxeYuX8e033Nyg8O4595zDnc=; b=RJz2nNJvVur9ZiwGRma9lEUw2UA5dOTrD+KBfSrqF/UKYfoXPg+1YSAj2ohtULn6wh Uj/l6rlGLC3nvkoXsH0gEHzrdAhmtC6zwB3hvc6TI4SFQvyq27Ac7dr0O5k0giqfOnmv vk152F+rEgj5WRX8mNhOJpgc0DxUMc41I7fvBmfu95BNHViwgTX+QacuksgO3U7KaOvK 5y0J2yNpGiYEEWy9rJ/wfj1guxdG7snzHHzEjWGQvCd60L1/DTnzgp81di4+C7T4sgkX l/+9TpATQw50ycXtjz8urz0WHk/j6Lcah2RCpgXYALHsLSvOkP/jB6au+w6p/JQ+QAZo sWaQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=b+zMgTyr; 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 j8-20020a655588000000b0039b0a0950ddsi1585540pgs.33.2022.04.05.21.28.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 05 Apr 2022 21:28:20 -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=b+zMgTyr; 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 638BA293437; Tue, 5 Apr 2022 19:47:37 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236526AbiDEJDF (ORCPT + 99 others); Tue, 5 Apr 2022 05:03:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34696 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237210AbiDEIRr (ORCPT ); Tue, 5 Apr 2022 04:17:47 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F1DD4B18BF; Tue, 5 Apr 2022 01:05:41 -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 997B9B81BAF; Tue, 5 Apr 2022 08:05:40 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 010B1C385A0; Tue, 5 Apr 2022 08:05:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1649145939; bh=W91xtLEFfTMll7ZsK6hqKsdimU1ucJroPdiZg5yDm+c=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=b+zMgTyr9Sbl2DeqMB3ZWrxiM+ilUv5TURnyxTYL2Y7E05KRdJyZzrtIjVzp9C7D9 ynGItsSqVfN5sTxr5cfyDmkkkojluoGtRwH16TJmuyhv3Y1e35ReJE3SaDGQ17WNww Ahhs6rabJcw+x4jaT0TFIkhfAjr5uy97sgz7ITeM= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, John Garry , Jack Wang , Damien Le Moal , "Martin K. Petersen" , Sasha Levin Subject: [PATCH 5.17 0583/1126] scsi: pm8001: Fix command initialization in pm80XX_send_read_log() Date: Tue, 5 Apr 2022 09:22:10 +0200 Message-Id: <20220405070424.745909403@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=-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 1a37b6738b58d86f6b144b3fc754ace0f2e0166d ] Since the sata_cmd struct is zeroed out before its fields are initialized, there is no need for using "|=" to initialize the ncqtag_atap_dir_m field. Using a standard assignment removes the sparse warning: warning: invalid assignment: |= Also, since the ncqtag_atap_dir_m field has type __le32, use cpu_to_le32() to generate the assigned value. Link: https://lore.kernel.org/r/20220220031810.738362-5-damien.lemoal@opensource.wdc.com Fixes: c6b9ef5779c3 ("[SCSI] pm80xx: NCQ error handling changes") Reviewed-by: John Garry Reviewed-by: Jack Wang Signed-off-by: Damien Le Moal Signed-off-by: Martin K. Petersen Signed-off-by: Sasha Levin --- drivers/scsi/pm8001/pm8001_hwi.c | 2 +- drivers/scsi/pm8001/pm80xx_hwi.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/scsi/pm8001/pm8001_hwi.c b/drivers/scsi/pm8001/pm8001_hwi.c index 9ec310b795c3..d978f7226206 100644 --- a/drivers/scsi/pm8001/pm8001_hwi.c +++ b/drivers/scsi/pm8001/pm8001_hwi.c @@ -1865,7 +1865,7 @@ static void pm8001_send_read_log(struct pm8001_hba_info *pm8001_ha, sata_cmd.tag = cpu_to_le32(ccb_tag); sata_cmd.device_id = cpu_to_le32(pm8001_ha_dev->device_id); - sata_cmd.ncqtag_atap_dir_m |= ((0x1 << 7) | (0x5 << 9)); + sata_cmd.ncqtag_atap_dir_m = cpu_to_le32((0x1 << 7) | (0x5 << 9)); memcpy(&sata_cmd.sata_fis, &fis, sizeof(struct host_to_dev_fis)); res = pm8001_mpi_build_cmd(pm8001_ha, circularQ, opc, &sata_cmd, diff --git a/drivers/scsi/pm8001/pm80xx_hwi.c b/drivers/scsi/pm8001/pm80xx_hwi.c index 9d20f8009b89..ec6b970e05a1 100644 --- a/drivers/scsi/pm8001/pm80xx_hwi.c +++ b/drivers/scsi/pm8001/pm80xx_hwi.c @@ -1882,7 +1882,7 @@ static void pm80xx_send_read_log(struct pm8001_hba_info *pm8001_ha, sata_cmd.tag = cpu_to_le32(ccb_tag); sata_cmd.device_id = cpu_to_le32(pm8001_ha_dev->device_id); - sata_cmd.ncqtag_atap_dir_m_dad |= ((0x1 << 7) | (0x5 << 9)); + sata_cmd.ncqtag_atap_dir_m_dad = cpu_to_le32(((0x1 << 7) | (0x5 << 9))); memcpy(&sata_cmd.sata_fis, &fis, sizeof(struct host_to_dev_fis)); res = pm8001_mpi_build_cmd(pm8001_ha, circularQ, opc, &sata_cmd, -- 2.34.1