Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp5034743imu; Tue, 8 Jan 2019 10:19:17 -0800 (PST) X-Google-Smtp-Source: ALg8bN69Dco9nVs7iyzvqAgGhRS8bLt6EDKPh6UbhnemmXaRQViBcmx7ghecK1tP8WIlge/bfZz/ X-Received: by 2002:a63:f844:: with SMTP id v4mr2460819pgj.82.1546971557115; Tue, 08 Jan 2019 10:19:17 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1546971557; cv=none; d=google.com; s=arc-20160816; b=nTB5Yxyv/Jf2p7yx+Ig2Fy1sqhcw6KnTRDhEDQ9Eu0uC/5+P8JDdX+f0JA+Rnbz3oZ lcF9YIHSiZZtk9gkxFdk//6NgB0EyIlEaFuIo8q1TPP6dMxNt5ed3TgCB9qr7aPs+TOl csVmXY5rsulOTscghVwbLGb2R08DBi5MWooC6btoVFklUq97+/wPaNhIaiJJa+nZ2FYq gxiCThUrjgL4JUZFeqkisxs8rpZIXCQs3RzOkVVB+vprqi3j3AKOl5cXnvM+JrqQtBsP BvLVZRaGnJw83RY9ruWZ12X3TADReUq9iTqnLsi+GK6trJ1zZfEVOZP6yO+IqyT0Zih4 vsOQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=AF45K0R5HnMz1K8AiYWGG5zEHo927DsrwNAY1IrlLWI=; b=b3pzvIo7BUAOe+0zD02w7brqx6ECU2WfgfWKGHtYYdGNlJI0ZLSdldsuzbfiFhdrPf LZkFyu7umPXdls3GQqM6Z0zsoaAUqLvQOtG+lHz6tFqrdKEnuzO71kdrnk0k417inakp MJraE5fz24bl+uLsCmodut0Kk+K6L9nKPYKbTPZq4vtKw8NApaKRDKqA36PRCdfGzA0j 9FfBTLqN8nWMRNrndJrK6JEsGp5XacNQCSNbFZfmIgHl5tRBlwdzh3Ekc+3vqRLi0jLa zcNhZzvSmmGmddBQtnWmviPVwoBz2LixzsHIBEm40XiYat5JiHyQiK0yWB1EkfQt2zfi 8qsA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=google header.b=EDV5jOZX; 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 x66si69201148pfk.73.2019.01.08.10.19.01; Tue, 08 Jan 2019 10:19:17 -0800 (PST) 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; dkim=pass header.i=@linux-foundation.org header.s=google header.b=EDV5jOZX; 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 S1729402AbfAHSQ7 (ORCPT + 99 others); Tue, 8 Jan 2019 13:16:59 -0500 Received: from mail-lj1-f196.google.com ([209.85.208.196]:41136 "EHLO mail-lj1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727484AbfAHSQ7 (ORCPT ); Tue, 8 Jan 2019 13:16:59 -0500 Received: by mail-lj1-f196.google.com with SMTP id k15-v6so4211365ljc.8 for ; Tue, 08 Jan 2019 10:16:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux-foundation.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=AF45K0R5HnMz1K8AiYWGG5zEHo927DsrwNAY1IrlLWI=; b=EDV5jOZXM+Ujj85ZlQyHQYoFlOfeSfByfc+7VzM8xhzvT/33+o8M/Ax9uwlDPnHR6N 1FiZ9RThr+Dd3kbNuCLKsd5sGl9mnAQPC7n0O8dftHo1vfC5wpKWl3ly89+uYMaSubxL 3aL/o8JwzuNPfYwJTt/v8jI/63Q/B4NCptFoU= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=AF45K0R5HnMz1K8AiYWGG5zEHo927DsrwNAY1IrlLWI=; b=RcmrlibDk937e0LiGvnnSkAIEpZgw/6IVHC7i9N3dquDqvVJoShOVCAOWkvkdBP1o7 hy6QP5Py0JqDNs7MVhh0nQd4BgUnuZ8fQQeBzBf/bf1KO7AsNBw38L+iVrc1axBHs7C+ vOngVzWki7OQfnWQXzY+pr7MjWi6DGM+DElShQCJJyPFKFuatFz2D+G+Q+SQGKVG+IHQ kYLTV2Jcybdm+qodxrVQtJYy3OazpvaqYoCMkjEE2HYVoe3QJkq0mWBsH9a5rIQ/fUcb R/V1nRY9fECSQ/v5AMMWronr7ze6EdClNHDRHrGteo91d3oUroML1a7A1I9WWkTeaAex XkLQ== X-Gm-Message-State: AJcUukctX/wCO9AUF0/NmkKjhtGu3Lk2chSxf87YYWHW6TM79iZLlJ6P EdMvgf5U33EMHNjmj0hGudT1EYcHLo4= X-Received: by 2002:a2e:917:: with SMTP id 23-v6mr1593709ljj.1.1546971416885; Tue, 08 Jan 2019 10:16:56 -0800 (PST) Received: from mail-lj1-f173.google.com (mail-lj1-f173.google.com. [209.85.208.173]) by smtp.gmail.com with ESMTPSA id 65sm13441353lfp.55.2019.01.08.10.16.55 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 08 Jan 2019 10:16:55 -0800 (PST) Received: by mail-lj1-f173.google.com with SMTP id u89-v6so4247234lje.1 for ; Tue, 08 Jan 2019 10:16:55 -0800 (PST) X-Received: by 2002:a2e:9983:: with SMTP id w3-v6mr1800313lji.133.1546971415249; Tue, 08 Jan 2019 10:16:55 -0800 (PST) MIME-Version: 1.0 References: <20190108131516.27903-1-shorne@gmail.com> In-Reply-To: From: Linus Torvalds Date: Tue, 8 Jan 2019 10:16:39 -0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH] arch/openrisc: Fix issues with access_ok() To: Stafford Horne Cc: LKML , Guenter Roeck , Jonas Bonn , Stefan Kristiansson , openrisc@lists.librecores.org Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jan 8, 2019 at 10:10 AM Linus Torvalds wrote: > > On Tue, Jan 8, 2019 at 5:15 AM Stafford Horne wrote: > > > > The commit 594cc251fdd0 ("make 'user_access_begin()' do 'access_ok()'") > > exposed incorrect implementations of access_ok() macro in several > > architectures. This change fixes 2 issues found in OpenRISC. > > Looks good to me. Should I apply this directly, or expect a pull > request with it later? Oh, and replying to myself with a quick note: it might also be a good idea to just make it an inline function. The only reason I did alpha and SH as those macros with a statement expression was that because I don't have a cross-build environment, continuing to do it as a macro was the safest thing from a build standpoint. One big difference between a macro and an inline function is that the inline function requires everything to be declared at the point of the function definition, while the macro can use things that get declared only later (like "get_fs()"). So a macro can use functions and other macros that aren't declared yet, but will be declared by the time the macro is actually _used_. So when changing the macro "blind", it was simply safer to just keep it a macro and just make it a bit more complex. But since you can build-test your changes, making (for example) __range_ok() be an inline function might have been the cleaner solution to the "use twice" issue. But your existing patch looks fine to me too, so don't worry too much about it. I just wanted to point out that the reason I did alpha and SH the way I did was not some "macros are better", but rather "Linus is weak and lazy". Linus