From nobody Thu Nov 13 19:19:15 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org ARC-Seal: i=1; a=rsa-sha256; t=1582599646; cv=none; d=zohomail.com; s=zohoarc; b=TpDP9YMm9uw96XK9d3W9bh5KSwAvYe3kYHwe+5A8+cOAk9mlMJfxwgGdQuzP4ZvtTn5eD+tFUkjxze7UR+qA1dEGJj0xjkH4r5GnCHWuD1rcnnuBfXys6z77eJfI1uTVdTcJBuHWmJxHvJGSMfVQrPJfY53ywD5BJhXhCVDrEtk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1582599646; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:To; bh=cYxTwmlOwljeTvOsibP1HNvXlsACABrb4goF2pOS7xw=; b=hEGXnnxHPyXgmq7EVyTDTKGKsgqAOx9Az2W5NGNI+C3vr3Qdo3C4hYoXg9cdSxAHOPPATsvsf3Jb+e2y5bZOvuxjIoSMUPowIVzr3V1EsfTHhB2s0OOXLswGPdmRQwpKUVeBjU2mKvaGQBWjl7AKhhkAWM2PM6i0/kC1WhhGd+g= ARC-Authentication-Results: i=1; mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1582599646178601.8783417706187; Mon, 24 Feb 2020 19:00:46 -0800 (PST) Received: from localhost ([::1]:48090 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j6QSh-0006AE-SD for importer@patchew.org; Mon, 24 Feb 2020 22:00:43 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:44545) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j6QRj-0005RB-WD for qemu-devel@nongnu.org; Mon, 24 Feb 2020 21:59:44 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1j6QRj-0007KD-3K for qemu-devel@nongnu.org; Mon, 24 Feb 2020 21:59:43 -0500 Received: from szxga07-in.huawei.com ([45.249.212.35]:47664 helo=huawei.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1j6QRg-0007Gc-LD; Mon, 24 Feb 2020 21:59:40 -0500 Received: from DGGEMS405-HUB.china.huawei.com (unknown [172.30.72.58]) by Forcepoint Email with ESMTP id 5AF4A33254F7D2F1710F; Tue, 25 Feb 2020 10:59:35 +0800 (CST) Received: from huawei.com (10.133.205.93) by DGGEMS405-HUB.china.huawei.com (10.3.19.205) with Microsoft SMTP Server id 14.3.439.0; Tue, 25 Feb 2020 10:59:27 +0800 From: Chen Qun To: , Subject: [PATCH] hw/net/imx_fec: write TGSR and TCSR3 in imx_enet_write() Date: Tue, 25 Feb 2020 10:59:23 +0800 Message-ID: <20200225025923.19328-1-kuhn.chenqun@huawei.com> X-Mailer: git-send-email 2.14.1.windows.1 MIME-Version: 1.0 X-Originating-IP: [10.133.205.93] X-CFilter-Loop: Reflected Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 45.249.212.35 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: peter.maydell@linaro.org, zhang.zhanghailiang@huawei.com, jasowang@redhat.com, qemu-arm@nongnu.org, peter.chubb@nicta.com.au, Chen Qun Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" The current code causes clang static code analyzer generate warning: hw/net/imx_fec.c:858:9: warning: Value stored to 'value' is never read value =3D value & 0x0000000f; ^ ~~~~~~~~~~~~~~~~~~ hw/net/imx_fec.c:864:9: warning: Value stored to 'value' is never read value =3D value & 0x000000fd; ^ ~~~~~~~~~~~~~~~~~~ According to the definition of the function, the two =E2=80=9Cvalue=E2=80= =9D assignments should be written to registers. Reported-by: Euler Robot Signed-off-by: Chen Qun --- I'm not sure if this modification is correct, just from the function definition, it is correct. --- hw/net/imx_fec.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hw/net/imx_fec.c b/hw/net/imx_fec.c index 6a124a154a..92f6215712 100644 --- a/hw/net/imx_fec.c +++ b/hw/net/imx_fec.c @@ -855,13 +855,13 @@ static void imx_enet_write(IMXFECState *s, uint32_t i= ndex, uint32_t value) break; case ENET_TGSR: /* implement clear timer flag */ - value =3D value & 0x0000000f; + s->regs[index] =3D value & 0x0000000f; break; case ENET_TCSR0: case ENET_TCSR1: case ENET_TCSR2: case ENET_TCSR3: - value =3D value & 0x000000fd; + s->regs[index] =3D value & 0x000000fd; break; case ENET_TCCR0: case ENET_TCCR1: --=20 2.23.0