Received: by 2002:a05:6a10:413:0:0:0:0 with SMTP id 19csp765572pxp; Fri, 11 Mar 2022 14:32:35 -0800 (PST) X-Google-Smtp-Source: ABdhPJyFwON2WbW/afbQhOc0/PwayL7pbcoBzok/Wjk3rQu4eBOs+//gSdFyOsjfMZ+m2cUKIwlg X-Received: by 2002:a17:902:c407:b0:151:f794:ac5e with SMTP id k7-20020a170902c40700b00151f794ac5emr12658013plk.67.1647037955787; Fri, 11 Mar 2022 14:32:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1647037955; cv=none; d=google.com; s=arc-20160816; b=S5arQH7QZ1wS3K208RxbKcfSpl6JuWNfHSffG/mTBlXPbK0srmIqvtJjFx0Qabvz/K p4ekQD2d2D+qyAt9ralcLZKM5f1QpwIpa99bC4GNv/EHT11tGUPlt8YfM0ldUmYTvFPk TMNXvvB+q2UAq8tEsab4k7Fb4vKSQqmgjJNu2lMYRJMzomgkqdev4/ifUK9cVAW9fdh9 G2fPv/nf1PGzOrGszrHSnoB601H56cfv3BMta6Ij/81V3jdLWVK9Ar0Dv8H40vYojMfr B3bXLh8wzyu9d+orYYehe50VQ3LrFb0mFnpTDmidCibgQcyj43QJ+JEu+0b8kXQ2pkUo sJ2Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :mime-version:accept-language:in-reply-to:references:message-id:date :thread-index:thread-topic:subject:cc:to:from; bh=O2bmA2K2Kfjkp1DWKPttcx1/pgVLUqNLZdNroU/zv/A=; b=Vot+usTxNLvOHFWis0jftvQ7HiJaEtADoNeg+dUmJhZO5omw3AGYTXH9i7BP7itc1T BoQs9qHeav52ccDCUEIokJPY2tIhEcazuycRhe2pnvbjIUgGhEp7NDaE2NVWyLHQ/7w0 tUWQDL7nuhPZqzbxQfnXPV55akM6G5xRBuYXNazkQyXtFb1dN8iQ/MzSIMOuf6P8i30x AhSTs7llDOLjDgWBzjuvTEKkrA+LGOdTitsTwqT/TvYFG/dWbqjuybwEcn/vxqfPRtjQ 9WAw6gmQFMIuyLUTqZQnvaz3aKV09SDpBXsAiUlcj/yMgmGnpRIwQGAKgCIAZsteonLz hOyQ== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=aculab.com Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id u13-20020a170903124d00b00151da6b5fd8si10606143plh.275.2022.03.11.14.32.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 11 Mar 2022 14:32:35 -0800 (PST) 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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=aculab.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 23A002FB029; Fri, 11 Mar 2022 13:38:35 -0800 (PST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S244533AbiCKPOO convert rfc822-to-8bit (ORCPT + 99 others); Fri, 11 Mar 2022 10:14:14 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34834 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237701AbiCKPOM (ORCPT ); Fri, 11 Mar 2022 10:14:12 -0500 Received: from eu-smtp-delivery-151.mimecast.com (eu-smtp-delivery-151.mimecast.com [185.58.86.151]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 0FDE8F65FE for ; Fri, 11 Mar 2022 07:13:07 -0800 (PST) Received: from AcuMS.aculab.com (156.67.243.121 [156.67.243.121]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id uk-mta-103-xBMgNJtJNn2luR1K6f_Okw-1; Fri, 11 Mar 2022 15:13:04 +0000 X-MC-Unique: xBMgNJtJNn2luR1K6f_Okw-1 Received: from AcuMS.Aculab.com (fd9f:af1c:a25b:0:994c:f5c2:35d6:9b65) by AcuMS.aculab.com (fd9f:af1c:a25b:0:994c:f5c2:35d6:9b65) with Microsoft SMTP Server (TLS) id 15.0.1497.28; Fri, 11 Mar 2022 15:13:02 +0000 Received: from AcuMS.Aculab.com ([fe80::994c:f5c2:35d6:9b65]) by AcuMS.aculab.com ([fe80::994c:f5c2:35d6:9b65%12]) with mapi id 15.00.1497.028; Fri, 11 Mar 2022 15:13:02 +0000 From: David Laight To: 'Alexey Dobriyan' , "x86@kernel.org" CC: "tglx@linutronix.de" , "mingo@redhat.com" , "bp@alien8.de" , "dave.hansen@linux.intel.com" , "hpa@zytor.com" , "linux-kernel@vger.kernel.org" Subject: RE: [PATCH 5/5] x86/unwind/orc: delete dead write in __orc_find() Thread-Topic: [PATCH 5/5] x86/unwind/orc: delete dead write in __orc_find() Thread-Index: AQHYNVZ8GGri+f1+t0mvolzUfhJiRqy6SM+A Date: Fri, 11 Mar 2022 15:13:02 +0000 Message-ID: <6257b01104da4891af46eec530df1dcb@AcuMS.aculab.com> References: <20220311144312.88466-1-adobriyan@gmail.com> <20220311144312.88466-5-adobriyan@gmail.com> In-Reply-To: <20220311144312.88466-5-adobriyan@gmail.com> Accept-Language: en-GB, en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-exchange-transport-fromentityheader: Hosted x-originating-ip: [10.202.205.107] MIME-Version: 1.0 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=C51A453 smtp.mailfrom=david.laight@aculab.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: aculab.com Content-Language: en-US Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8BIT X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, 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: Alexey Dobriyan > Sent: 11 March 2022 14:43 > > Also move "mid" variable to the innermost scope and delete useless > parenthesis while I'm at it. Hiding the definition of 'mid' in the inner scope is pointless. I'm also not 100% sure that 'found' is always set. Consider the ip < orc_ip(first) case. David > > Signed-off-by: Alexey Dobriyan (CloudLinux) > --- > arch/x86/kernel/unwind_orc.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/arch/x86/kernel/unwind_orc.c b/arch/x86/kernel/unwind_orc.c > index 2de3c8c5eba9..d38125ea1bf6 100644 > --- a/arch/x86/kernel/unwind_orc.c > +++ b/arch/x86/kernel/unwind_orc.c > @@ -35,7 +35,7 @@ static struct orc_entry *__orc_find(int *ip_table, struct orc_entry *u_table, > { > int *first = ip_table; > int *last = ip_table + num_entries - 1; > - int *mid = first, *found = first; > + int *found = first; > > if (!num_entries) > return NULL; > @@ -47,7 +47,7 @@ static struct orc_entry *__orc_find(int *ip_table, struct orc_entry *u_table, > * ignored when they conflict with a real entry. > */ > while (first <= last) { > - mid = first + ((last - first) / 2); > + int *mid = first + (last - first) / 2; > > if (orc_ip(mid) <= ip) { > found = mid; > -- > 2.34.1 - Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK Registration No: 1397386 (Wales)