Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp1827191imm; Thu, 27 Sep 2018 03:12:16 -0700 (PDT) X-Google-Smtp-Source: ACcGV62seclwOVEJH4Yr7N1VwMf7A4VwsHPXCaFbfmaDvy2LrBs6eM0vCJmpmbq2exRyCUqzzsxv X-Received: by 2002:a63:b409:: with SMTP id s9-v6mr9389911pgf.437.1538043136351; Thu, 27 Sep 2018 03:12:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1538043136; cv=none; d=google.com; s=arc-20160816; b=DG72wYKIWMhLJFyw9bZtd8EHUTEaYRzej9YyJytu1hXgm5O5cjycHA1GcGaERTUpby SPhtQu6t+rAN7nUZVxhfY5Gz1JYTLv9nwhvH61lo3KHTBUCZELFwUC2tV824OZ2f4mw7 EhFflvHLBEQxLtZ3ciGS9QQ01yhw5sVpTohwXmjyDsantGPYa80J0yo3VnaQSAhvZ0n+ GAN8sJExsBxpayeLQA8flrLEBPX6YzyOC8wgB/mc8dXoc67x+WUd2OsJqYeYS4be2k6e zsttxp/otBVRQhVZDWEMxcsSAnSqkkO6Ri1vi82LBR68JWsoiOKjyk5XsPNqnSM4b/QK 6yuw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from; bh=NeZZx4oKVn6I+YLovNZQGJ87P3o5zxoW2CxVJqaBbdE=; b=h4NWta20zKnqJbGOB5WU/ob5OBCOdgcfQRffpZyyzdURq9BaRfQlrmedb2DxQIGYfn pGNQcXFi0yqvqYNtpnnht6VhCHYUtJCRVFzmRERcgFP1scHfa+VbaC2o6FLr6G8QS0gW bnceBz9PXgQ3W4JecVdQBTHDATHZHhKZShU10pae40n+3TBQpweZovcQ42dB5ilftXjj xB06d6y4gXT11STBBITIWQGO5la+i+W4vzvontoblEfMlodR1RCMY88Q3TrKH2w7mc2Z 4MQdHPDz4POcZAPcjdrRf1VtLKOrzo/hLZozuh0FCO7FYzFP97UZBVPe6OzyYXtDKPaY EJ/Q== ARC-Authentication-Results: i=1; mx.google.com; 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 x3-v6si1599636pgo.542.2018.09.27.03.12.01; Thu, 27 Sep 2018 03:12:16 -0700 (PDT) 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; 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 S1727305AbeI0Q1h (ORCPT + 99 others); Thu, 27 Sep 2018 12:27:37 -0400 Received: from mout.kundenserver.de ([212.227.126.187]:52007 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726929AbeI0Q1g (ORCPT ); Thu, 27 Sep 2018 12:27:36 -0400 Received: from wuerfel.lan ([109.193.40.16]) by mrelayeu.kundenserver.de (mreue009 [212.227.15.129]) with ESMTPA (Nemesis) id 1MEmAV-1fzfoD3kEt-00GFmy; Thu, 27 Sep 2018 12:09:50 +0200 Received: from wuerfel.lan ([109.193.40.16]) by mrelayeu.kundenserver.de (mreue009 [212.227.15.129]) with ESMTPA (Nemesis) id 1MEmAV-1fzfoD3kEt-00GFmy; Thu, 27 Sep 2018 12:09:50 +0200 From: Arnd Bergmann To: Thor Thayer , Borislav Petkov , Mauro Carvalho Chehab Cc: Arnd Bergmann , David Frey , Mark Rutland , Ingo Molnar , Christophe JAILLET , linux-edac@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] EDAC, altera: work around int-to-pointer-cast warnings Date: Thu, 27 Sep 2018 12:09:26 +0200 Message-Id: <20180927100949.973078-1-arnd@arndb.de> X-Mailer: git-send-email 2.18.0 X-Provags-ID: V03:K1:3QJ/C/Rf+i3z9FRlTihlNO24jKimfWyCxZq0uKh3BjBu7ik+OJk CLMxMnwdqkOfi/H2nGk15wipvvDpXE9nmTwMnTcnYdLn7Smm17iA/PhUJNINP6zUyiaAF9L VGm8+eo6/91gLtGwVhSUTKxMLPJcFgBULg370CFpIE0a1aqqf+jnypOLyCT+xuS1b/K7qYD g9v5ohKB2kCy9jbu6KorA== X-UI-Out-Filterresults: notjunk:1;V01:K0:nfUj0+BZv9c=:8oGeiRVXSeLoQqLBX/nZHm xzEtWQ9i615K/rwxmytJAwNcZOcbl4Ti0Ae4xMZP+NabwWK+v/t7tm1PXsVK6pWUFplkuAe6r oVJJbY+cc9xjsstryYeKANa8zZYjCU8ZRyKw361Cd4nAkF1GTrHBUIJ7lxzjcqNEeqPA95KFa 2QCmTyoNIcxIO+OuTM353PzuP6obpAG1Pwf1Wng3C5ohWBH1dYKCvVIHNG4ck7feN4065mvd6 BVZkLlZ5KZJhCQO1Bbsu4Dm3PfJ4BGHYDqj9XQ5EYX0V2qc9nQ9/BkWF7Hv5TXpcU5zVrPjGa MfGuM5AGQ1ngp54Of9jC/4XgAsp6vtOXBaG9uLyhGtlUwnFXu0xtxD6pgc1B5N/AJ5PIst2gf ds6OhXRANI9m0qllCIUahUKOWA6cinXhE1l0lo89X5RFpximkzWRSDsdGnsoJZh7559uvUT+Y laXpyyo7AzPrGmln0lmD13YeADA9pfYQit2eRmdqPRhWiCH2DDQMLtBhsNOF+9fpK1r5pOYPb oh+QJNW55DsjVz9+qG4LOseafR99fc8tATsU0uZMvFqALG03rTyBHniTAhJHfe69zAdSXhQaJ KiX57CnJ6Bu7KO8LdriL9Lnt2SdCpJS9/xBcKb82A2VXcYau9C0Ivz85rz47a5+jyHz/+92am 4vY8EtH3xoNota5vAEyxR5dmNyalMEPZXrJT3KKFNi2A/b7aFLwvOtV+Ad6jSkDAEMzo= Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The altera edac driver passes a token from a DT resource as resource_size_t into an SMC call, but casts it to an __iomem pointer and then a plain void pointer inbetween, mixing three or four incompatible types in the process. The compiler complains about one of the conversions: drivers/edac/altera_edac.c: In function 'altr_init_a10_ecc_block': drivers/edac/altera_edac.c:1053:10: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast] base = (void __iomem *)res.start; ^ drivers/edac/altera_edac.c: In function 'altr_edac_a10_probe': drivers/edac/altera_edac.c:2062:10: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast] base = (void __iomem *)res.start; Using a static checker probably also notices the __iomem cast. Solving this properly isn't trivial, but simply casting to a 'uintptr_t' instead of 'void __iomem *' makes it less wrong and should avoid the warnings. Fixes: d5fc9125566c ("EDAC, altera: Combine Stratix10 and Arria10 probe functions") Signed-off-by: Arnd Bergmann --- drivers/edac/altera_edac.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/drivers/edac/altera_edac.c b/drivers/edac/altera_edac.c index 0e9e80789d99..c89d82aa2776 100644 --- a/drivers/edac/altera_edac.c +++ b/drivers/edac/altera_edac.c @@ -1036,7 +1036,7 @@ altr_init_a10_ecc_block(struct device_node *np, u32 irq_mask, } else { struct device_node *sysmgr_np; struct resource res; - void __iomem *base; + uintptr_t base; sysmgr_np = of_parse_phandle(np_eccmgr, "altr,sysmgr-syscon", 0); @@ -1050,9 +1050,9 @@ altr_init_a10_ecc_block(struct device_node *np, u32 irq_mask, return -ENOMEM; /* Need physical address for SMCC call */ - base = (void __iomem *)res.start; + base = res.start; - ecc_mgr_map = regmap_init(NULL, NULL, base, + ecc_mgr_map = regmap_init(NULL, NULL, (void *)base, &s10_sdram_regmap_cfg); } of_node_put(np_eccmgr); @@ -2045,7 +2045,7 @@ static int altr_edac_a10_probe(struct platform_device *pdev) } else { struct device_node *sysmgr_np; struct resource res; - void __iomem *base; + uintptr_t base; sysmgr_np = of_parse_phandle(pdev->dev.of_node, "altr,sysmgr-syscon", 0); @@ -2059,9 +2059,10 @@ static int altr_edac_a10_probe(struct platform_device *pdev) return -ENOMEM; /* Need physical address for SMCC call */ - base = (void __iomem *)res.start; + base = res.start; - edac->ecc_mgr_map = devm_regmap_init(&pdev->dev, NULL, base, + edac->ecc_mgr_map = devm_regmap_init(&pdev->dev, NULL, + (void *)base, &s10_sdram_regmap_cfg); } -- 2.18.0