From patchwork Wed Mar 13 21:00:34 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 160273 Delivered-To: patch@linaro.org Received: by 2002:a02:5cc1:0:0:0:0:0 with SMTP id w62csp14755052jad; Wed, 13 Mar 2019 14:01:25 -0700 (PDT) X-Google-Smtp-Source: APXvYqzMzRkXsf6LaBAB2JmK4Bd24Hgh4dI0TMmytV7RRsMGPHtwnmQ3wj+qRNc/TeCv+wvkykYP X-Received: by 2002:aa7:9102:: with SMTP id 2mr45274121pfh.179.1552510885284; Wed, 13 Mar 2019 14:01:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1552510885; cv=none; d=google.com; s=arc-20160816; b=G98qrfvE8e8VccnbUo5rj20Vk4EFqmZaaMn9DT7lUfY86TcT1oKDDUMub9hZ5t2/3Q QZvI/EOW+wwEqYcCU+6Wmrvvl9eNqUS2i9a/ml89Sp9t4BoKwynFShkkW7tmnQ/upNfo /ieWnY4rZUMNvnwWNNl+8vXmTsktUXa2ZhnX7OboTGBBLRxwO++fngKn+iLePpKcDMYp O3Ve+MufSIks3GvOb4fySDBPU42Wy89Ofi+gHgk11YSweY/WYyzCqnRV4J/n67581CGQ qPLWWNZZwlwE6MGus9YPFGhizVovRA48Bl8fF85eEYJLdKpfNDNOo7ij2WKUcat7DRcS FxIA== 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 :message-id:date:subject:cc:to:from; bh=exMYaFeE3HlM9U0Zr+AiHde0IuAfiEZrbhJsXOAr3q8=; b=mpTYz2Pc1ZgjM5Sx3LCAvUUxOHOuEA1/Y8Y14Tp5ETgRp2uA0GzX71RXcmVfjXuDQA IdaDIcFYuWDhaeorYDcZxWh/jmuL1nhjxcGhwmUcZp6VK/EF1FvX3wA8XrCRsS3oFWh9 aRt81NJPT1PSxJZmyiEzuNxYTK0qQXM46+4F6XlZf6vKGcUBxrnXeR1sJOEqgsmBx9k2 DkNdu2qK/MmZjtigQXQzPG459XbbTm2yt91wD+Ge0y63aUvvXzWwYgYnOwBGGSyFSCuT Vd/5/Y395niCsEVrbW0/r+5p2LNyhqaFreKxMtmUQWra+GiEXYzpIyrOl8jQCqpz+8RT 3bMQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-spi-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-spi-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 b15si11536951pfm.72.2019.03.13.14.01.25; Wed, 13 Mar 2019 14:01:25 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-spi-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-spi-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-spi-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726551AbfCMVBY (ORCPT + 1 other); Wed, 13 Mar 2019 17:01:24 -0400 Received: from mout.kundenserver.de ([217.72.192.75]:33549 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726263AbfCMVBY (ORCPT ); Wed, 13 Mar 2019 17:01:24 -0400 Received: from wuerfel.lan ([109.192.41.194]) by mrelayeu.kundenserver.de (mreue108 [212.227.15.145]) with ESMTPA (Nemesis) id 1MxDck-1gor2645zU-00xcC1; Wed, 13 Mar 2019 22:01:19 +0100 From: Arnd Bergmann To: Mark Brown Cc: Arnd Bergmann , Geert Uytterhoeven , linux-spi@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] spi: fix SPI_BPW_RANGE_MASK() regression Date: Wed, 13 Mar 2019 22:00:34 +0100 Message-Id: <20190313210118.3507256-1-arnd@arndb.de> X-Mailer: git-send-email 2.20.0 MIME-Version: 1.0 X-Provags-ID: V03:K1:gTNYpA6VAErBXYa0k3CCyol9+XgXGiQJk1rGCmT89cKHv0cXR3O X7N+Mnco7tnWoOqVb4Uo7Ha5B8SYtlFBJG51V2+OFTpw29m3xwmIq0uH4wIoLJeVSSRkDe0 GrKUgLkI+ta1ZVhymZEla4lhZqJGRJz+lNKT7tat53ofOUqhfNrd4MEWSuWdzDbGHzyFMkd Mu0iZaxEwKJzwiPQG60WQ== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1; V03:K0:yic6wNQ1vyo=:meDvKFWAQcwvNrUuwHeS09 aXAyc4m9f4MFW5NuMtlQMj3M0va+DncQ+vpOU0l9rU7upgTdQ28PbVL7QM0qS7eoS6m/cfdJQ Fb9Sjv2qVhfq5qsnh4vDe5f+X9f4mZszZ6O2Dg6SoBq4GFE3QwZp2op2009KWFgmuqQZE2tAc TZuVQxDb5fV0O138y9szpYLIM+mi/vXuo6RD9QwU/Pc0/r3t56g24QyDJAOdHgpOROgXd6R/O KeinoZIYQiWN99tC5/6slcLPpMI2V7kX7NJC9ipD+51wxeQIuuqkKf3/htUff3zTEp70glNXx 4EzKZgg/A8vzoYz3wrVlA4eY15hB7ET1dR7cosrwY8YE20ND6JiKMHCwB+yPb5Iyp3DUV9Klo 5u8NY5eBj644SUEqJ3vTjyib5YXboXbJZ5AfsizZO43pGbHRbKMMs7bVwd5AUqRbgurGkZqLW ywLeHGgHoOLb0FT3sdOa6TcphYAgTldqqgX6LFqZak+7ZUiNC9YeukHEAJicaCFm9slwhiR6H 7o1u/iF6JYEW/hEMaMOYTpAiTDCTSt7QsYgrbnl8i5wftOi49gl0Lz0gI5P6v9XKbFBzrmApc NDAc6bOu1NxH7lI+iU+8I0YgPWS+YbtQectp5jzrMDGPy22/6tzY1MktIRKbdpUvqc8BWlu7Z sz3+YoYUua5ai+QSQRA5wRlbQkZIj7ZrtJHz33baPPYYXRMcCHrdI3MVrIebp5WslLZS4V3LU q3u45imKpumUJdMkVgUv5FCNYLyY3w4hQKZUqA== Sender: linux-spi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-spi@vger.kernel.org Geert points out that I confused the min/max arguments that are reversed between SPI_BPW_RANGE_MASK() and GENMASK(). This time I have verified the result of the macro after fixing the arguments. Cc: Geert Uytterhoeven Fixes: eefffb42f665 ("spi: work around clang bug in SPI_BPW_RANGE_MASK()") Signed-off-by: Arnd Bergmann --- The broken commit is currently in the for-5.2 branch of the spi tree. If this is a branch that gets rebased, please just fold this fix into the original patch --- include/linux/spi/spi.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.20.0 Reviewed-by: Geert Uytterhoeven diff --git a/include/linux/spi/spi.h b/include/linux/spi/spi.h index b27386450089..a0975cf76cf6 100644 --- a/include/linux/spi/spi.h +++ b/include/linux/spi/spi.h @@ -444,7 +444,7 @@ struct spi_controller { /* bitmask of supported bits_per_word for transfers */ u32 bits_per_word_mask; #define SPI_BPW_MASK(bits) BIT((bits) - 1) -#define SPI_BPW_RANGE_MASK(min, max) GENMASK((min) - 1, (max) - 1) +#define SPI_BPW_RANGE_MASK(min, max) GENMASK((max) - 1, (min) - 1) /* limits on transfer speed */ u32 min_speed_hz;