* [trace:ftrace/eventfs 27/30] fs/tracefs/event_inode.c:244:24: warning: ISO C90 forbids mixing declarations and code
@ 2021-04-06 0:50 kernel test robot
0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2021-04-06 0:50 UTC (permalink / raw)
To: kbuild-all
[-- Attachment #1: Type: text/plain, Size: 7698 bytes --]
tree: https://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace.git ftrace/eventfs
head: b33eb69f9071c21282319a8436ecde81aefc70c1
commit: 02514bdd3c4be7f4a5b5029915e7f7a992a888c3 [27/30] event_inode: 2.1
config: powerpc64-randconfig-r012-20210406 (attached as .config)
compiler: clang version 13.0.0 (https://github.com/llvm/llvm-project 2760a808b9916a2839513b7fd7314a464f52481e)
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# install powerpc64 cross compiling tool for clang build
# apt-get install binutils-powerpc64-linux-gnu
# https://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace.git/commit/?id=02514bdd3c4be7f4a5b5029915e7f7a992a888c3
git remote add trace https://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace.git
git fetch --no-tags trace ftrace/eventfs
git checkout 02514bdd3c4be7f4a5b5029915e7f7a992a888c3
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=powerpc64
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
All warnings (new ones prefixed by >>):
fs/tracefs/event_inode.c:62:16: warning: no previous prototype for function 'eventfs_create_file' [-Wmissing-prototypes]
struct dentry *eventfs_create_file(const char *name, umode_t mode,
^
fs/tracefs/event_inode.c:62:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
struct dentry *eventfs_create_file(const char *name, umode_t mode,
^
static
fs/tracefs/event_inode.c:109:46: error: too few arguments to function call, expected 3, have 2
generic_fillattr(d_inode(path->dentry), stat);
~~~~~~~~~~~~~~~~ ^
include/linux/fs.h:3211:6: note: 'generic_fillattr' declared here
void generic_fillattr(struct user_namespace *, struct inode *, struct kstat *);
^
fs/tracefs/event_inode.c:177:6: warning: incompatible pointer to integer conversion initializing 'int' with an expression of type 'struct dentry *' [-Wint-conversion]
int ret = simple_lookup(dir, dentry, flags);
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
fs/tracefs/event_inode.c:182:10: warning: incompatible integer to pointer conversion returning 'int' from a function with result type 'struct dentry *' [-Wint-conversion]
return -EINVAL;
^~~~~~~
fs/tracefs/event_inode.c:194:9: warning: incompatible integer to pointer conversion returning 'int' from a function with result type 'struct dentry *' [-Wint-conversion]
return ret; // simple_lookup(dir, dentry, flags);
^~~
fs/tracefs/event_inode.c:202:28: warning: unused variable 'n' [-Wunused-variable]
struct eventfs_file *ef, *n;
^
fs/tracefs/event_inode.c:202:23: warning: unused variable 'ef' [-Wunused-variable]
struct eventfs_file *ef, *n;
^
fs/tracefs/event_inode.c:201:24: warning: unused variable 'ei' [-Wunused-variable]
struct eventfs_inode *ei;
^
fs/tracefs/event_inode.c:203:16: warning: unused variable 'inode' [-Wunused-variable]
struct inode *inode = file_inode(file);
^
fs/tracefs/event_inode.c:200:24: warning: unused variable 'ti' [-Wunused-variable]
struct tracefs_inode *ti;
^
>> fs/tracefs/event_inode.c:244:24: warning: ISO C90 forbids mixing declarations and code [-Wdeclaration-after-statement]
struct tracefs_inode *ti;
^
>> fs/tracefs/event_inode.c:270:5: warning: no previous prototype for function 'dcache_dir_open_wrapper' [-Wmissing-prototypes]
int dcache_dir_open_wrapper(struct inode *inode, struct file *file)
^
fs/tracefs/event_inode.c:270:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
int dcache_dir_open_wrapper(struct inode *inode, struct file *file)
^
static
fs/tracefs/event_inode.c:313:13: error: incompatible function pointer types initializing 'int (*)(struct user_namespace *, const struct path *, struct kstat *, u32, unsigned int)' (aka 'int (*)(struct user_namespace *, const struct path *, struct kstat *, unsigned int, unsigned int)') with an expression of type 'int (const struct path *, struct kstat *, u32, unsigned int)' (aka 'int (const struct path *, struct kstat *, unsigned int, unsigned int)') [-Werror,-Wincompatible-function-pointer-types]
.getattr = eventfs_root_getattr,
^~~~~~~~~~~~~~~~~~~~
11 warnings and 2 errors generated.
vim +244 fs/tracefs/event_inode.c
238
239 static int eventfs_release (struct inode *inode, struct file *file)
240 {
241 struct dentry *dentry = file_dentry(file);
242 printk("%s:%d dir = %s\n", __func__, __LINE__, dentry->d_iname);
243
> 244 struct tracefs_inode *ti;
245 struct eventfs_inode *ei;
246 struct eventfs_file *ef, *n;
247
248 ti = get_tracefs(inode);
249 if (!(ti->flags & TRACEFS_EVENT_INODE))
250 return -EINVAL;
251
252 ei = ti->private;
253
254 list_for_each_entry_safe(ef, n, &ei->e_top_files, list) {
255 if (ef->status == FILE_CREATED) {
256 printk("kref_put: free file %p, name = %s\n", ef, ef->dentry->d_iname);
257 kref_put(&ef->kref, eventfs_release_ef);
258
259 // dput(ef->dentry);
260 // d_delete(ef->dentry);
261 // dput(ef->dentry);
262 // ef->status = FILE_NOT_CREATED;
263 // printk("Done: free file %p, name = %s\n", ef, ef->dentry->d_iname);
264 }
265 }
266 return 0;
267
268 }
269
> 270 int dcache_dir_open_wrapper(struct inode *inode, struct file *file)
271 {
272
273 struct tracefs_inode *ti;
274 struct eventfs_inode *ei;
275 struct eventfs_file *ef, *n;
276 struct inode *f_inode = file_inode(file);
277 struct dentry *dentry = file_dentry(file);
278
279 printk("%s:%d dir = %s\n", __func__, __LINE__, dentry->d_iname);
280
281 ti = get_tracefs(f_inode);
282 if (!(ti->flags & TRACEFS_EVENT_INODE))
283 return -EINVAL;
284
285 ei = ti->private;
286
287 list_for_each_entry_safe(ef, n, &ei->e_top_files, list) {
288 if (ef->status == FILE_NOT_CREATED) {
289 ef->status = FILE_CREATED;
290 ef->dentry = eventfs_create_file(ef->name, ef->mode, dentry, ef->data, ef->fops, 0);
291 kref_init(&ef->kref);
292 printk("kref_init: %s:%d dir = %s\n", __func__, __LINE__, dentry->d_iname);
293 } else {
294 kref_get(&ef->kref);
295 printk("kref_get: %s:%d dir = %s\n", __func__, __LINE__, dentry->d_iname);
296 }
297 }
298
299 return dcache_dir_open(inode, file);
300 }
301
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org
[-- Attachment #2: config.gz --]
[-- Type: application/gzip, Size: 25006 bytes --]
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2021-04-06 0:50 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-06 0:50 [trace:ftrace/eventfs 27/30] fs/tracefs/event_inode.c:244:24: warning: ISO C90 forbids mixing declarations and code kernel test robot
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.