From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755131AbdKNLlT (ORCPT ); Tue, 14 Nov 2017 06:41:19 -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 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:K0:AG+nCzk2KppYZWGbE/E2WcVwZDZa2ChxAT5xcpxqyPTL/UbPtmX pqKNdH6ws+Ceesj+O74WgiBK8EK4fCXLGh2rfsqhIYdtKhTqRu6+1ZuICGyfOANw0N+WDyd AO9Z/6Yrf8Vgqqetxufxm86QuO/Heox3nI1ebdD2+JUbnEWxPq0IQadFSGizw1Zmf89W+zB ZPJMfzhyN4KP1Fnydy/ZA== X-UI-Out-Filterresults: notjunk:1;V01:K0:MrrK97by+kA=:E6zGWn1d4bTEMRfAUi60c3 ZHdXyPyeUmL00pAIT3DHOGeVbZp+RLND8M5qMpxie6cPBIr7KINW4+whoKRisA7Pj44NwW/m6 /1sK6S7tRNnPM3WHVXs3SUSAIsetUctAFL0+eTeCStkbDvKvVDdd6q38xg66N4KjHiRqnb/nB wM+jSldVY8QGCVH5FI33Ca4zfBGVXqHdR4Gvl2zCOBQNBycvzUplQZkiJWjJY2eFZ6ontFgmX iUDEVeeIDDbTa/Nhe8JRMAZqn/KsEvuFmrvN12bojR5dpQ2cZkeuepFAPyzDEMDmLRlW2X0M+ /PmSNLd1V3bRMEXwpYKN2sZFFzRvEM3RYypVHbwWnhHlzDlLGAuL98AMxNJP1cOlT2dtWbNYv Llc1xoR8r/aSbh4yiWwSWYT2s9uw6vE4PeoEg+9FqD7OEBz8LVqLSB2gmcUoQv7gSI5sUmd9G SLFtEqkaNl3ySMfuRZ4WAZjbLGsaPDcfU+auvSk0KQTGIKX8Vv/S6klSZcal5vZ9EycxAZ1M+ 9si0SeLSvMNM42Sp/oKAzJJtaMOrmcJoHY/jnzk0OaqQzAgWkzPqq8xkfSskdTr53glAlZHSs 1RfeXdC8JtexhrkGfUMZGMWWURHyfqxJoM3XFhWixiW/mNO+Lnq5eJZ0rFLssjrJaqY3B5bAF eOlHQiLys2fqqXhtzu8QS/JR4B1Bmx1iD2/YNcdU2Te5cZngjq7Tqx1p6K+S2mrfFc3VR7UbR /Ee3k7wY40dCRQYnITMxSZF5w0RQr/nI7/3Vvg== Sender: linux-kernel-owner@vger.kernel.org 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(+) 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; -- 2.9.0