Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp828489pxf; Thu, 8 Apr 2021 13:39:24 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwxcy4ywWPLbFmtxCqZscYTQy/a0/CbH0HA4M9uc9euuQnpSRBpoEYplfjHb+iEehI9wHYC X-Received: by 2002:aa7:d60f:: with SMTP id c15mr13929882edr.88.1617914364118; Thu, 08 Apr 2021 13:39:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1617914364; cv=none; d=google.com; s=arc-20160816; b=bd4tNIvZS3u+/nY8/QYfvilNiPw2uj2/5BWgc+C+nWxG9ldq3phMZ8zSbT59jW8hO1 lZkAVkakYDp25OKcDbsgVWYSEsjyWUrEmHR4B/R2h0YtunIgI690W9hSLfcGxWRQy/iC z1eaGog7AhGn+FPwS8Z5s36tDy6IEcEF9Jb5Yo72LwSRlpjK0Y8uFES27PbuIGXpLHuX ZtAKs6+zot9NsXj1pAlM7hRbWTqpJ3XpvAa8ytoWf1Bq76TKfKF9tRDvy4l9po72EBnQ l19hCgYghSy89DqgY47RvnU2zg3cHlYh4ajF55+QJbps9HaVCXBd6ZTbCHPLRIZEdgZ1 x5sg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=Y4Rdnt3oUF7bwWTGLg0EvPKPEzZZxrzeSrMTeygcrUE=; b=lvCUx7btFtFqQ1q1ZZiSa/PBkl5piQd32aOwWmz92mQjHLg+sHv3Z3Az4s+HPnDvOh /uwbN/BJJtbiSsJAUP3W4Ud9MCjjPBIGM7xhk0kNGWMO5B8hbry69P3mWUOTz6oKFyS/ Iyxkd2NMN89z49ovXiU2SPTd9D0O7Ex7Zig0vlnH4qQ6ORByaNxRNFUFsrZ3icvHyQ3F mwgpoUgj9t87HyV/PJgRZ/sXK4+ZAXCVQ2iSsJc6TKNER4hEeMAZA7B7cK3rP2mHk5yC C8bcMlLWaAeY62DI8B4TGDQBeKZ3/uNTFLIUBt0Rh6Yvk7AkfgnY9vwu52RLoOYYtu82 cRJw== 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 x9si400182eje.296.2021.04.08.13.39.00; Thu, 08 Apr 2021 13:39:24 -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 S232091AbhDHUiR (ORCPT + 99 others); Thu, 8 Apr 2021 16:38:17 -0400 Received: from elvis.franken.de ([193.175.24.41]:35356 "EHLO elvis.franken.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231676AbhDHUiR (ORCPT ); Thu, 8 Apr 2021 16:38:17 -0400 Received: from uucp (helo=alpha) by elvis.franken.de with local-bsmtp (Exim 3.36 #1) id 1lUbPg-0007g1-00; Thu, 08 Apr 2021 22:38:04 +0200 Received: by alpha.franken.de (Postfix, from userid 1000) id 0AB84C24DB; Thu, 8 Apr 2021 22:37:45 +0200 (CEST) Date: Thu, 8 Apr 2021 22:37:44 +0200 From: Thomas Bogendoerfer To: Christoph Hellwig Cc: linux-mips@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] MIPS: uaccess: Reduce number of nested macros Message-ID: <20210408203744.GA18538@alpha.franken.de> References: <20210408181437.19570-1-tsbogend@alpha.franken.de> <20210408194611.GA16189@lst.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210408194611.GA16189@lst.de> User-Agent: Mutt/1.10.1 (2018-07-13) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Apr 08, 2021 at 09:46:11PM +0200, Christoph Hellwig wrote: > > +#define put_user(x, ptr) \ > > +({ \ > > + __typeof__(*(ptr)) __user *__p = (ptr); \ > > + \ > > + might_fault(); \ > > + access_ok(__p, sizeof(*__p)) ? \ > > + __put_user((x), __p) : \ > > + -EFAULT; \ > > Why not merge this into a single line, which seems a little more > readable: > > access_ok(__p, sizeof(*__p)) ? __put_user((x), __p) : -EFAULT; \ I just copied the riscv version ;-) I'll make it one line before applying. Thomas. -- Crap can work. Given enough thrust pigs will fly, but it's not necessarily a good idea. [ RFC1925, 2.3 ]