From a0866bce3560aefe25a51bcdb659108172d5f926 Mon Sep 17 00:00:00 2001 From: "Dmitry V. Levin" Date: Sat, 28 May 2016 18:46:39 +0000 Subject: [PATCH] Mpersify mtd.c * defs.h (mtd_ioctl): Remove. * mtd.c: Mpersify struct mtd_oob_buf and ioctl numbers. (mtd_ioctl): Mpersify. --- defs.h | 1 - mtd.c | 12 +++++++++--- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/defs.h b/defs.h index b2a7f4d8..e221d4c3 100644 --- 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 d9ce2922..52714ae3 100644 --- a/mtd.c +++ b/mtd.c @@ -26,6 +26,8 @@ #include "defs.h" +#include DEF_MPERS_TYPE(struct_mtd_oob_buf) + #include /* The mtd api changes quickly, so we have to keep a local copy */ @@ -36,6 +38,10 @@ # include #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: -- 2.40.0