]> granicus.if.org Git - strace/commitdiff
Mpersify mtd.c
authorDmitry V. Levin <ldv@altlinux.org>
Sat, 28 May 2016 18:46:39 +0000 (18:46 +0000)
committerDmitry V. Levin <ldv@altlinux.org>
Sat, 28 May 2016 19:16:32 +0000 (19:16 +0000)
* defs.h (mtd_ioctl): Remove.
* mtd.c: Mpersify struct mtd_oob_buf and ioctl numbers.
(mtd_ioctl): Mpersify.

defs.h
mtd.c

diff --git a/defs.h b/defs.h
index b2a7f4d8222a20f67d6f7778847e9c322d2c7028..e221d4c33644954b33519b2e61b75296d48057cc 100644 (file)
--- a/defs.h
+++ b/defs.h
@@ -664,7 +664,6 @@ extern int file_ioctl(struct tcb *, const unsigned int, long);
 extern int fs_x_ioctl(struct tcb *, const unsigned int, long);
 extern int hdio_ioctl(struct tcb *, const unsigned int, long);
 extern int loop_ioctl(struct tcb *, const unsigned int, long);
-extern int mtd_ioctl(struct tcb *, const unsigned int, long);
 extern int ptp_ioctl(struct tcb *, const unsigned int, long);
 extern int scsi_ioctl(struct tcb *, const unsigned int, long);
 extern int sock_ioctl(struct tcb *, const unsigned int, long);
diff --git a/mtd.c b/mtd.c
index d9ce29229624cbcdddba8fa6b1aa13b4f6c21ca3..52714ae3c848612a0290a1a8095ee19fe5c3615f 100644 (file)
--- a/mtd.c
+++ b/mtd.c
@@ -26,6 +26,8 @@
 
 #include "defs.h"
 
+#include DEF_MPERS_TYPE(struct_mtd_oob_buf)
+
 #include <linux/ioctl.h>
 
 /* The mtd api changes quickly, so we have to keep a local copy */
 # include <mtd/mtd-abi.h>
 #endif
 
+typedef struct mtd_oob_buf struct_mtd_oob_buf;
+
+#include MPERS_DEFS
+
 #include "xlat/mtd_mode_options.h"
 #include "xlat/mtd_file_mode_options.h"
 #include "xlat/mtd_type_options.h"
@@ -71,7 +77,7 @@ decode_erase_info_user64(struct tcb *tcp, const long addr)
 static void
 decode_mtd_oob_buf(struct tcb *tcp, const long addr)
 {
-       struct mtd_oob_buf mbuf;
+       struct_mtd_oob_buf mbuf;
 
        tprints(", ");
        if (umove_or_printaddr(tcp, addr, &mbuf))
@@ -235,8 +241,8 @@ decode_mtd_ecc_stats(struct tcb *tcp, const long addr)
                es.corrected, es.failed, es.badblocks, es.bbtblocks);
 }
 
-int
-mtd_ioctl(struct tcb *tcp, const unsigned int code, const long arg)
+MPERS_PRINTER_DECL(int, mtd_ioctl, struct tcb *tcp,
+                  const unsigned int code, const long arg)
 {
        switch (code) {
        case MEMERASE: