* [android-common:mirror-pa-android12-5.10-staging 1683/1701] fs/pstore/inode.c:402:57: warning: suggest braces around empty body in an 'if' statement
@ 2020-11-23 20:56 kernel test robot
0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2020-11-23 20:56 UTC (permalink / raw)
To: kbuild-all
[-- Attachment #1: Type: text/plain, Size: 3749 bytes --]
tree: https://android.googlesource.com/kernel/common mirror-pa-android12-5.10-staging
head: 99c79b65e073d09c0c0158678b135939e0c448d0
commit: 104fd885e14774fe55f948fe5e1e51384ecb4da4 [1683/1701] ANDROID: pstore: add vendor hooks for pstore
config: i386-randconfig-a011-20201123 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-15) 9.3.0
reproduce (this is a W=1 build):
git remote add android-common https://android.googlesource.com/kernel/common
git fetch --no-tags android-common mirror-pa-android12-5.10-staging
git checkout 104fd885e14774fe55f948fe5e1e51384ecb4da4
# save the attached .config to linux build tree
make W=1 ARCH=i386
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/pstore/inode.c: In function 'pstore_mkfile':
>> fs/pstore/inode.c:402:57: warning: suggest braces around empty body in an 'if' statement [-Wempty-body]
402 | trace_android_vh_pstore_console_mkfile(&inode->i_size);
| ^
vim +/if +402 fs/pstore/inode.c
349
350 /*
351 * Make a regular file in the root directory of our file system.
352 * Load it up with "size" bytes of data from "buf".
353 * Set the mtime & ctime to the date that this record was originally stored.
354 */
355 int pstore_mkfile(struct dentry *root, struct pstore_record *record)
356 {
357 struct dentry *dentry;
358 struct inode *inode;
359 int rc = 0;
360 char name[PSTORE_NAMELEN];
361 struct pstore_private *private, *pos;
362 size_t size = record->size + record->ecc_notice_size;
363
364 if (WARN_ON(!inode_is_locked(d_inode(root))))
365 return -EINVAL;
366
367 rc = -EEXIST;
368 /* Skip records that are already present in the filesystem. */
369 mutex_lock(&records_list_lock);
370 list_for_each_entry(pos, &records_list, list) {
371 if (pos->record->type == record->type &&
372 pos->record->id == record->id &&
373 pos->record->psi == record->psi)
374 goto fail;
375 }
376
377 rc = -ENOMEM;
378 inode = pstore_get_inode(root->d_sb);
379 if (!inode)
380 goto fail;
381 inode->i_mode = S_IFREG | 0444;
382 inode->i_fop = &pstore_file_operations;
383 scnprintf(name, sizeof(name), "%s-%s-%llu%s",
384 pstore_type_to_name(record->type),
385 record->psi->name, record->id,
386 record->compressed ? ".enc.z" : "");
387
388 private = kzalloc(sizeof(*private), GFP_KERNEL);
389 if (!private)
390 goto fail_inode;
391
392 dentry = d_alloc_name(root, name);
393 if (!dentry)
394 goto fail_private;
395
396 private->dentry = dentry;
397 private->record = record;
398 inode->i_size = private->total_size = size;
399 inode->i_private = private;
400
401 if (record->type == PSTORE_TYPE_CONSOLE)
> 402 trace_android_vh_pstore_console_mkfile(&inode->i_size);
403
404 if (record->time.tv_sec)
405 inode->i_mtime = inode->i_ctime = record->time;
406
407 d_add(dentry, inode);
408
409 list_add(&private->list, &records_list);
410 mutex_unlock(&records_list_lock);
411
412 return 0;
413
414 fail_private:
415 free_pstore_private(private);
416 fail_inode:
417 iput(inode);
418 fail:
419 mutex_unlock(&records_list_lock);
420 return rc;
421 }
422
---
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: 24171 bytes --]
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2020-11-23 20:56 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-11-23 20:56 [android-common:mirror-pa-android12-5.10-staging 1683/1701] fs/pstore/inode.c:402:57: warning: suggest braces around empty body in an 'if' statement 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.