From patchwork Thu May 12 08:38:31 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 9077641 Return-Path: X-Original-To: patchwork-linux-samsung-soc@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id A10639F372 for ; Thu, 12 May 2016 08:40:04 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id D18BA201FA for ; Thu, 12 May 2016 08:40:02 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id BF33620142 for ; Thu, 12 May 2016 08:40:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932102AbcELIji (ORCPT ); Thu, 12 May 2016 04:39:38 -0400 Received: from mout.kundenserver.de ([212.227.17.24]:52959 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751512AbcELIjf (ORCPT ); Thu, 12 May 2016 04:39:35 -0400 Received: from wuerfel.lan. ([78.42.132.4]) by mrelayeu.kundenserver.de (mreue104) with ESMTPA (Nemesis) id 0LgXxN-1bM8rW3Tkr-00nwv4; Thu, 12 May 2016 10:38:59 +0200 From: Arnd Bergmann To: Krzysztof Kozlowski Cc: Arnd Bergmann , Kukjin Kim , Mark Brown , linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] ARM: samsung: improve static dma_mask definition Date: Thu, 12 May 2016 10:38:31 +0200 Message-Id: <1463042333-281444-1-git-send-email-arnd@arndb.de> X-Mailer: git-send-email 2.7.0 X-Provags-ID: V03:K0:b1TKlXmzwvPI7UH+Aj501nQF+l08ZleuqwraUThihfLZKIUKTc3 TFMNHBdCzhE/dfZHJp4H/6iJr/CnAHaE6GU9DTgY/FQ+owgsv6EuDs/bLsh44yy/637kt6R BNraq/7hIG2D6WUwwAZSEmVaLPtZNvTNw42mXzPdKkC+6XBwGXBNYHnloq9oPo8sYHCKB1E g0KE5UdPZkOEboAhlMqoA== X-UI-Out-Filterresults: notjunk:1; V01:K0:xySh9g9DyPg=:SgqunyV5sM0OiRFUkzLWBa UHY4bTHilXRktmrE9GNHi2Cq7sF13x+KqaCUv36Asguw7ny5QqyF5PpMzdNJk6fe1qfwiZdsZ tRwPpUrkhH8FfjU8m6S9o4r+d8FCYTA7uSm8vJmCBFslWG/mfqmPUSQhgEBPyq0/0tbz/SLA/ rtEqLtHp/NOBBEhCZ8m9xuhqzz1jzkaH573A80hLeZLHENOPFA9iHgTzJZbSat//zx4Bwm/Z2 sglU7S2vl2wlYsmaUOYgwYjdjAHHQapWIT9Pgz7cPoQJXVXGsZpL8cq8xwNWEF9hBU0MkXK9O 0NOyNnsGnthmcwOpVHA2L7Y9ZeIH/kZ9asdR5R8PJ/AdRjMaW7FEG1vSh0Qbm2q9bovuHt/uF 0lN+wtRMx/tX4Yx5LCA0MB05ZZTPGdaDxc4X6K3b1JdJbslh/IKj7lqkKd0SWTKTl9XKfPpov puYQOEYR7LGUSgwm3fTPOG2OsG92FzUf5NzQIro+BOxW77heAFluMH+nJRdM6wx39PCXR5s72 KZZOQXXF846jd5dxJ6G26YY6ViWDJ7wx5Vq6YLbWGqdWt3xFbdROEtAHBtmIgTU63FtV8NHKm NL9+zFbVkkye35xQ2bllwq2hB/ThP0G91a8cStzoaQJCSchF3KVayFtfMsBATueRIV7fbt/gz T3rodQtnb230NMg4UDiR4befnRgCbjMH6DuUYshopNIYL9XoGJMPIDeFiBE6OPC8EhG0= Sender: linux-samsung-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org X-Spam-Status: No, score=-8.3 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP When no DMA master devices are part of the kernel configuration, we get a warning about the unused dma mask definition: arch/arm/plat-samsung/devs.c:71:12: error: 'samsung_device_dma_mask' defined but not used [-Werror=unused-variable] static u64 samsung_device_dma_mask = DMA_BIT_MASK(32); We could simply mark this as __maybe_unused to shut up that warning, but a nicer solution seems to be to have a separate mask for each device. The advantage is that a driver that happens to call dma_set_mask() on one device doesn't implicitly change the mask for the other devices as well. This is more of a theoretical problem, as obviously nothing does it for the devices in this file (or they would have always been broken), but it feels cleaner that way. The definition works by creating an array in place so we can take the address of it and let the compiler generate a hidden symbol for it at compile time. Signed-off-by: Arnd Bergmann --- arch/arm/plat-samsung/devs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/arm/plat-samsung/devs.c b/arch/arm/plat-samsung/devs.c index 84baa16f4c0b..e93aa6734147 100644 --- a/arch/arm/plat-samsung/devs.c +++ b/arch/arm/plat-samsung/devs.c @@ -68,7 +68,7 @@ #include #include -static u64 samsung_device_dma_mask = DMA_BIT_MASK(32); +#define samsung_device_dma_mask (*((u64[]) { DMA_BIT_MASK(32) })) /* AC97 */ #ifdef CONFIG_CPU_S3C2440