Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp5852364ybl; Tue, 27 Aug 2019 10:32:30 -0700 (PDT) X-Google-Smtp-Source: APXvYqz2VHnexljvi+dLbfqRMZFlSORqNOPj0MkAF9r7WaJQmFoTlFo7XPYnTn/ikJSgqt0emT7N X-Received: by 2002:aa7:9882:: with SMTP id r2mr27864976pfl.146.1566927150604; Tue, 27 Aug 2019 10:32:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1566927150; cv=none; d=google.com; s=arc-20160816; b=JozW4JP7ZtQUT0wpTgmpkz3XqRfqsoviszmVsNOf+FX9cfZ/yJ3ycH/FEczPB8ImSx nPwXH4W1ulBImnG0w92rLXdruHLDysTv/xXU4g2WWo9wAFxKJH8TG32gPljiBJmZG7+h OXgOOTSrp/b2+bTDjR6z+6cdAj+4Pta5xG1ZDk4wm8m1D4MNJYGbEY7PfFRjN+uFRvTC FMt82mvRRXDySRoClwEAbDCJomyCQ8dUeMJEFKT/QulNNDPWaNz0mbOneJPwgMK4P3qE nuYvYqQ8Xj+fNpyUv/BsYyPz8l01fIRgO2SovsuJHIDDX70fJCuf42x6GD4trNSvyXrw ZHIA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=P5dAjtid6OYoDn5+mY4/ihsqLNHzIu3wUFcFqcHYypo=; b=mAlk3yyAgPrgWjPgrmF5+OT6rmvLAKJ4eNPej8/Mi0j53WNmdVP9oQc1zjFs6+a8Sn srv/C+03hQsLPL3G4iQlBrEOadgJubjpj+Q1tOYFCT2xs6Pup9v5y0Br2LvXXdM6wvI0 DMMR5glaxoY9YiFb0siH14MEQ4LYEZUhlP5X9MfD6anB9bX3tv4H8a5gQKHLYIOqQwre +xn+i+byxrhO6WNhOS6rtroDim2+VCb+wVSwb/smGkHCx3KfQwrKwfwdXkPBG0rRLSeV cUsmfXZghou90vekHH6AdPEpgoYqYCqnAyjM+io4S+v5wOa0dSjckHjpFhuLkWjl63V4 Eymg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v5si13273725plg.49.2019.08.27.10.32.09; Tue, 27 Aug 2019 10:32:30 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730185AbfH0R3m (ORCPT + 99 others); Tue, 27 Aug 2019 13:29:42 -0400 Received: from gate.crashing.org ([63.228.1.57]:52705 "EHLO gate.crashing.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727064AbfH0R3m (ORCPT ); Tue, 27 Aug 2019 13:29:42 -0400 Received: from gate.crashing.org (localhost.localdomain [127.0.0.1]) by gate.crashing.org (8.14.1/8.14.1) with ESMTP id x7RHTARD029788; Tue, 27 Aug 2019 12:29:10 -0500 Received: (from segher@localhost) by gate.crashing.org (8.14.1/8.14.1/Submit) id x7RHT9fb029787; Tue, 27 Aug 2019 12:29:09 -0500 X-Authentication-Warning: gate.crashing.org: segher set sender to segher@kernel.crashing.org using -f Date: Tue, 27 Aug 2019 12:29:09 -0500 From: Segher Boessenkool To: Nicholas Piggin Cc: Benjamin Herrenschmidt , Christophe Leroy , Michael Ellerman , Paul Mackerras , linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 2/2] powerpc: cleanup hw_irq.h Message-ID: <20190827172909.GA31406@gate.crashing.org> References: <0f7e164afb5d1b022441559fe5a999bb6d3c0a23.1566893505.git.christophe.leroy@c-s.fr> <81f39fa06ae582f4a783d26abd2b310204eba8f4.1566893505.git.christophe.leroy@c-s.fr> <1566909844.x4jee1jjda.astroid@bobo.none> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1566909844.x4jee1jjda.astroid@bobo.none> User-Agent: Mutt/1.4.2.3i Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Aug 27, 2019 at 10:48:24PM +1000, Nicholas Piggin wrote: > Christophe Leroy's on August 27, 2019 6:13 pm: > > +#define wrtee(val) asm volatile("wrtee %0" : : "r" (val) : "memory") > > +#define wrteei(val) asm volatile("wrteei %0" : : "i" (val) : "memory") > > Can you implement just one macro that uses __builtin_constant_p to > select between the imm and reg versions? I forgot if there's some > corner cases that prevent that working with inline asm i constraints. static inline void wrtee(long val) { asm volatile("wrtee%I0 %0" : : "n"(val) : "memory"); } (This output modifier goes back to the dark ages, some 2.4 or something). Segher