Received: by 2002:a25:7ec1:0:0:0:0:0 with SMTP id z184csp3039853ybc; Thu, 21 Nov 2019 02:22:05 -0800 (PST) X-Google-Smtp-Source: APXvYqzr3rtQhwp4dORvalq1X2q7P/nUCVoXahhJrE07g6eWf2Lp5pgZecHOXqfU1lbtFFE+6cNW X-Received: by 2002:a17:906:f18a:: with SMTP id gs10mr12664377ejb.107.1574331725747; Thu, 21 Nov 2019 02:22:05 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1574331725; cv=none; d=google.com; s=arc-20160816; b=bZvMhm7dHcKSlUiVUzOmZapGwAYJqmyI5WMYRujhXKOxC6Ofbtd5abXi+lSEYC0+/4 ydRlGqJ4gF+5cKJI9Sf+2LmFvvsgeSrjKrpHjtCMDphHewYHHkwg7aFFKfESmksRKFHJ 5yWaHZ8dexW+JmyRT5/kGFNy4mFgyywgqjN23o8A1VN0uVvoCVwasa1S/JbXSr6aF6/j WSxytWK9j2XByG5QfER6LHRuXiT0tcWII3gqHX7oiBJoS2BSAlFMRUdjYp85HTVU5yhx Xm6qAtzGBFdB+BYou4d+7U3Ffs+RBtMMaN/gp+K4I/WgKz2zk9LJHh3Yvl6+OZ+sGFGR EPRw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:user-agent:content-disposition :mime-version:subject:cc:to:from:date; bh=zbXIueWaQH9h1YpuUReLEFvzHpRcMwhcJhC9HjhSVfc=; b=IGDlxX/tVyd5AkYA30gm3m39t22ch5nxxWob04h2hBP5eX/X1ZewlzUwIMhw6S5WF8 TbG76MwOCbQtXA86rK9CT4YzmHUpE9133Jzp/p7yVULP6ofqHmVlWoFbM+fp9p2mw3oY DkjK9CouQ83sTZc2kOPZIggfl/GpUtvZLUvBEh99vo0AF3kYT0wQ/TZhjoRzBMpmgAlp FjeWx6kSl1fzKSBbqemUJVRtIiCBHdjqVlixXER935wavTULiaOBykEeXIaHg1tAor13 9YKOYLFq91vhs8uJ4VNbKOWS0pq085bDeTsig5zOwIrWU1laGoE8k31uyUKJTs04Jj9X nm5w== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ac.auone-net.jp Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id c7si1270744ejz.392.2019.11.21.02.21.41; Thu, 21 Nov 2019 02:22:05 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ac.auone-net.jp Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726685AbfKUKUX (ORCPT + 99 others); Thu, 21 Nov 2019 05:20:23 -0500 Received: from snd00014.auone-net.jp ([111.86.247.14]:23395 "EHLO dmta0003.auone-net.jp" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726132AbfKUKUX (ORCPT ); Thu, 21 Nov 2019 05:20:23 -0500 Received: from ppp.dion.ne.jp by dmta0003.auone-net.jp with ESMTP id <20191121102021787.MLMY.25002.ppp.dion.ne.jp@dmta0003.auone-net.jp>; Thu, 21 Nov 2019 19:20:21 +0900 Date: Thu, 21 Nov 2019 19:20:21 +0900 From: Kusanagi Kouichi To: Greg Kroah-Hartman Cc: "Rafael J. Wysocki" , Steven Rostedt , Ingo Molnar , linux-kernel@vger.kernel.org Subject: [PATCH] debugfs: Fix !DEBUG_FS debugfs_create_automount MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.12.2 (2019-09-21) Message-Id: <20191121102021787.MLMY.25002.ppp.dion.ne.jp@dmta0003.auone-net.jp> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org If DEBUG_FS=n, compile fails with the following error: kernel/trace/trace.c: In function 'tracing_init_dentry': kernel/trace/trace.c:8658:9: error: passing argument 3 of 'debugfs_create_automount' from incompatible pointer type [-Werror=incompatible-pointer-types] 8658 | trace_automount, NULL); | ^~~~~~~~~~~~~~~ | | | struct vfsmount * (*)(struct dentry *, void *) In file included from kernel/trace/trace.c:24: ./include/linux/debugfs.h:206:25: note: expected 'struct vfsmount * (*)(void *)' but argument is of type 'struct vfsmount * (*)(struct dentry *, void *)' 206 | struct vfsmount *(*f)(void *), | ~~~~~~~~~~~~~~~~~~~^~~~~~~~~~ Signed-off-by: Kusanagi Kouichi --- include/linux/debugfs.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/include/linux/debugfs.h b/include/linux/debugfs.h index 58424eb3b329..798f0b9b43ae 100644 --- a/include/linux/debugfs.h +++ b/include/linux/debugfs.h @@ -54,6 +54,8 @@ static const struct file_operations __fops = { \ .llseek = no_llseek, \ } +typedef struct vfsmount *(*debugfs_automount_t)(struct dentry *, void *); + #if defined(CONFIG_DEBUG_FS) struct dentry *debugfs_lookup(const char *name, struct dentry *parent); @@ -75,7 +77,6 @@ struct dentry *debugfs_create_dir(const char *name, struct dentry *parent); struct dentry *debugfs_create_symlink(const char *name, struct dentry *parent, const char *dest); -typedef struct vfsmount *(*debugfs_automount_t)(struct dentry *, void *); struct dentry *debugfs_create_automount(const char *name, struct dentry *parent, debugfs_automount_t f, @@ -203,7 +204,7 @@ static inline struct dentry *debugfs_create_symlink(const char *name, static inline struct dentry *debugfs_create_automount(const char *name, struct dentry *parent, - struct vfsmount *(*f)(void *), + debugfs_automount_t f, void *data) { return ERR_PTR(-ENODEV); -- 2.24.0