From patchwork Tue Nov 14 11:40:31 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 118870 Delivered-To: patch@linaro.org Received: by 10.140.22.164 with SMTP id 33csp2931469qgn; Tue, 14 Nov 2017 03:41:21 -0800 (PST) X-Google-Smtp-Source: AGs4zMb0SyL9vShcVCB2jgEHT6foSqBrRC8s+EvnILUCxjH6vSzltw8Gt3p//Wjp2PlauqiZ2vLB X-Received: by 10.99.113.86 with SMTP id b22mr8820514pgn.309.1510659681389; Tue, 14 Nov 2017 03:41:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1510659681; cv=none; d=google.com; s=arc-20160816; b=h2WuHT1Tox9XP2qqTs2lyi2cvR1kNHAeRsJZmgMr9n3X+TTsB8bGsDGZbmJVixwiLN v9Ev4TWNo5RZMWbarPTyu684iM81RiLOLIa3T2y1DffvtJON1ta7mzqMX1svgJjuXAWP Pwoer/j54aaQK1vucu3ViKtEf7yn2DgC01NBSR183RPqpqBRVxkEq5nBH+sa7uc+na2+ YbA/BCwUMvlIzKDmGOPqK2Ce1x9A2ipursLQsiIujGJurqLxFY5u3GE4hhtyuCeX6LOk qvKPdCMH5C1JJ1Anqy3mUEKGNPbmuN+C/gtm9FuhH3oAn73BOy9+MeAanebLIHAKaLB0 EpBg== 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=FGw/aNMjUw9rDmxslexpwjET/fvzuTRMUN0b8K5hPkg=; b=qSLnxnZsQ7gjCJ7gAR2e3PTSw4JBDawicS86p8wuu2595PP6+TF67i+pejdcJQxIew AmS7U7HlDm44HzqeOOTwTBAHUsELjasOSjapiI56X7xB5GRZXlO1IXUOqd8/I1oCIdnF zVCA2fSPmZdHxlas47a9MhTDdpsWP554M+0Cu7lOa1O4gp/XY847lrLma4MpmH4moSa1 +rJLeSrG1PdrlKXOjwXmql4jYi4h/DHXhRwhfuQz9FSoF7G+FOu/n+qkIHVFr25jCRMj XkQMccWb1KXbzZ5dTBDZY7hSxH5InJVu+okY/apZgnLRekojmEmr6VOSlFNy7aRVq00z uDKQ== 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 j69si9061945pgd.355.2017.11.14.03.41.21; Tue, 14 Nov 2017 03:41:21 -0800 (PST) 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 S1755133AbdKNLlU (ORCPT + 27 others); Tue, 14 Nov 2017 06:41:20 -0500 Received: from mout.kundenserver.de ([212.227.126.134]:62073 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752887AbdKNLlM (ORCPT ); Tue, 14 Nov 2017 06:41:12 -0500 Received: from wuerfel.lan ([109.193.157.232]) by mrelayeu.kundenserver.de (mreue005 [212.227.15.129]) with ESMTPA (Nemesis) id 0MIjEq-1eCNjR4Brc-002Hw0; Tue, 14 Nov 2017 12:41:10 +0100 From: Arnd Bergmann To: Greg Kroah-Hartman Cc: Arnd Bergmann , Nicolai Stange , linux-kernel@vger.kernel.org Subject: [PATCH] debugfs: fix debugfs_real_fops() build error Date: Tue, 14 Nov 2017 12:40:31 +0100 Message-Id: <20171114114109.257057-1-arnd@arndb.de> X-Mailer: git-send-email 2.9.0 X-Provags-ID: V03:K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g== Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Some drivers use debugfs_real_fops() even when CONFIG_DEBUG_FS is disabled, which now leads to a build error: In file included from include/linux/list.h:9:0, from include/linux/wait.h:7, from include/linux/wait_bit.h:8, from include/linux/fs.h:6, from drivers/net/wireless/broadcom/b43legacy/debugfs.c:26: drivers/net/wireless/broadcom/b43legacy/debugfs.c: In function 'b43legacy_debugfs_read': drivers/net/wireless/broadcom/b43legacy/debugfs.c:224:23: error: implicit declaration of function 'debugfs_real_fops'; did you mean 'debugfs_create_bool'? [-Werror=implicit-function-declaration] My first impulse was to add another 'static inline' dummy function returning NULL for it, which would work fine. However, most callers feed the pointer into container_of(), so it seems a little dangerous here. Since all the callers are inside of a read/write file operation that gets eliminated in this configuration, so having an 'extern' declaration seems better here. If it ever gets used in a dangerous way, that will now result in a link error. Fixes: 7c8d469877b1 ("debugfs: add support for more elaborate ->d_fsdata") Signed-off-by: Arnd Bergmann --- include/linux/debugfs.h | 2 ++ 1 file changed, 2 insertions(+) -- 2.9.0 diff --git a/include/linux/debugfs.h b/include/linux/debugfs.h index f36ecc2a5712..3b0ba54cc4d5 100644 --- a/include/linux/debugfs.h +++ b/include/linux/debugfs.h @@ -216,6 +216,8 @@ static inline void debugfs_remove(struct dentry *dentry) static inline void debugfs_remove_recursive(struct dentry *dentry) { } +const struct file_operations *debugfs_real_fops(const struct file *filp); + static inline int debugfs_file_get(struct dentry *dentry) { return 0;