From patchwork Thu May 11 15:30:48 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rob Herring X-Patchwork-Id: 99660 Delivered-To: patch@linaro.org Received: by 10.182.142.97 with SMTP id rv1csp734535obb; Thu, 11 May 2017 08:33:24 -0700 (PDT) X-Received: by 10.84.139.195 with SMTP id 61mr1351969plr.34.1494516804435; Thu, 11 May 2017 08:33:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1494516804; cv=none; d=google.com; s=arc-20160816; b=XhT4vAEK9Lm0fpab79zhVuEBVLsVY6v45XLJev0ZaA3npp6ldlY/u34rTZHkbBF8xj VNKMjCae05tP3RHCh+OI6gHYV8uSobgSVXjLsY7Gndh66O8CpXD81vyuYzkfy8dSWYIn /w0t3Zc/diWYkzqRqM7zFuSo0HyHYglr+8zd4HDNxgeGCdpudzKVMQFsrxSgrOWc2dO2 P0n4I9WGC7qxvhaHEvzjVBWjFHiVij2iyGOvKgiz1SP6Gw/HnOTkgj6z3PZvWNVNJD2y 43gjsWPai4r3vBMQwAZcyVmImicPpd24C2+ppxhidKNNrORXMZVitojuEZ6DhnSAa4ys FkgQ== 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 :arc-authentication-results; bh=ScGgirjAjI3hBl+dc0lTnYNqp6HEDTLUJNOOW+igSxo=; b=PdcG/sdl433uCqnoFJ37rnNGw9Hmod/Z91lh+JYNJ45rviaMvwr8ZsdQwryKec0Jyf TTluQg7x3312i6Z3yLbBfANuOxKxRwfcrRy/HK/a5PJiYH/CWxPQUF+g6cqF6z3ve4rX 8pAMla41m5HD5gWGn2/yIhR4ybC+t4QfvxKFARQ409vu0aAV72EDsucJtF3T+1hLwPtk RKPgd/K84kvZmixZcsyXmkCX6ZlaV8cySdfH9QcrRR8it2xsw7K62gllje04mX29wG9y zQv/AkiamVKkrd2PNUu5OLgf4hKV8ex78y5j59BrKwuZmx+vy5EFAwlEoQJNX5NXhZcV TdsA== 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 s193si436839pgs.27.2017.05.11.08.33.23; Thu, 11 May 2017 08:33:24 -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 S1756771AbdEKPbq (ORCPT + 25 others); Thu, 11 May 2017 11:31:46 -0400 Received: from mail-oi0-f67.google.com ([209.85.218.67]:34153 "EHLO mail-oi0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756566AbdEKPaw (ORCPT ); Thu, 11 May 2017 11:30:52 -0400 Received: by mail-oi0-f67.google.com with SMTP id w10so4652677oif.1; Thu, 11 May 2017 08:30:52 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=ScGgirjAjI3hBl+dc0lTnYNqp6HEDTLUJNOOW+igSxo=; b=hNCfxnAg+LsDr3JeBioabxYDf3f1Ik5Lbac2zAFDslhVkGmRBv+zeeToWdvHD0wrVy 5UrqCVsdmcXeCoGoBwD4f5bz+LPLylf3ys9aQIzmQrlrgofsem/TEMrfautpVo/7DgDj rM6qtrHokgJvPk9Q8ysXS8oR8K1EAlHTpk0XAz82m6xBuZTtKTL34viMk2VJ7jOk61N7 HhLiO4L0bHKvivEZM3884S19FKVZTPSVhiRSee9Pm2t9KHaHDs+8LOJpMwRkxmAg+nfs Fkw6i4YWFR05JoHE+qji3tpK67B5IVVpozuOkyvjaB7NviJbd3eVhQIqmHuDcTWQ81u/ uPKw== X-Gm-Message-State: AODbwcDogglm8lomTETCHSde8C+2uwpXy39ESN9aEtK8XIZFp0rD3qWM sd40cYlbyJ3Wdg== X-Received: by 10.157.32.229 with SMTP id x92mr5676702ota.161.1494516652065; Thu, 11 May 2017 08:30:52 -0700 (PDT) Received: from localhost.localdomain (66-90-148-125.dyn.grandenetworks.net. [66.90.148.125]) by smtp.googlemail.com with ESMTPSA id i32sm217324otd.43.2017.05.11.08.30.51 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 11 May 2017 08:30:51 -0700 (PDT) From: Rob Herring To: Arnd Bergmann Cc: devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Frank Rowand , Marek Szyprowski Subject: [PATCH] Partially Revert "of: fix sparse warnings in fdt, irq, reserved mem, and resolver code" Date: Thu, 11 May 2017 10:30:48 -0500 Message-Id: <20170511153048.3586-1-robh@kernel.org> X-Mailer: git-send-email 2.11.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org A change to function pointers that was meant to address a sparse warning turned out to cause hundreds of new gcc-7 warnings: include/linux/of_irq.h:11:13: error: type qualifiers ignored on function return type [-Werror=ignored-qualifiers] drivers/of/of_reserved_mem.c: In function '__reserved_mem_init_node': drivers/of/of_reserved_mem.c:200:7: error: type qualifiers ignored on function return type [-Werror=ignored-qualifiers] int const (*initfn)(struct reserved_mem *rmem) = i->data; Turns out the sparse warnings were spurious and have been fixed in upstream sparse since 0.5.0 in commit "sparse: treat function pointers as pointers to const data". This partially reverts commit 17a70355ea576843a7ac851f1db26872a50b2850. Fixes: 17a70355ea57 ("of: fix sparse warnings in fdt, irq, reserved mem, and resolver code") Reported-by: Arnd Bergmann Signed-off-by: Rob Herring --- Arnd, Doing this as a partial revert instead and added sparse version information to the commit msg. Rob drivers/of/of_reserved_mem.c | 2 +- include/linux/of_irq.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) -- 2.11.0 diff --git a/drivers/of/of_reserved_mem.c b/drivers/of/of_reserved_mem.c index 4dec07ea510f..d507c3569a88 100644 --- a/drivers/of/of_reserved_mem.c +++ b/drivers/of/of_reserved_mem.c @@ -197,7 +197,7 @@ static int __init __reserved_mem_init_node(struct reserved_mem *rmem) const struct of_device_id *i; for (i = __reservedmem_of_table; i < &__rmem_of_table_sentinel; i++) { - int const (*initfn)(struct reserved_mem *rmem) = i->data; + reservedmem_of_init_fn initfn = i->data; const char *compat = i->compatible; if (!of_flat_dt_is_compatible(rmem->fdt_node, compat)) diff --git a/include/linux/of_irq.h b/include/linux/of_irq.h index ec6b11deb773..1e0deb8e8494 100644 --- a/include/linux/of_irq.h +++ b/include/linux/of_irq.h @@ -8,7 +8,7 @@ #include #include -typedef int const (*of_irq_init_cb_t)(struct device_node *, struct device_node *); +typedef int (*of_irq_init_cb_t)(struct device_node *, struct device_node *); /* * Workarounds only applied to 32bit powermac machines