Kexec Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: kbuild test robot <lkp@intel.com>
To: Rahul Lakkireddy <rahul.lakkireddy@chelsio.com>
Cc: ebiederm@xmission.com, indranil@chelsio.com,
	netdev@vger.kernel.org, nirranjan@chelsio.com,
	kexec@lists.infradead.org, linux-kernel@vger.kernel.org,
	stephen@networkplumber.org, ganeshgr@chelsio.com,
	Rahul Lakkireddy <rahul.lakkireddy@chelsio.com>,
	kbuild-all@01.org, linux-fsdevel@vger.kernel.org,
	akpm@linux-foundation.org, torvalds@linux-foundation.org,
	davem@davemloft.net, viro@zeniv.linux.org.uk
Subject: Re: [PATCH net-next v2 1/2] fs/crashdd: add API to collect hardware dump in second kernel
Date: Sun, 25 Mar 2018 20:43:23 +0800	[thread overview]
Message-ID: <201803252018.meBOQlg2%fengguang.wu@intel.com> (raw)
In-Reply-To: <296ffbd47fd4f30238689e636bd2480683224227.1521888444.git.rahul.lakkireddy@chelsio.com>

[-- Attachment #1: Type: text/plain, Size: 7182 bytes --]

Hi Rahul,

Thank you for the patch! Perhaps something to improve:

[auto build test WARNING on net-next/master]

url:    https://github.com/0day-ci/linux/commits/Rahul-Lakkireddy/fs-crashdd-add-API-to-collect-hardware-dump-in-second-kernel/20180325-191308
config: i386-randconfig-s0-03251817 (attached as .config)
compiler: gcc-6 (Debian 6.4.0-9) 6.4.0 20171026
reproduce:
        # save the attached .config to linux build tree
        make ARCH=i386 

All warnings (new ones prefixed by >>):

   In file included from fs//crashdd/crashdd.c:8:0:
   fs//crashdd/crashdd_internal.h:13:23: error: field 'bin_attr' has incomplete type
     struct bin_attribute bin_attr; /* Binary dump file's attributes */
                          ^~~~~~~~
   fs//crashdd/crashdd.c: In function 'crashdd_read':
   fs//crashdd/crashdd.c:19:43: error: dereferencing pointer to incomplete type 'struct bin_attribute'
     struct crashdd_dump_node *dump = bin_attr->private;
                                              ^~
   fs//crashdd/crashdd.c: In function 'crashdd_mkdir':
   fs//crashdd/crashdd.c:27:9: error: implicit declaration of function 'kobject_create_and_add' [-Werror=implicit-function-declaration]
     return kobject_create_and_add(name, crashdd_kobj);
            ^~~~~~~~~~~~~~~~~~~~~~
   fs//crashdd/crashdd.c:27:9: warning: return makes pointer from integer without a cast [-Wint-conversion]
     return kobject_create_and_add(name, crashdd_kobj);
            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   fs//crashdd/crashdd.c: In function 'crashdd_add_file':
   fs//crashdd/crashdd.c:39:9: error: implicit declaration of function 'sysfs_create_bin_file' [-Werror=implicit-function-declaration]
     return sysfs_create_bin_file(kobj, &dump->bin_attr);
            ^~~~~~~~~~~~~~~~~~~~~
   fs//crashdd/crashdd.c: In function 'crashdd_rmdir':
   fs//crashdd/crashdd.c:44:2: error: implicit declaration of function 'kobject_put' [-Werror=implicit-function-declaration]
     kobject_put(kobj);
     ^~~~~~~~~~~
   In file included from include/linux/kernel.h:10:0,
                    from include/linux/list.h:9,
                    from include/linux/preempt.h:11,
                    from include/linux/spinlock.h:51,
                    from include/linux/vmalloc.h:5,
                    from fs//crashdd/crashdd.c:4:
   fs//crashdd/crashdd.c: In function 'crashdd_get_driver':
   fs//crashdd/crashdd.c:101:25: error: dereferencing pointer to incomplete type 'struct kobject'
      if (!strcmp(node->kobj->name, name)) {
                            ^
   include/linux/compiler.h:58:30: note: in definition of macro '__trace_if'
     if (__builtin_constant_p(!!(cond)) ? !!(cond) :   \
                                 ^~~~
>> fs//crashdd/crashdd.c:101:3: note: in expansion of macro 'if'
      if (!strcmp(node->kobj->name, name)) {
      ^~
   fs//crashdd/crashdd.c: In function 'crashdd_init':
   fs//crashdd/crashdd.c:227:51: error: 'kernel_kobj' undeclared (first use in this function)
     crashdd_kobj = kobject_create_and_add("crashdd", kernel_kobj);
                                                      ^~~~~~~~~~~
   fs//crashdd/crashdd.c:227:51: note: each undeclared identifier is reported only once for each function it appears in
   fs//crashdd/crashdd.c: In function 'crashdd_add_file':
   fs//crashdd/crashdd.c:40:1: warning: control reaches end of non-void function [-Wreturn-type]
    }
    ^
   cc1: some warnings being treated as errors

vim +/if +101 fs//crashdd/crashdd.c

     3	
   > 4	#include <linux/vmalloc.h>
     5	#include <linux/crash_dump.h>
     6	#include <linux/crashdd.h>
     7	
     8	#include "crashdd_internal.h"
     9	
    10	static LIST_HEAD(crashdd_list);
    11	static DEFINE_MUTEX(crashdd_mutex);
    12	
    13	static struct kobject *crashdd_kobj;
    14	
    15	static ssize_t crashdd_read(struct file *filp, struct kobject *kobj,
    16				    struct bin_attribute *bin_attr,
    17				    char *buf, loff_t fpos, size_t count)
    18	{
    19		struct crashdd_dump_node *dump = bin_attr->private;
    20	
    21		memcpy(buf, dump->buf + fpos, count);
    22		return count;
    23	}
    24	
    25	static struct kobject *crashdd_mkdir(const char *name)
    26	{
    27		return kobject_create_and_add(name, crashdd_kobj);
    28	}
    29	
    30	static int crashdd_add_file(struct kobject *kobj, const char *name,
    31				    struct crashdd_dump_node *dump)
    32	{
    33		dump->bin_attr.attr.name = name;
    34		dump->bin_attr.attr.mode = 0444;
    35		dump->bin_attr.size = dump->size;
    36		dump->bin_attr.read = crashdd_read;
    37		dump->bin_attr.private = dump;
    38	
    39		return sysfs_create_bin_file(kobj, &dump->bin_attr);
    40	}
    41	
    42	static void crashdd_rmdir(struct kobject *kobj)
    43	{
    44		kobject_put(kobj);
    45	}
    46	
    47	/**
    48	 * crashdd_init_driver - create a sysfs driver entry.
    49	 * @name: Name of the directory.
    50	 *
    51	 * Creates a directory under /sys/kernel/crashdd/ with @name.  Allocates
    52	 * and saves the sysfs entry.  The sysfs entry is added to the global
    53	 * list and then returned to the caller. On failure, returns NULL.
    54	 */
    55	static struct crashdd_driver_node *crashdd_init_driver(const char *name)
    56	{
    57		struct crashdd_driver_node *node;
    58	
    59		node = vzalloc(sizeof(*node));
    60		if (!node)
    61			return NULL;
    62	
    63		/* Create a driver's directory under /sys/kernel/crashdd/ */
    64		node->kobj = crashdd_mkdir(name);
    65		if (!node->kobj) {
    66			vfree(node);
    67			return NULL;
    68		}
    69	
    70		atomic_set(&node->refcnt, 1);
    71	
    72		/* Initialize the list of dumps that go under this driver's
    73		 * directory.
    74		 */
    75		INIT_LIST_HEAD(&node->dump_list);
    76	
    77		/* Add the driver's entry to global list */
    78		mutex_lock(&crashdd_mutex);
    79		list_add_tail(&node->list, &crashdd_list);
    80		mutex_unlock(&crashdd_mutex);
    81	
    82		return node;
    83	}
    84	
    85	/**
    86	 * crashdd_get_driver - get an exisiting sysfs driver entry.
    87	 * @name: Name of the directory.
    88	 *
    89	 * Searches and fetches a sysfs entry having @name.  If @name is
    90	 * found, then the reference count is incremented and the entry
    91	 * is returned.  If @name is not found, NULL is returned.
    92	 */
    93	static struct crashdd_driver_node *crashdd_get_driver(const char *name)
    94	{
    95		struct crashdd_driver_node *node;
    96		int found = 0;
    97	
    98		/* Search for an existing driver sysfs entry having @name */
    99		mutex_lock(&crashdd_mutex);
   100		list_for_each_entry(node, &crashdd_list, list) {
 > 101			if (!strcmp(node->kobj->name, name)) {
   102				atomic_inc(&node->refcnt);
   103				found = 1;
   104				break;
   105			}
   106		}
   107		mutex_unlock(&crashdd_mutex);
   108	
   109		if (found)
   110			return node;
   111	
   112		/* No driver with @name found */
   113		return NULL;
   114	}
   115	

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 32369 bytes --]

[-- Attachment #3: Type: text/plain, Size: 143 bytes --]

_______________________________________________
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec

  reply	other threads:[~2018-03-25 12:45 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-24 10:56 [PATCH net-next v2 0/2] kernel: add support to collect hardware logs in crash recovery kernel Rahul Lakkireddy
2018-03-24 10:56 ` [PATCH net-next v2 1/2] fs/crashdd: add API to collect hardware dump in second kernel Rahul Lakkireddy
2018-03-25 12:43   ` kbuild test robot [this message]
2018-03-30 10:39   ` Jiri Pirko
2018-03-30 10:51     ` Rahul Lakkireddy
2018-03-30 18:42       ` Eric W. Biederman
2018-04-02  9:11         ` Jiri Pirko
2018-04-02 12:21           ` Andrew Lunn
2018-04-02 12:30           ` Rahul Lakkireddy
2018-04-03  7:04             ` Jiri Pirko
2018-03-30 15:11     ` Andrew Lunn
2018-04-02  9:12       ` Jiri Pirko
2018-04-03  5:43         ` Alex Vesker
2018-04-03 12:35           ` Andrew Lunn
2018-03-24 10:56 ` [PATCH net-next v2 2/2] cxgb4: " Rahul Lakkireddy
2018-03-24 15:18   ` Andrew Lunn
2018-03-24 22:18   ` Thadeu Lima de Souza Cascardo
2018-03-25  0:17     ` Eric W. Biederman
2018-03-24 15:20 ` [PATCH net-next v2 0/2] kernel: add support to collect hardware logs in crash recovery kernel Eric W. Biederman
2018-03-26 13:45   ` Rahul Lakkireddy
2018-03-27 13:17     ` Eric W. Biederman
2018-03-27 15:27       ` Rahul Lakkireddy
2018-03-27 15:59         ` Eric W. Biederman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=201803252018.meBOQlg2%fengguang.wu@intel.com \
    --to=lkp@intel.com \
    --cc=akpm@linux-foundation.org \
    --cc=davem@davemloft.net \
    --cc=ebiederm@xmission.com \
    --cc=ganeshgr@chelsio.com \
    --cc=indranil@chelsio.com \
    --cc=kbuild-all@01.org \
    --cc=kexec@lists.infradead.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=nirranjan@chelsio.com \
    --cc=rahul.lakkireddy@chelsio.com \
    --cc=stephen@networkplumber.org \
    --cc=torvalds@linux-foundation.org \
    --cc=viro@zeniv.linux.org.uk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox