component.o is added to obj-y. Hence this is never compiled as
a module.
Remove meaningless modular code.
Signed-off-by: Masahiro Yamada <[email protected]>
---
drivers/base/component.c | 3 ---
1 file changed, 3 deletions(-)
diff --git a/drivers/base/component.c b/drivers/base/component.c
index 532a3a5d8f63..3a09036e772a 100644
--- a/drivers/base/component.c
+++ b/drivers/base/component.c
@@ -11,7 +11,6 @@
#include <linux/device.h>
#include <linux/kref.h>
#include <linux/list.h>
-#include <linux/module.h>
#include <linux/mutex.h>
#include <linux/slab.h>
#include <linux/debugfs.h>
@@ -775,5 +774,3 @@ void component_del(struct device *dev, const struct component_ops *ops)
kfree(component);
}
EXPORT_SYMBOL_GPL(component_del);
-
-MODULE_LICENSE("GPL v2");
--
2.17.1
The compilation of the code in fs/debugfs/ is controlled by
CONFIG_DEBUG_FS, which is a bool type option. Hence it is never
compiled as a module.
Remove meaningless modular code.
Signed-off-by: Masahiro Yamada <[email protected]>
---
fs/debugfs/file.c | 3 ---
fs/debugfs/inode.c | 3 ---
2 files changed, 6 deletions(-)
diff --git a/fs/debugfs/file.c b/fs/debugfs/file.c
index 87846aad594b..46e55037c0f9 100644
--- a/fs/debugfs/file.c
+++ b/fs/debugfs/file.c
@@ -9,7 +9,6 @@
* See Documentation/filesystems/ for more details.
*/
-#include <linux/module.h>
#include <linux/fs.h>
#include <linux/seq_file.h>
#include <linux/pagemap.h>
@@ -1005,7 +1004,6 @@ static int u32_array_release(struct inode *inode, struct file *file)
}
static const struct file_operations u32_array_fops = {
- .owner = THIS_MODULE,
.open = u32_array_open,
.release = u32_array_release,
.read = u32_array_read,
@@ -1149,7 +1147,6 @@ static int debugfs_devm_entry_open(struct inode *inode, struct file *f)
}
static const struct file_operations debugfs_devm_entry_ops = {
- .owner = THIS_MODULE,
.open = debugfs_devm_entry_open,
.release = single_release,
.read = seq_read,
diff --git a/fs/debugfs/inode.c b/fs/debugfs/inode.c
index 7b975dbb2bb4..f3478f7caab6 100644
--- a/fs/debugfs/inode.c
+++ b/fs/debugfs/inode.c
@@ -12,7 +12,6 @@
#define pr_fmt(fmt) "debugfs: " fmt
-#include <linux/module.h>
#include <linux/fs.h>
#include <linux/mount.h>
#include <linux/pagemap.h>
@@ -270,12 +269,10 @@ static struct dentry *debug_mount(struct file_system_type *fs_type,
}
static struct file_system_type debug_fs_type = {
- .owner = THIS_MODULE,
.name = "debugfs",
.mount = debug_mount,
.kill_sb = kill_litter_super,
};
-MODULE_ALIAS_FS("debugfs");
/**
* debugfs_lookup() - look up an existing debugfs file
--
2.17.1
On Sun, Nov 24, 2019 at 1:37 AM Masahiro Yamada
<[email protected]> wrote:
>
> The compilation of the code in fs/debugfs/ is controlled by
> CONFIG_DEBUG_FS, which is a bool type option. Hence it is never
> compiled as a module.
>
> Remove meaningless modular code.
>
> Signed-off-by: Masahiro Yamada <[email protected]>
> ---
Sorry, this is a build error. Please discard this.
--
Best Regards
Masahiro Yamada
Hi Masahiro,
I love your patch! Yet something to improve:
[auto build test ERROR on driver-core/driver-core-testing]
[also build test ERROR on v5.4-rc8 next-20191122]
[if your patch is applied to the wrong git tree, please drop us a note to help
improve the system. BTW, we also suggest to use '--base' option to specify the
base tree in git format-patch, please see https://stackoverflow.com/a/37406982]
url: https://github.com/0day-ci/linux/commits/Masahiro-Yamada/drivers-component-remove-modular-code/20191125-040836
base: https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core.git 0e4a459f56c32d3e52ae69a4b447db2f48a65f44
config: parisc-c3000_defconfig (attached as .config)
compiler: hppa-linux-gcc (GCC) 7.4.0
reproduce:
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# save the attached .config to linux build tree
GCC_VERSION=7.4.0 make.cross ARCH=parisc
If you fix the issue, kindly add following tag
Reported-by: kbuild test robot <[email protected]>
All error/warnings (new ones prefixed by >>):
In file included from fs//debugfs/file.c:12:0:
fs//debugfs/file.c: In function 'open_proxy_open':
>> include/linux/fs.h:2286:14: error: implicit declaration of function 'try_module_get'; did you mean '__node_set'? [-Werror=implicit-function-declaration]
(((fops) && try_module_get((fops)->owner) ? (fops) : NULL))
^
>> fs//debugfs/file.c:174:14: note: in expansion of macro 'fops_get'
real_fops = fops_get(real_fops);
^~~~~~~~
>> include/linux/fs.h:2288:17: error: implicit declaration of function 'module_put'; did you mean 'mangle_path'? [-Werror=implicit-function-declaration]
do { if (fops) module_put((fops)->owner); } while(0)
^
>> include/linux/fs.h:2297:3: note: in expansion of macro 'fops_put'
fops_put(__file->f_op); \
^~~~~~~~
>> fs//debugfs/file.c:182:2: note: in expansion of macro 'replace_fops'
replace_fops(filp, real_fops);
^~~~~~~~~~~~
cc1: some warnings being treated as errors
--
In file included from fs/debugfs/file.c:12:0:
fs/debugfs/file.c: In function 'open_proxy_open':
>> include/linux/fs.h:2286:14: error: implicit declaration of function 'try_module_get'; did you mean '__node_set'? [-Werror=implicit-function-declaration]
(((fops) && try_module_get((fops)->owner) ? (fops) : NULL))
^
fs/debugfs/file.c:174:14: note: in expansion of macro 'fops_get'
real_fops = fops_get(real_fops);
^~~~~~~~
>> include/linux/fs.h:2288:17: error: implicit declaration of function 'module_put'; did you mean 'mangle_path'? [-Werror=implicit-function-declaration]
do { if (fops) module_put((fops)->owner); } while(0)
^
>> include/linux/fs.h:2297:3: note: in expansion of macro 'fops_put'
fops_put(__file->f_op); \
^~~~~~~~
fs/debugfs/file.c:182:2: note: in expansion of macro 'replace_fops'
replace_fops(filp, real_fops);
^~~~~~~~~~~~
cc1: some warnings being treated as errors
vim +2286 include/linux/fs.h
7f78e035139405 Eric W. Biederman 2013-03-02 2239
f175f307dd0bd1 Al Viro 2017-10-15 2240 #ifdef CONFIG_BLOCK
152a0836667108 Al Viro 2010-07-25 2241 extern struct dentry *mount_bdev(struct file_system_type *fs_type,
152a0836667108 Al Viro 2010-07-25 2242 int flags, const char *dev_name, void *data,
152a0836667108 Al Viro 2010-07-25 2243 int (*fill_super)(struct super_block *, void *, int));
f175f307dd0bd1 Al Viro 2017-10-15 2244 #else
f175f307dd0bd1 Al Viro 2017-10-15 2245 static inline struct dentry *mount_bdev(struct file_system_type *fs_type,
f175f307dd0bd1 Al Viro 2017-10-15 2246 int flags, const char *dev_name, void *data,
f175f307dd0bd1 Al Viro 2017-10-15 2247 int (*fill_super)(struct super_block *, void *, int))
f175f307dd0bd1 Al Viro 2017-10-15 2248 {
f175f307dd0bd1 Al Viro 2017-10-15 2249 return ERR_PTR(-ENODEV);
f175f307dd0bd1 Al Viro 2017-10-15 2250 }
f175f307dd0bd1 Al Viro 2017-10-15 2251 #endif
fc14f2fef682df Al Viro 2010-07-25 2252 extern struct dentry *mount_single(struct file_system_type *fs_type,
fc14f2fef682df Al Viro 2010-07-25 2253 int flags, void *data,
fc14f2fef682df Al Viro 2010-07-25 2254 int (*fill_super)(struct super_block *, void *, int));
3c26ff6e499ee7 Al Viro 2010-07-25 2255 extern struct dentry *mount_nodev(struct file_system_type *fs_type,
3c26ff6e499ee7 Al Viro 2010-07-25 2256 int flags, void *data,
3c26ff6e499ee7 Al Viro 2010-07-25 2257 int (*fill_super)(struct super_block *, void *, int));
ea441d1104cf1e Al Viro 2011-11-16 2258 extern struct dentry *mount_subtree(struct vfsmount *mnt, const char *path);
^1da177e4c3f41 Linus Torvalds 2005-04-16 2259 void generic_shutdown_super(struct super_block *sb);
f175f307dd0bd1 Al Viro 2017-10-15 2260 #ifdef CONFIG_BLOCK
^1da177e4c3f41 Linus Torvalds 2005-04-16 2261 void kill_block_super(struct super_block *sb);
f175f307dd0bd1 Al Viro 2017-10-15 2262 #else
f175f307dd0bd1 Al Viro 2017-10-15 2263 static inline void kill_block_super(struct super_block *sb)
f175f307dd0bd1 Al Viro 2017-10-15 2264 {
f175f307dd0bd1 Al Viro 2017-10-15 2265 BUG();
f175f307dd0bd1 Al Viro 2017-10-15 2266 }
f175f307dd0bd1 Al Viro 2017-10-15 2267 #endif
^1da177e4c3f41 Linus Torvalds 2005-04-16 2268 void kill_anon_super(struct super_block *sb);
^1da177e4c3f41 Linus Torvalds 2005-04-16 2269 void kill_litter_super(struct super_block *sb);
^1da177e4c3f41 Linus Torvalds 2005-04-16 2270 void deactivate_super(struct super_block *sb);
74dbbdd7fdc117 Al Viro 2009-05-06 2271 void deactivate_locked_super(struct super_block *sb);
^1da177e4c3f41 Linus Torvalds 2005-04-16 2272 int set_anon_super(struct super_block *s, void *data);
cb50b348c71ffa Al Viro 2018-12-23 2273 int set_anon_super_fc(struct super_block *s, struct fs_context *fc);
0ee5dc676a5f8f Al Viro 2011-07-07 2274 int get_anon_bdev(dev_t *);
0ee5dc676a5f8f Al Viro 2011-07-07 2275 void free_anon_bdev(dev_t);
cb50b348c71ffa Al Viro 2018-12-23 2276 struct super_block *sget_fc(struct fs_context *fc,
cb50b348c71ffa Al Viro 2018-12-23 2277 int (*test)(struct super_block *, struct fs_context *),
cb50b348c71ffa Al Viro 2018-12-23 2278 int (*set)(struct super_block *, struct fs_context *));
^1da177e4c3f41 Linus Torvalds 2005-04-16 2279 struct super_block *sget(struct file_system_type *type,
^1da177e4c3f41 Linus Torvalds 2005-04-16 2280 int (*test)(struct super_block *,void *),
^1da177e4c3f41 Linus Torvalds 2005-04-16 2281 int (*set)(struct super_block *,void *),
9249e17fe094d8 David Howells 2012-06-25 2282 int flags, void *data);
bba0bd31b117cb Andreas Gruenbacher 2016-09-29 2283
^1da177e4c3f41 Linus Torvalds 2005-04-16 2284 /* Alas, no aliases. Too much hassle with bringing module.h everywhere */
^1da177e4c3f41 Linus Torvalds 2005-04-16 2285 #define fops_get(fops) \
^1da177e4c3f41 Linus Torvalds 2005-04-16 @2286 (((fops) && try_module_get((fops)->owner) ? (fops) : NULL))
^1da177e4c3f41 Linus Torvalds 2005-04-16 2287 #define fops_put(fops) \
^1da177e4c3f41 Linus Torvalds 2005-04-16 @2288 do { if (fops) module_put((fops)->owner); } while(0)
e84f9e57b90ca8 Al Viro 2013-09-22 2289 /*
e84f9e57b90ca8 Al Viro 2013-09-22 2290 * This one is to be used *ONLY* from ->open() instances.
e84f9e57b90ca8 Al Viro 2013-09-22 2291 * fops must be non-NULL, pinned down *and* module dependencies
e84f9e57b90ca8 Al Viro 2013-09-22 2292 * should be sufficient to pin the caller down as well.
e84f9e57b90ca8 Al Viro 2013-09-22 2293 */
e84f9e57b90ca8 Al Viro 2013-09-22 2294 #define replace_fops(f, fops) \
e84f9e57b90ca8 Al Viro 2013-09-22 2295 do { \
e84f9e57b90ca8 Al Viro 2013-09-22 2296 struct file *__file = (f); \
e84f9e57b90ca8 Al Viro 2013-09-22 @2297 fops_put(__file->f_op); \
e84f9e57b90ca8 Al Viro 2013-09-22 2298 BUG_ON(!(__file->f_op = (fops))); \
e84f9e57b90ca8 Al Viro 2013-09-22 2299 } while(0)
^1da177e4c3f41 Linus Torvalds 2005-04-16 2300
:::::: The code at line 2286 was first introduced by commit
:::::: 1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 Linux-2.6.12-rc2
:::::: TO: Linus Torvalds <[email protected]>
:::::: CC: Linus Torvalds <[email protected]>
---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/hyperkitty/list/[email protected] Intel Corporation