From nobody Mon May 6 06:13:23 2024 Delivered-To: importer@patchew.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; dmarc=pass(p=none dis=none) header.from=nongnu.org ARC-Seal: i=1; a=rsa-sha256; t=1641871779; cv=none; d=zohomail.com; s=zohoarc; b=GZlITokATEtk59gTX0pkSZ1V5zfi1VWk2krRTDYDfLFmXq5+tOO6tKt6rphMs24N7OYcSiJNWgvE/GLzEXWwp8YwBYjk7M1JXf/gpfJoNWNJWgv5mCwpGEtO1T21NuVz5MIshw+JFnB335Kt3imJeQmfl7gT4uJSNWbyIccjGDM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1641871779; h=Content-Type:Cc:Date:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:Sender:Subject:To; bh=Ua8uvDIWFZwavu3SHPlxiBIybNqPUKAvmxh9YHAvLWY=; b=nCThyyKqlJfIqHJkhLiST44RI6ylfjGmUm7GSnd5TqlxZNiRp/xwnBZDp7Z7ZN9cLl2u3/9q8+FA1G/dYKFScqtM5q4EzS514kSVpMJpx12Wm/NfSmUxcig1Xg8VYtiMgto1aCrZt6TMkZtRdJj8IGqlO1cEZJIWnLRILtgzGhE= 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; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1641871779220799.7503460744795; Mon, 10 Jan 2022 19:29:39 -0800 (PST) Received: from localhost ([::1]:49206 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1n77qr-0001QF-Rj for importer@patchew.org; Mon, 10 Jan 2022 22:29:37 -0500 Received: from eggs.gnu.org ([209.51.188.92]:33260) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n77pt-00007f-Bt for qemu-devel@nongnu.org; Mon, 10 Jan 2022 22:28:38 -0500 Received: from szxga02-in.huawei.com ([45.249.212.188]:5094) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n77po-0000uz-M0 for qemu-devel@nongnu.org; Mon, 10 Jan 2022 22:28:35 -0500 Received: from dggpemm500023.china.huawei.com (unknown [172.30.72.53]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4JXx2W1cskz9s8T; Tue, 11 Jan 2022 11:27:15 +0800 (CST) Received: from DESKTOP-TMVL5KK.china.huawei.com (10.174.187.128) by dggpemm500023.china.huawei.com (7.185.36.83) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.20; Tue, 11 Jan 2022 11:28:21 +0800 To: , Alistair Francis , David Gibson CC: Richard Henderson , Andrew Jones , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Thomas Huth , , Yanan Wang Subject: [PATCH] softmmu/device_tree: Remove redundant pointer assignment Date: Tue, 11 Jan 2022 11:27:58 +0800 Message-ID: <20220111032758.27804-1-wangyanan55@huawei.com> X-Mailer: git-send-email 2.8.4.windows.1 MIME-Version: 1.0 X-Originating-IP: [10.174.187.128] X-ClientProxiedBy: dggems706-chm.china.huawei.com (10.3.19.183) To dggpemm500023.china.huawei.com (7.185.36.83) X-CFilter-Loop: Reflected 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; Received-SPF: pass client-ip=45.249.212.188; envelope-from=wangyanan55@huawei.com; helo=szxga02-in.huawei.com X-Spam_score_int: -41 X-Spam_score: -4.2 X-Spam_bar: ---- X-Spam_report: (-4.2 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Reply-to: Yanan Wang From: Yanan Wang via X-ZM-MESSAGEID: 1641871781821100001 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" The pointer assignment "const char *p =3D path;" in function qemu_fdt_add_path is unnecessary. Let's remove it and just use the "path" passed in. No functional change. Suggested-by: Richard Henderson Signed-off-by: Yanan Wang Reviewed-by: Alistair Francis Reviewed-by: Andrew Jones Reviewed-by: Thomas Huth --- Based on: softmmu/device_tree: Silence compiler warning with --enable-sanit= izers https://patchew.org/QEMU/20220107133844.145039-1-thuth@redhat.com/ --- softmmu/device_tree.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/softmmu/device_tree.c b/softmmu/device_tree.c index 9e96f5ecd5..8897c79ea4 100644 --- a/softmmu/device_tree.c +++ b/softmmu/device_tree.c @@ -556,7 +556,6 @@ int qemu_fdt_add_subnode(void *fdt, const char *name) int qemu_fdt_add_path(void *fdt, const char *path) { const char *name; - const char *p =3D path; int namelen, retval; int parent =3D 0; =20 @@ -565,9 +564,9 @@ int qemu_fdt_add_path(void *fdt, const char *path) } =20 do { - name =3D p + 1; - p =3D strchr(name, '/'); - namelen =3D p !=3D NULL ? p - name : strlen(name); + name =3D path + 1; + path =3D strchr(name, '/'); + namelen =3D path !=3D NULL ? path - name : strlen(name); =20 retval =3D fdt_subnode_offset_namelen(fdt, parent, name, namelen); if (retval < 0 && retval !=3D -FDT_ERR_NOTFOUND) { @@ -584,7 +583,7 @@ int qemu_fdt_add_path(void *fdt, const char *path) } =20 parent =3D retval; - } while (p); + } while (path); =20 return retval; } --=20 2.27.0