Skip to content

Commit

Permalink
pstore: Headers should include all stuff they use
Browse files Browse the repository at this point in the history
Headers should really include all the needed prototypes, types, defines
etc. to be self-contained. This is a long-standing issue, but apparently
the new tracing code unearthed it (SMP=n is also a prerequisite):

In file included from fs/pstore/internal.h:4:0,
                 from fs/pstore/ftrace.c:21:
include/linux/pstore.h:43:15: error: field ‘read_mutex’ has incomplete type

While at it, I also added the following:

linux/types.h -> size_t, phys_addr_t, uXX and friends
linux/spinlock.h -> spinlock_t
linux/errno.h -> Exxxx
linux/time.h -> struct timespec (struct passed by value)
struct module and rs_control forward declaration (passed via pointers).

Signed-off-by: Anton Vorontsov <anton.vorontsov@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
Anton Vorontsov authored and Greg Kroah-Hartman committed Jul 17, 2012
1 parent bfce7cf commit 67a101f
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 0 deletions.
2 changes: 2 additions & 0 deletions fs/pstore/internal.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
#ifndef __PSTORE_INTERNAL_H__
#define __PSTORE_INTERNAL_H__

#include <linux/types.h>
#include <linux/time.h>
#include <linux/pstore.h>

#if NR_CPUS <= 2 && defined(CONFIG_ARM_THUMB)
Expand Down
6 changes: 6 additions & 0 deletions include/linux/pstore.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@

#include <linux/time.h>
#include <linux/kmsg_dump.h>
#include <linux/mutex.h>
#include <linux/types.h>
#include <linux/spinlock.h>
#include <linux/errno.h>

/* types */
enum pstore_type_id {
Expand All @@ -34,6 +38,8 @@ enum pstore_type_id {
PSTORE_TYPE_UNKNOWN = 255
};

struct module;

struct pstore_info {
struct module *owner;
char *name;
Expand Down
1 change: 1 addition & 0 deletions include/linux/pstore_ram.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
#include <linux/init.h>

struct persistent_ram_buffer;
struct rs_control;

struct persistent_ram_zone {
phys_addr_t paddr;
Expand Down

0 comments on commit 67a101f

Please sign in to comment.