Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp2428492pxj; Mon, 10 May 2021 02:44:27 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwtvHNEaGRGDFBJ7rkOQtFGYQl0VNunAXIX1m2f3OoLwA8Fx2fLMSQkvHmzBWI4My7NAzSg X-Received: by 2002:a92:cc0f:: with SMTP id s15mr20400286ilp.187.1620639867263; Mon, 10 May 2021 02:44:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620639867; cv=none; d=google.com; s=arc-20160816; b=FLCc3X7bfjoM4xLZdqhf65PV0XU98L14JSn3aPi4fYccYaSFIWQsMND3otMj7gtDdX HQentT5VWn3doH+SLPZfNmOrS/bkKOzlNlQuel4FgpaQLOq6XTIf2teQn/lF72LJk/6x wpe22sj2E5qyuaR9Z8xPSau/nFVleIhzfdl/cSJXjYq1/9qx0zCJMNx4yZgx0JjMDLcQ //EeNnvXdLVH58hW+rSh6ofKgK3M0u7/cRJulIoi3RpXaW0OH3+KBx2g92YItuTMj+pq eHJoC/vJfR4PSPzNNs5P2fPi0xf4t2lYtqePC5TqNI7Zd/dU4iEz1qK9j24ymXDOQJse isFg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:message-id:date:subject:cc:to:from; bh=CP3m8G73aUeLy/cOBXe3UHHOwsSgbBGDMoxTE42Ce48=; b=zGWxt+vIETb3gbj5QEZHnhihypOfLY9mxIU33hL8nWigesJ0ym/1+82C7EVWZLqoa6 jqk5JoGH94WYfufZjsn/wOn7O+IgqQOBkz3Z2m02aQ8gYh7ZP/cATOF3S7RAOzUkPpB5 qyOzsoz46+0ZEfbwkx8zCmPtGVGfFHFvhn9zuwKh86vyxxhrHZyvi+nXiWMnPI9Boz0c xxWrLQ6CMIXDFpsY0/NgIXO9qTLc9aPoyeFIUpwl2R5qC68WKM+2GN3yPS/NV1krVP5q FxeIrGfUu4wd6bnDMa4qHxlI5wANXQjcnuZR3i+h4SsAjBrK22Z2wi9/G3yOP5lZoByT SMwg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id o14si18930035iow.26.2021.05.10.02.44.15; Mon, 10 May 2021 02:44:27 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230421AbhEJJoq (ORCPT + 99 others); Mon, 10 May 2021 05:44:46 -0400 Received: from out30-56.freemail.mail.aliyun.com ([115.124.30.56]:39589 "EHLO out30-56.freemail.mail.aliyun.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230153AbhEJJop (ORCPT ); Mon, 10 May 2021 05:44:45 -0400 X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R211e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=e01e04420;MF=yang.lee@linux.alibaba.com;NM=1;PH=DS;RN=10;SR=0;TI=SMTPD_---0UYMytMa_1620639817; Received: from j63c13417.sqa.eu95.tbsite.net(mailfrom:yang.lee@linux.alibaba.com fp:SMTPD_---0UYMytMa_1620639817) by smtp.aliyun-inc.com(127.0.0.1); Mon, 10 May 2021 17:43:38 +0800 From: Yang Li To: tglx@linutronix.de Cc: mingo@redhat.com, bp@alien8.de, x86@kernel.org, hpa@zytor.com, nathan@kernel.org, ndesaulniers@google.com, linux-kernel@vger.kernel.org, clang-built-linux@googlegroups.com, Yang Li Subject: [PATCH] x86/unwind/orc: Remove redundant initialization of 'mid' Date: Mon, 10 May 2021 17:43:35 +0800 Message-Id: <1620639815-93579-1-git-send-email-yang.lee@linux.alibaba.com> X-Mailer: git-send-email 1.8.3.1 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Pointer mid is being initialized however this value is never read as mid is assigned an updated value in while statement. Remove the redundant initialization. At the same time, adjust the declarations order of variables to keep the "upside-down x-mas tree" look of them. Clean up clang warning: arch/x86/kernel/unwind_orc.c:38:7: warning: Value stored to 'mid' during its initialization is never read [clang-analyzer-deadcode.DeadStores] Reported-by: Abaci Robot Signed-off-by: Yang Li --- arch/x86/kernel/unwind_orc.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/arch/x86/kernel/unwind_orc.c b/arch/x86/kernel/unwind_orc.c index a120253..bb76f4f 100644 --- a/arch/x86/kernel/unwind_orc.c +++ b/arch/x86/kernel/unwind_orc.c @@ -33,9 +33,10 @@ static inline unsigned long orc_ip(const int *ip) static struct orc_entry *__orc_find(int *ip_table, struct orc_entry *u_table, unsigned int num_entries, unsigned long ip) { - int *first = ip_table; int *last = ip_table + num_entries - 1; - int *mid = first, *found = first; + int *first = ip_table; + int *found = first; + int *mid; if (!num_entries) return NULL; -- 1.8.3.1