From patchwork Sun Jun 9 16:41:46 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 166230 Delivered-To: patch@linaro.org Received: by 2002:a92:4782:0:0:0:0:0 with SMTP id e2csp52555ilk; Sun, 9 Jun 2019 09:47:19 -0700 (PDT) X-Google-Smtp-Source: APXvYqyIDwMXssFMbqueIFa+GhDRs1B9j8nQ9C4Pz5XsPCU990Q6/oFST/w3HFnn7/LcwB1GXCNl X-Received: by 2002:a63:fd50:: with SMTP id m16mr12064313pgj.192.1560098838844; Sun, 09 Jun 2019 09:47:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1560098838; cv=none; d=google.com; s=arc-20160816; b=MHM6X51lhww4ICB1j03dKabQJiuzuWrUB3jhenD/xDILtf9a+2rsyy6kXGd9fa1gyM 0xLmh1hXvUObVUN7CkoIbg0pAyH/IFBp1oCbGB3iPlkj6pG/D/LJX1+pJU7+z/qlUuHA Fy/NB1Ls1mED2eHxPgO7lBXhBnvdEviYnYP6Lr+lz/e4E2x54P6Q710WTRr2tBOG00qL M1sTMDQkC9KhWpUqXJYUO+FgjuWyZ3+9/x8cqJudYwCB6waKNc+u3/jnF5BSDi8KP8F7 L6Bpu1SnJVT9saivO/ojgOp95IJh73oU5e4hVueeN4CpaQj4VX4XEVVWXjXiWPLBeefa n5Ow== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=WbH+BOTq4tf+hSE8P3Gkgvg2oACBXUBp3F52kYhSJfg=; b=tVFdXg2kYhfCc+c5ACRu+aHsZ7QnQtgaj2xhDJphNX8GY8beGKQY705J+ICe8f0idQ J5hrrmaXcqOPRHmq/REyT8w87eEd8rOsmmwZukGGo8Jj+k50+aaJRoEk0FW20joNTfa0 79D8C0/4I4dmcoubhSujZl776fAJdpeNfHZOnsW0Ilqmf5XdXAJ7VXFfwtpyL3m6vAzO mcscuNIE2qaR/2+UrBIioOTscPubbxmAW25fYdD+iQrpI0hZ2GtUB1t17WXJJTvXf9YI v2G1+RJ3pdomc5vnx1I5S+4bf3jaua2UcZYqIq49rCrByVWUe5Wa0yQ/URqjIuasOI33 I7Uw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=cgaJ5nNe; spf=pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=stable-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 j14si7689156pfh.232.2019.06.09.09.47.18; Sun, 09 Jun 2019 09:47:18 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of stable-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=@kernel.org header.s=default header.b=cgaJ5nNe; spf=pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729868AbfFIQrR (ORCPT + 14 others); Sun, 9 Jun 2019 12:47:17 -0400 Received: from mail.kernel.org ([198.145.29.99]:45844 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730798AbfFIQrQ (ORCPT ); Sun, 9 Jun 2019 12:47:16 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id EABA12081C; Sun, 9 Jun 2019 16:47:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1560098835; bh=1UTgMr9SJoHnfT0WfOenI8NDzCMDHeZtBSXR4xaotXc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=cgaJ5nNeQ6W5iaLKpk1sNxQ5YJn2jn7BeadR/m09lgsqLoGXQ7gmsFfTwjhe5SYtS 8LDEvr6QWLNzm48lHswaFN7eCEQVNx/yq1ti8Z8itXQS6U+epyujdS3S0nnPVJ+Lh2 O0NaEBLyJBKtB+8cxHNSpnYHpdsBOV1ty8qS/b5M= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Alexey Brodkin , Masahiro Yamada Subject: [PATCH 5.1 35/70] kbuild: use more portable command -v for cc-cross-prefix Date: Sun, 9 Jun 2019 18:41:46 +0200 Message-Id: <20190609164130.078925185@linuxfoundation.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190609164127.541128197@linuxfoundation.org> References: <20190609164127.541128197@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Masahiro Yamada commit 913ab9780fc021298949cc5514d6255a008e69f9 upstream. To print the pathname that will be used by shell in the current environment, 'command -v' is a standardized way. [1] 'which' is also often used in scripts, but it is less portable. When I worked on commit bd55f96fa9fc ("kbuild: refactor cc-cross-prefix implementation"), I was eager to use 'command -v' but it did not work. (The reason is explained below.) I kept 'which' as before but got rid of '> /dev/null 2>&1' as I thought it was no longer needed. Sorry, I was wrong. It works well on my Ubuntu machine, but Alexey Brodkin reports noisy warnings on CentOS7 when 'which' fails to find the given command in the PATH environment. $ which foo which: no foo in (/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin) Given that behavior of 'which' depends on system (and it may not be installed by default), I want to try 'command -v' once again. The specification [1] clearly describes the behavior of 'command -v' when the given command is not found: Otherwise, no output shall be written and the exit status shall reflect that the name was not found. However, we need a little magic to use 'command -v' from Make. $(shell ...) passes the argument to a subshell for execution, and returns the standard output of the command. Here is a trick. GNU Make may optimize this by executing the command directly instead of forking a subshell, if no shell special characters are found in the command and omitting the subshell will not change the behavior. In this case, no shell special character is used. So, Make will try to run it directly. However, 'command' is a shell-builtin command, then Make would fail to find it in the PATH environment: $ make ARCH=m68k defconfig make: command: Command not found make: command: Command not found make: command: Command not found In fact, Make has a table of shell-builtin commands because it must ask the shell to execute them. Until recently, 'command' was missing in the table. This issue was fixed by the following commit: | commit 1af314465e5dfe3e8baa839a32a72e83c04f26ef | Author: Paul Smith | Date: Sun Nov 12 18:10:28 2017 -0500 | | * job.c: Add "command" as a known shell built-in. | | This is not a POSIX shell built-in but it's common in UNIX shells. | Reported by Nick Bowler . Because the latest release is GNU Make 4.2.1 in 2016, this commit is not included in any released versions. (But some distributions may have back-ported it.) We need to trick Make to spawn a subshell. There are various ways to do so: 1) Use a shell special character '~' as dummy $(shell : ~; command -v $(c)gcc) 2) Use a variable reference that always expands to the empty string (suggested by David Laight) $(shell command$${x:+} -v $(c)gcc) 3) Use redirect $(shell command -v $(c)gcc 2>/dev/null) I chose 3) to not confuse people. The stderr would not be polluted anyway, but it will provide extra safety, and is easy to understand. Tested on Make 3.81, 3.82, 4.0, 4.1, 4.2, 4.2.1 [1] http://pubs.opengroup.org/onlinepubs/9699919799/utilities/command.html Fixes: bd55f96fa9fc ("kbuild: refactor cc-cross-prefix implementation") Cc: linux-stable # 5.1 Reported-by: Alexey Brodkin Signed-off-by: Masahiro Yamada Tested-by: Alexey Brodkin Signed-off-by: Greg Kroah-Hartman --- scripts/Kbuild.include | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) --- a/scripts/Kbuild.include +++ b/scripts/Kbuild.include @@ -73,8 +73,13 @@ endef # Usage: CROSS_COMPILE := $(call cc-cross-prefix, m68k-linux-gnu- m68k-linux-) # Return first where a gcc is found in PATH. # If no gcc found in PATH with listed prefixes return nothing +# +# Note: '2>/dev/null' is here to force Make to invoke a shell. Otherwise, it +# would try to directly execute the shell builtin 'command'. This workaround +# should be kept for a long time since this issue was fixed only after the +# GNU Make 4.2.1 release. cc-cross-prefix = $(firstword $(foreach c, $(filter-out -%, $(1)), \ - $(if $(shell which $(c)gcc), $(c)))) + $(if $(shell command -v $(c)gcc 2>/dev/null), $(c)))) # output directory for tests below TMPOUT := $(if $(KBUILD_EXTMOD),$(firstword $(KBUILD_EXTMOD))/) From patchwork Sun Jun 9 16:42:17 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 166229 Delivered-To: patch@linaro.org Received: by 2002:a92:4782:0:0:0:0:0 with SMTP id e2csp52101ilk; Sun, 9 Jun 2019 09:46:47 -0700 (PDT) X-Google-Smtp-Source: APXvYqyLBQdFjq3aUHr8arPxHlRV3VD83pIErz7AnFAlf6Ox7gpZyCpPRAtFQYAWGGhyU99Ti4Ja X-Received: by 2002:a17:90a:258b:: with SMTP id k11mr16174264pje.110.1560098807645; Sun, 09 Jun 2019 09:46:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1560098807; cv=none; d=google.com; s=arc-20160816; b=DbvKncfkd+bxRq2b7RSRzTGxZ8huuwGYs8GkZMpweAOigpGdAYat5tMiYQBKpa6PJN 75yUlDxJobtutQsML554vrAlX6/2NDGIvjUmMdlbGvMGZyAO9FZr5+tzVwDTp8NkQPBY PJEqa6N62/gtc2Ae1qDAEzxIkQAcEAkJsG9ocXnhsPL4SGRHN3hvCvEoWdfHkXJhXufD EwweVjaoRaisCi7pXlh57aPQbKk1hFyMQWbZkrDPWAyXmsruseGFDNkJyMeEkyB/6VP1 2H/tLLu8gGIzyF/NhoKtSJReo9gqtPij8GCEHi3K5JBdN4cb8ZBiiUaH1PQbI6iTtAiJ XX4w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=uzX5+SvupaQRuaSBZdotRd0uokDRIX95PouopcHVFe0=; b=pIde3gtc6ZhYH39NCUkTvor4gCYzzlUMTznHZFubXiWjEMpWQj8zAJWInXI0vgGDOH BkrLPiKk6vEzYuumgH0y4fnNfcZkaWU79ylWzWF3EsP55EzzQVLMVT221wkOzYyTBKBK Wqa/flQdcHy4hmTBgQHIFT5ugBJUVH30JnTXzXXukPDusBNug3uK5IAUNwCHbJTSCxlz iDqFgUIXav6kf5PmE1PK5rCgS7OdwxcNsntNLGPHHuOFcpIxC/V7Pk4TIeDBa+l6Dck6 HoPTAwrwjzBTECsYXtVA3od6BlYDf07lNwk5PHhF73hw3TYnyA+E19+9hB5FtEC1E2mV bxLg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=QtH8pbnN; spf=pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=stable-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 v1si7938452pfv.202.2019.06.09.09.46.47; Sun, 09 Jun 2019 09:46:47 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of stable-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=@kernel.org header.s=default header.b=QtH8pbnN; spf=pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729547AbfFIQqq (ORCPT + 14 others); Sun, 9 Jun 2019 12:46:46 -0400 Received: from mail.kernel.org ([198.145.29.99]:45112 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730609AbfFIQqp (ORCPT ); Sun, 9 Jun 2019 12:46:45 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 316722081C; Sun, 9 Jun 2019 16:46:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1560098804; bh=gDN3Royv62WSTTTpPYuCAZqOoHLWjI5lA2MMTSlDF8o=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=QtH8pbnN6r4UIVgsXy7peffjrWToHcaiFPj9YZd/FvwsEobo1VuOErfYqG8uNUTxX YpCOy1oY7h5zWPf18VKISQPMSjIz2Tr+PYqawMM4gIr3lbvefNcrLEX2hlezO3yu6x 6wU14vpcOQmU+pSfI5z4MM15ppfYKyEccKOVolFs= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Jani Nikula , Jonathan Corbet Subject: [PATCH 5.1 66/70] drm/i915: Maintain consistent documentation subsection ordering Date: Sun, 9 Jun 2019 18:42:17 +0200 Message-Id: <20190609164132.953760538@linuxfoundation.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190609164127.541128197@linuxfoundation.org> References: <20190609164127.541128197@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Jonathan Corbet commit 551bd3368a7b3cfef01edaade8970948d178d40a upstream. With Sphinx 2.0 (or prior versions with the deprecation warnings fixed) the docs build fails with: Documentation/gpu/i915.rst:403: WARNING: Title level inconsistent: Global GTT Fence Handling ~~~~~~~~~~~~~~~~~~~~~~~~~ reST markup error: Documentation/gpu/i915.rst:403: (SEVERE/4) Title level inconsistent: I "fixed" it by changing the subsections in i915.rst, but that didn't seem like the correct change. It turns out that a couple of i915 files create their own subsections in kerneldoc comments using apostrophes as the heading marker: Layout '''''' That breaks the normal subsection marker ordering, and newer Sphinx is rather more strict about enforcing that ordering. So fix the offending comments to make Sphinx happy. (This is unfortunate, in that kerneldoc comments shouldn't need to be aware of where they might be included in the heading hierarchy, but I don't see a better way around it). Cc: stable@vger.kernel.org # v4.14+ Acked-by: Jani Nikula Signed-off-by: Jonathan Corbet Signed-off-by: Greg Kroah-Hartman --- drivers/gpu/drm/i915/i915_reg.h | 6 +++--- drivers/gpu/drm/i915/intel_workarounds.c | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) --- a/drivers/gpu/drm/i915/i915_reg.h +++ b/drivers/gpu/drm/i915/i915_reg.h @@ -32,7 +32,7 @@ * macros. Do **not** mass change existing definitions just to update the style. * * Layout - * '''''' + * ~~~~~~ * * Keep helper macros near the top. For example, _PIPE() and friends. * @@ -78,7 +78,7 @@ * style. Use lower case in hexadecimal values. * * Naming - * '''''' + * ~~~~~~ * * Try to name registers according to the specs. If the register name changes in * the specs from platform to another, stick to the original name. @@ -96,7 +96,7 @@ * suffix to the name. For example, ``_SKL`` or ``_GEN8``. * * Examples - * '''''''' + * ~~~~~~~~ * * (Note that the values in the example are indented using spaces instead of * TABs to avoid misalignment in generated documentation. Use TABs in the --- a/drivers/gpu/drm/i915/intel_workarounds.c +++ b/drivers/gpu/drm/i915/intel_workarounds.c @@ -37,7 +37,7 @@ * costly and simplifies things. We can revisit this in the future. * * Layout - * '''''' + * ~~~~~~ * * Keep things in this file ordered by WA type, as per the above (context, GT, * display, register whitelist, batchbuffer). Then, inside each type, keep the