Received: by 2002:a25:ca44:0:0:0:0:0 with SMTP id a65csp2493752ybg; Fri, 31 Jul 2020 00:57:47 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz7+wmt5S9dnj6cqDPa1AP+s/HgVOV7mVc/G+oqHR8smfUOmQHa1cgxVbMR+gCSKoVf/xzI X-Received: by 2002:a17:906:528d:: with SMTP id c13mr2871837ejm.61.1596182267459; Fri, 31 Jul 2020 00:57:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1596182267; cv=none; d=google.com; s=arc-20160816; b=KlvX2uwQUNV2FlBj1TR1jL7J/bpHSieMlKQ0vdwFVV6833S7QNL+N9MHLdNFMQwgwu 3mECrUDh2VAhCQREtbG0Lkl+pd8Us2swdX92hdQg/rousS84L1JM3QyVsDHydtbDz+eo hwqeG7NsepqUL0q/ae1zp76ICwsdeDh+VD6qNmU9CdcMSMOZtzXLLEkBjxDGVLOzqP/v hC/+sb8ZZOcX31Pokn+uoPtyEChwkjxFkFwV88GZjA0oVDBcc6BmI6eBSiZ0KHPo+dLd n7NVs5567i4ZfzNa+mUwm/3VWmwZPRX2UqKebqE5ewhp/5Me4YMn9HpOSHzgnA49wjtc WCpQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :message-id:in-reply-to:subject:cc:to:from:date; bh=cqGq41s6kNkOmTMN3F1KL7TBTPZiNLHwfcm6baTVQyo=; b=essBH1wo1w9GUDIxJ9M5T8w3JpJN7oSAnc36TZLIuCkCkoePUtSAXHiv9nSFnj4J+4 2i5WOS4qIusDlLO92SJPQn/b6G9Bza3X8xDIwPhHsEv3aRUnSEGQ7JqDaq2Sdfep/D/q dtbA5tN+tRxsESo9qlMWt180PdLgqxKJHmdTE4C0Ks51kmLlBq3c3IZqyyNPUFSDyjce nn8HG1rnPaN1+8aVGk9WYSi3/26LlhykonNJDXvAsBeFP39wWDjw29yWKku64pkxANuE ZlK+XAe/6o61SMqBla+V5lOS6MC3nrOlrYh9FQz2YMl7ofp/GdOqZYVHHRrFPLE7TYFx 708A== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id t21si4701144eds.460.2020.07.31.00.57.24; Fri, 31 Jul 2020 00:57:47 -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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731718AbgGaH4o (ORCPT + 99 others); Fri, 31 Jul 2020 03:56:44 -0400 Received: from mx2.suse.de ([195.135.220.15]:43628 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731684AbgGaH4o (ORCPT ); Fri, 31 Jul 2020 03:56:44 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id 88BCFACDF; Fri, 31 Jul 2020 07:56:55 +0000 (UTC) Date: Fri, 31 Jul 2020 09:56:42 +0200 (CEST) From: Miroslav Benes To: Julien Thierry cc: Josh Poimboeuf , peterz@infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v3 2/4] objtool: Move orc outside of check In-Reply-To: <7f7a7196-8b28-cd55-0685-799766bb6d4c@redhat.com> Message-ID: References: <20200730094143.27494-1-jthierry@redhat.com> <20200730094143.27494-3-jthierry@redhat.com> <20200730095759.GH2655@hirez.programming.kicks-ass.net> <20200730132237.GM2655@hirez.programming.kicks-ass.net> <3af41a3b-a4b9-8120-3ac0-c9ce13770628@redhat.com> <20200730141526.lr33zv4ffa3rdygp@treble> <7f7a7196-8b28-cd55-0685-799766bb6d4c@redhat.com> User-Agent: Alpine 2.21 (LSU 202 2017-01-01) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 30 Jul 2020, Julien Thierry wrote: > > > On 7/30/20 3:15 PM, Josh Poimboeuf wrote: > > On Thu, Jul 30, 2020 at 02:29:20PM +0100, Julien Thierry wrote: > >> > >> > >> On 7/30/20 2:22 PM, peterz@infradead.org wrote: > >>> On Thu, Jul 30, 2020 at 01:40:42PM +0100, Julien Thierry wrote: > >>>> > >>>> > >>>> On 7/30/20 10:57 AM, peterz@infradead.org wrote: > >>>>> On Thu, Jul 30, 2020 at 10:41:41AM +0100, Julien Thierry wrote: > >>>>>> + if (file->elf->changed) > >>>>>> + return elf_write(file->elf); > >>>>>> + else > >>>>>> + return 0; > >>>>>> } > >>>>> > >>>>> I think we can do without that else :-) > >>>>> > >>>> > >>>> I did wonder and was not 100% confident about it, but the orc gen will > >>>> always change the file, correct? > >>> > >>> Not if it already has orc, iirc. > >>> > >>> But what I was trying to say is that: > >>> > >>> if (file->elf->changed) > >>> return elf_write(file->elf) > >>> > >>> return 0; > >>> > >>> is identical code and, IMO, easier to read. > >>> > >> > >> Much easier yes, I'll change it. > > > > But I think file->elf->changed can be assumed at this point anyway, so > > it could just be an unconditional > > > > return elf_write(file->elf); > > > > I'll triple check whether that's the case and remove the if if possible. I think it is the case. And even if not, it would only cause a pointless call to elf_update() in the end and that should not do any harm anyway if I am not mistaken. However, I think there is a problem with the rebase on top of the current code. The patch moves elf_write() call to orc_gen.c which was ok before Peterz introduced elf_write_insn() et al. We need to keep elf_write() in check.c for this case too. Miroslav