From: Kees Cook <[email protected]>

Similar to the pstore_info read() callback, there were too many arguments.
This switches to the new struct pstore_record pointer instead. This adds
"reason" and "part" to the record structure as well.

Signed-off-by: Kees Cook <[email protected]>
---
 fs/pstore/platform.c   | 12 +++++-------
 include/linux/pstore.h | 12 ++++++------
 2 files changed, 11 insertions(+), 13 deletions(-)

diff --git a/fs/pstore/platform.c b/fs/pstore/platform.c
index 54fe60bf88..755363c309 100644
--- a/fs/pstore/platform.c
+++ b/fs/pstore/platform.c
@@ -115,14 +115,12 @@ static void pstore_register_console(void)
 static void pstore_register_console(void) {}
 #endif
 
-static int pstore_write_compat(enum pstore_type_id type,
-                              enum kmsg_dump_reason reason,
-                              u64 *id, unsigned int part, int count,
-                              bool compressed, size_t size,
-                              struct pstore_info *psi)
+static int pstore_write_compat(struct pstore_record *record)
 {
-       return psi->write_buf(type, reason, id, part, psinfo->buf, compressed,
-                            size, psi);
+       return record->psi->write_buf(record->type, record->reason,
+                                     &record->id, record->part,
+                                     psinfo->buf, record->compressed,
+                                     record->size, record->psi);
 }
 
 /*
diff --git a/include/linux/pstore.h b/include/linux/pstore.h
index b136c354b9..15e1e3d6fa 100644
--- a/include/linux/pstore.h
+++ b/include/linux/pstore.h
@@ -52,10 +52,13 @@ struct pstore_record {
        enum pstore_type_id     type;
        u64                     id;
        char                    *buf;
-       int                     count;
-       bool                    compressed;
        ssize_t                 size;
        ssize_t                 ecc_notice_size;
+
+       int                     count;
+       enum kmsg_dump_reason   reason;
+       unsigned int            part;
+       bool                    compressed;
 };
 
 struct pstore_info {
@@ -67,10 +70,7 @@ struct pstore_info {
        int             (*open)(struct pstore_info *psi);
        int             (*close)(struct pstore_info *psi);
        ssize_t         (*read)(struct pstore_record *record);
-       int             (*write)(enum pstore_type_id type,
-                       enum kmsg_dump_reason reason, u64 *id,
-                       unsigned int part, int count, bool compressed,
-                       size_t size, struct pstore_info *psi);
+       int             (*write)(struct pstore_record *record);
        int             (*write_buf)(enum pstore_type_id type,
                        enum kmsg_dump_reason reason, u64 *id,
                        unsigned int part, const char *buf, bool compressed,
-- 
2.11.0


_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox

Reply via email to