From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S965229AbeAKR3v (ORCPT + 1 other); Thu, 11 Jan 2018 12:29:51 -0500 Received: from mail-it0-f68.google.com ([209.85.214.68]:39444 "EHLO mail-it0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934655AbeAKR3t (ORCPT ); Thu, 11 Jan 2018 12:29:49 -0500 X-Google-Smtp-Source: ACJfBovMg3mNY14gi1/v58vTeHRSCid9rysdk+ur5LPUN9hFUR2NSHBFzpW7FDp1UnXjDYfJAns6B2BOcq1hPndWc6w= MIME-Version: 1.0 In-Reply-To: <1515688058.22302.366.camel@infradead.org> References: <1515688058.22302.366.camel@infradead.org> From: Linus Torvalds Date: Thu, 11 Jan 2018 09:29:48 -0800 X-Google-Sender-Auth: mLravB8bKKoO0HIRPPEX4NsfJqA Message-ID: Subject: Re: [PATCH 2/3] objtool: Ignore retpoline alternatives To: David Woodhouse Cc: Josh Poimboeuf , "the arch/x86 maintainers" , Linux Kernel Mailing List , Thomas Gleixner , Andi Kleen , Paul Turner , Greg Kroah-Hartman , Tim Chen , Dave Hansen , Kees Cook , Peter Zijlstra , Andy Lutomirski , Jiri Kosina , One Thousand Gnomes Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Return-Path: On Thu, Jan 11, 2018 at 8:27 AM, David Woodhouse wrote: > > > Ick, numbers. Use .Lfoo_%= instead. > Actually, I think PeterZ is wrong on this one. First off, we do *not* use %= in inline asms in the kernel yet, and we shouldn't start just because of these. Secondly, we use lots of the the "small numbers for local labels" both in inline asm and in *.S files. I think doing jne 1f ... 1: is a _hell_ of a lot more legible than jne .LPrefix_% ... .LPrefix_% unless you have some *major* reason to use an explicit label name. Sure, if you grew up writing perl, and think that an illegible mess of random characters is a requirement for programming, then the ".L%" format looks natural. But if you're an actual human, the "small numbers as labels" is fine. The one requirement for the small numbers thing is that you really have to give the direction when you use them. Because re-using the same number *will* happen, and is normal. That, btw, is also why it's pointless to make the small numbers "bigger". Using "1122" as a label is actively worse than just using "1". You shouldn't try to fool yourself and think that your number is "unique". It doesn't need to be. A label needs to be unique within one use, and the use just tells _which_ of the non-unique numbers you use. And yes, you could even re-use the number within one macro or inline asm. But that's just confusing. Make the number unique for the particular macro or inline use. Linus