diff --git a/ee/iopreboot/src/imgdrv/src/imgdrv.c b/ee/iopreboot/src/imgdrv/src/imgdrv.c index 684a4ffb049..f72c3af30cf 100644 --- a/ee/iopreboot/src/imgdrv/src/imgdrv.c +++ b/ee/iopreboot/src/imgdrv/src/imgdrv.c @@ -22,7 +22,6 @@ IRX_ID(MODNAME, 1, 1); // Function prototypes -static int imgdrv_dummy(void); static int imgdrv_read(iop_file_t *f, void *buf, int size); static int imgdrv_lseek(iop_file_t *f, int offset, int whence); @@ -41,14 +40,14 @@ typedef struct _iop_device_ops_short } iop_device_ops_short_t; static iop_device_ops_short_t imgdrv_ops = { - (void *)&imgdrv_dummy, // init - (void *)&imgdrv_dummy, // deinit - NULL, // format - (void *)&imgdrv_dummy, // open - (void *)&imgdrv_dummy, // close - &imgdrv_read, // read - NULL, // write - &imgdrv_lseek, // lseek + DUMMY_IMPLEMENTATION, // init + DUMMY_IMPLEMENTATION, // deinit + NOT_SUPPORTED, // format + NOT_SUPPORTED, // open + NOT_SUPPORTED, // close + &imgdrv_read, // read + NOT_SUPPORTED, // write + &imgdrv_lseek, // lseek }; #define MAX_IMAGES 2 @@ -69,11 +68,6 @@ int _start(int argc, char *argv[]) return (AddDrv(&img_device) < 0) ? MODULE_NO_RESIDENT_END : MODULE_RESIDENT_END; } -static int imgdrv_dummy(void) -{ - return 0; -} - static int imgdrv_read(iop_file_t *f, void *buf, int size) { int i; diff --git a/iop/arcade/accdvd/src/cddrv.c b/iop/arcade/accdvd/src/cddrv.c index e6dcea82424..88e849585b7 100644 --- a/iop/arcade/accdvd/src/cddrv.c +++ b/iop/arcade/accdvd/src/cddrv.c @@ -21,23 +21,23 @@ static int cddrv_ioctl(iop_file_t *io, int cmd, void *arg); static iop_device_ops_t Cddrv_ops = { - &cddrv_adddrv, - &cddrv_deldrv, - NOT_SUPPORTED, - &cddrv_open, - &cddrv_close, - &cddrv_read, - &cddrv_write, - &cddrv_lseek, - &cddrv_ioctl, - NOT_SUPPORTED, - NOT_SUPPORTED, - NOT_SUPPORTED, - NOT_SUPPORTED, - NOT_SUPPORTED, - NOT_SUPPORTED, - NOT_SUPPORTED, - NOT_SUPPORTED + &cddrv_adddrv, // init + &cddrv_deldrv, // deinit + NOT_SUPPORTED, // format + &cddrv_open, // open + &cddrv_close, // close + &cddrv_read, // read + &cddrv_write, // write + &cddrv_lseek, // lseek + &cddrv_ioctl, // ioctl + NOT_SUPPORTED, // remove + NOT_SUPPORTED, // mkdir + NOT_SUPPORTED, // rmdir + NOT_SUPPORTED, // dopen + NOT_SUPPORTED, // dclose + NOT_SUPPORTED, // dread + NOT_SUPPORTED, // getstat + NOT_SUPPORTED, // chstat }; static iop_device_t Cddrv = {"cdrom", 16u, 0u, "ATAPI_C/DVD-ROM", &Cddrv_ops}; diff --git a/iop/arcade/acuart/src/tty.c b/iop/arcade/acuart/src/tty.c index caa0de2df77..26aceb52150 100644 --- a/iop/arcade/acuart/src/tty.c +++ b/iop/arcade/acuart/src/tty.c @@ -5,8 +5,6 @@ int acUartWrite(void *buf, int count); int acUartRead(void *buf, int count); -int dummy() {return -ENOTSUP;} - static int acuart_read(iop_file_t *f, void *buffer, int size) { (void)f; return acUartRead(buffer, size); @@ -17,23 +15,23 @@ static int acuart_write(iop_file_t *f, void *buffer, int size) { } static iop_device_ops_t uart_ops = { - (void *)&dummy, - (void *)&dummy, - (void *)&dummy, - (void *)&dummy, - (void *)&dummy, - &acuart_read, - &acuart_write, - (void *)&dummy, - (void *)&dummy, - (void *)&dummy, - (void *)&dummy, - (void *)&dummy, - (void *)&dummy, - (void *)&dummy, - (void *)&dummy, - (void *)&dummy, - (void *)&dummy, + DUMMY_IMPLEMENTATION, // init + DUMMY_IMPLEMENTATION, // deinit + NOT_SUPPORTED, // format + NOT_SUPPORTED, // open + NOT_SUPPORTED, // close + &acuart_read, // read + &acuart_write, // write + NOT_SUPPORTED, // lseek + NOT_SUPPORTED, // ioctl + NOT_SUPPORTED, // remove + NOT_SUPPORTED, // mkdir + NOT_SUPPORTED, // rmdir + NOT_SUPPORTED, // dopen + NOT_SUPPORTED, // dclose + NOT_SUPPORTED, // dread + NOT_SUPPORTED, // getstat + NOT_SUPPORTED, // chstat }; #define DEVNAME "tty" diff --git a/iop/cdvd/cdfs/src/main.c b/iop/cdvd/cdfs/src/main.c index 3c436709a95..1483d100997 100755 --- a/iop/cdvd/cdfs/src/main.c +++ b/iop/cdvd/cdfs/src/main.c @@ -419,23 +419,23 @@ static int fio_getstat(iop_file_t *fd, const char *name, io_stat_t *stat) } static iop_device_ops_t fio_ops = { - &fio_init, - &fio_deinit, - NOT_SUPPORTED, - &fio_open, - &fio_close, - &fio_read, - &fio_write, - &fio_lseek, - NOT_SUPPORTED, - NOT_SUPPORTED, - NOT_SUPPORTED, - NOT_SUPPORTED, - &fio_openDir, - &fio_closeDir, - &fio_dread, - &fio_getstat, - NOT_SUPPORTED, + &fio_init, // init + &fio_deinit, // deinit + NOT_SUPPORTED, // format + &fio_open, // open + &fio_close, // close + &fio_read, // read + &fio_write, // write + &fio_lseek, // lseek + NOT_SUPPORTED, // ioctl + NOT_SUPPORTED, // remove + NOT_SUPPORTED, // mkdir + NOT_SUPPORTED, // rmdir + &fio_openDir, // dopen + &fio_closeDir, // dclose + &fio_dread, // dread + &fio_getstat, // getstat + NOT_SUPPORTED, // chstat }; static iop_device_t fio_driver = { diff --git a/iop/cdvd/xesdrv/src/xesdrv.c b/iop/cdvd/xesdrv/src/xesdrv.c index 52595019d7a..3e771c1702d 100644 --- a/iop/cdvd/xesdrv/src/xesdrv.c +++ b/iop/cdvd/xesdrv/src/xesdrv.c @@ -28,7 +28,6 @@ static int esdrv_df_devctl( iomanX_iop_file_t *f, const char *name, int cmd, void *arg, unsigned int arglen, void *buf, unsigned int buflen); static int esdrv_df_ioctl2(iomanX_iop_file_t *f, int cmd, void *arg, unsigned int arglen, void *buf, unsigned int buflen); -static s64 esdrv_df_null_long(); static int esioctl2_func_1(iomanX_iop_file_t *f, int cmd, void *arg, unsigned int arglen, void *buf, unsigned int buflen); static int @@ -220,33 +219,33 @@ struct DevctlCmdTbl_t }; static iomanX_iop_device_ops_t DvrFuncTbl = { - &esdrv_df_init, - &esdrv_df_exit, - NOT_SUPPORTED, - NOT_SUPPORTED, - NOT_SUPPORTED, - NOT_SUPPORTED, - NOT_SUPPORTED, - NOT_SUPPORTED, - &esdrv_df_ioctl, - NOT_SUPPORTED, - NOT_SUPPORTED, - NOT_SUPPORTED, - NOT_SUPPORTED, - NOT_SUPPORTED, - NOT_SUPPORTED, - NOT_SUPPORTED, - NOT_SUPPORTED, - NOT_SUPPORTED, - NOT_SUPPORTED, - NOT_SUPPORTED, - NOT_SUPPORTED, - NOT_SUPPORTED, - (void *)&esdrv_df_null_long, - &esdrv_df_devctl, - NOT_SUPPORTED, - NOT_SUPPORTED, - &esdrv_df_ioctl2, + &esdrv_df_init, // init + &esdrv_df_exit, // deinit + NOT_SUPPORTED, // format + NOT_SUPPORTED, // open + NOT_SUPPORTED, // close + NOT_SUPPORTED, // read + NOT_SUPPORTED, // write + NOT_SUPPORTED, // lseek + &esdrv_df_ioctl, // ioctl + NOT_SUPPORTED, // remove + NOT_SUPPORTED, // mkdir + NOT_SUPPORTED, // rmdir + NOT_SUPPORTED, // dopen + NOT_SUPPORTED, // dclose + NOT_SUPPORTED, // dread + NOT_SUPPORTED, // getstat + NOT_SUPPORTED, // chstat + NOT_SUPPORTED, // rename + NOT_SUPPORTED, // chdir + NOT_SUPPORTED, // sync + NOT_SUPPORTED, // mount + NOT_SUPPORTED, // umount + NOT_SUPPORTED_S64, // lseek64 + &esdrv_df_devctl, // devctl + NOT_SUPPORTED, // symlink + NOT_SUPPORTED, // readlink + &esdrv_df_ioctl2, // ioctl2 }; static iomanX_iop_device_t ESDRV = { .name = "es_drv", @@ -371,11 +370,6 @@ esdrv_df_ioctl2(iomanX_iop_file_t *f, int cmd, void *arg, unsigned int arglen, v return -EINVAL; } -static s64 esdrv_df_null_long() -{ - return -EUNSUP; -} - static void EsAcsSetAaryptorIoMode(void) { es_regs->r_es0C = 0; diff --git a/iop/debug/iop_sbusdbg/src/sbus_tty.c b/iop/debug/iop_sbusdbg/src/sbus_tty.c index df013939029..0544cecb815 100644 --- a/iop/debug/iop_sbusdbg/src/sbus_tty.c +++ b/iop/debug/iop_sbusdbg/src/sbus_tty.c @@ -94,23 +94,23 @@ static int ttyfs_write(iop_file_t *file, void *ptr, int size) { static iop_device_ops_t fsd_ops = { - &ttyfs_init, - &ttyfs_deinit, - NOT_SUPPORTED, - &ttyfs_open, - &ttyfs_close, - NOT_SUPPORTED, - &ttyfs_write, - NOT_SUPPORTED, - NOT_SUPPORTED, - NOT_SUPPORTED, - NOT_SUPPORTED, - NOT_SUPPORTED, - &ttyfs_dopen, - &ttyfs_close, - NOT_SUPPORTED, - NOT_SUPPORTED, - NOT_SUPPORTED, + &ttyfs_init, // init + &ttyfs_deinit, // deinit + NOT_SUPPORTED, // format + &ttyfs_open, // open + &ttyfs_close, // close + NOT_SUPPORTED, // read + &ttyfs_write, // write + NOT_SUPPORTED, // lseek + NOT_SUPPORTED, // ioctl + NOT_SUPPORTED, // remove + NOT_SUPPORTED, // mkdir + NOT_SUPPORTED, // rmdir + &ttyfs_dopen, // dopen + &ttyfs_close, // dclose + NOT_SUPPORTED, // dread + NOT_SUPPORTED, // getstat + NOT_SUPPORTED, // chstat }; static iop_device_t tty_fsd = diff --git a/iop/debug/ppctty/src/tty.c b/iop/debug/ppctty/src/tty.c index eeab37bc915..b68ac0a1b57 100644 --- a/iop/debug/ppctty/src/tty.c +++ b/iop/debug/ppctty/src/tty.c @@ -44,33 +44,6 @@ static int ttyfs_deinit() return 0; } -static int ttyfs_open(iop_file_t *file, const char *name, int flags) -{ - (void)file; - (void)name; - (void)flags; - - DPRINTF("FS Open()\n"); - return 0; -} - -static int ttyfs_dopen(iop_file_t *file, const char *name) -{ - (void)file; - (void)name; - - DPRINTF("FS Dopen()\n"); - return 0; -} - -static int ttyfs_close(iop_file_t *file) -{ - (void)file; - - DPRINTF("FS Close()\n"); - return(0); -} - static int ttyfs_write(iop_file_t *file, void *ptr, int size) { char temp[65]; int bCount = 0; @@ -101,23 +74,23 @@ static int ttyfs_write(iop_file_t *file, void *ptr, int size) { static iop_device_ops_t fsd_ops = { - &ttyfs_init, - &ttyfs_deinit, - NOT_SUPPORTED, - &ttyfs_open, - &ttyfs_close, - NOT_SUPPORTED, - &ttyfs_write, - NOT_SUPPORTED, - NOT_SUPPORTED, - NOT_SUPPORTED, - NOT_SUPPORTED, - NOT_SUPPORTED, - &ttyfs_dopen, - &ttyfs_close, - NOT_SUPPORTED, - NOT_SUPPORTED, - NOT_SUPPORTED, + &ttyfs_init, // init + &ttyfs_deinit, // deinit + NOT_SUPPORTED, // format + NOT_SUPPORTED, // open + NOT_SUPPORTED, // close + NOT_SUPPORTED, // read + &ttyfs_write, // write + NOT_SUPPORTED, // lseek + NOT_SUPPORTED, // ioctl + NOT_SUPPORTED, // remove + NOT_SUPPORTED, // mkdir + NOT_SUPPORTED, // rmdir + NOT_SUPPORTED, // dopen + NOT_SUPPORTED, // dclose + NOT_SUPPORTED, // dread + NOT_SUPPORTED, // getstat + NOT_SUPPORTED, // chstat }; static iop_device_t tty_fsd = diff --git a/iop/dev9/dev9/src/ps2dev9.c b/iop/dev9/dev9/src/ps2dev9.c index 816e752c14e..bcd6177ce39 100644 --- a/iop/dev9/dev9/src/ps2dev9.c +++ b/iop/dev9/dev9/src/ps2dev9.c @@ -122,11 +122,6 @@ static int expbay_init(int sema_attr); extern struct irx_export_table _exp_dev9; -static int dev9x_dummy(void) -{ - return 0; -} - static int dev9x_devctl(iop_file_t *f, const char *name, int cmd, void *args, unsigned int arglen, void *buf, unsigned int buflen) { (void)f; @@ -153,33 +148,33 @@ static int dev9x_devctl(iop_file_t *f, const char *name, int cmd, void *args, un static iop_device_ops_t dev9x_ops = { - (void *)&dev9x_dummy, - (void *)&dev9x_dummy, - (void *)&dev9x_dummy, - (void *)&dev9x_dummy, - (void *)&dev9x_dummy, - (void *)&dev9x_dummy, - (void *)&dev9x_dummy, - (void *)&dev9x_dummy, - (void *)&dev9x_dummy, - (void *)&dev9x_dummy, - (void *)&dev9x_dummy, - (void *)&dev9x_dummy, - (void *)&dev9x_dummy, - (void *)&dev9x_dummy, - (void *)&dev9x_dummy, - (void *)&dev9x_dummy, - (void *)&dev9x_dummy, - (void *)&dev9x_dummy, - (void *)&dev9x_dummy, - (void *)&dev9x_dummy, - (void *)&dev9x_dummy, - (void *)&dev9x_dummy, - (void *)&dev9x_dummy, - &dev9x_devctl, - (void *)&dev9x_dummy, - (void *)&dev9x_dummy, - (void *)&dev9x_dummy, + DUMMY_IMPLEMENTATION, // init + DUMMY_IMPLEMENTATION, // deinit + NOT_SUPPORTED, // format + NOT_SUPPORTED, // open + NOT_SUPPORTED, // close + NOT_SUPPORTED, // read + NOT_SUPPORTED, // write + NOT_SUPPORTED, // lseek + NOT_SUPPORTED, // ioctl + NOT_SUPPORTED, // remove + NOT_SUPPORTED, // mkdir + NOT_SUPPORTED, // rmdir + NOT_SUPPORTED, // dopen + NOT_SUPPORTED, // dclose + NOT_SUPPORTED, // dread + NOT_SUPPORTED, // getstat + NOT_SUPPORTED, // chstat + NOT_SUPPORTED, // rename + NOT_SUPPORTED, // chdir + NOT_SUPPORTED, // sync + NOT_SUPPORTED, // mount + NOT_SUPPORTED, // umount + NOT_SUPPORTED_S64, // lseek64 + &dev9x_devctl, // devctl + NOT_SUPPORTED, // symlink + NOT_SUPPORTED, // readlink + NOT_SUPPORTED, // ioctl2 }; static iop_device_t dev9x_device = diff --git a/iop/dvrp/dvr/src/dvr.c b/iop/dvrp/dvr/src/dvr.c index 0885b361442..5278a8167b9 100644 --- a/iop/dvrp/dvr/src/dvr.c +++ b/iop/dvrp/dvr/src/dvr.c @@ -33,7 +33,6 @@ extern int dvr_df_exit(iomanX_iop_device_t *dev); extern int dvr_df_ioctl(iomanX_iop_file_t *f, int cmd, void *param); extern int dvr_df_devctl(iomanX_iop_file_t *a1, const char *name, int cmd, void *arg, unsigned int arglen, void *buf, unsigned int buflen); extern int dvr_df_ioctl2(iomanX_iop_file_t *f, int cmd, void *arg, unsigned int arglen, void *buf, unsigned int buflen); -extern s64 dvr_df_null_long(); extern int dvrioctl2_rec_start(iomanX_iop_file_t *a1, const char *name, int cmd, void *arg, unsigned int arglen, void *buf, unsigned int buflen); extern int dvrioctl2_rec_pause(iomanX_iop_file_t *a1, const char *name, int cmd, void *arg, unsigned int arglen, void *buf, unsigned int buflen); extern int dvrioctl2_rec_stop(iomanX_iop_file_t *a1, const char *name, int cmd, void *arg, unsigned int arglen, void *buf, unsigned int buflen); @@ -111,33 +110,33 @@ struct DevctlCmdTbl_t static iomanX_iop_device_ops_t DvrFuncTbl = { - &dvr_df_init, - &dvr_df_exit, - NOT_SUPPORTED, - NOT_SUPPORTED, - NOT_SUPPORTED, - NOT_SUPPORTED, - NOT_SUPPORTED, - NOT_SUPPORTED, - &dvr_df_ioctl, - NOT_SUPPORTED, - NOT_SUPPORTED, - NOT_SUPPORTED, - NOT_SUPPORTED, - NOT_SUPPORTED, - NOT_SUPPORTED, - NOT_SUPPORTED, - NOT_SUPPORTED, - NOT_SUPPORTED, - NOT_SUPPORTED, - NOT_SUPPORTED, - NOT_SUPPORTED, - NOT_SUPPORTED, - (void *)&dvr_df_null_long, - &dvr_df_devctl, - NOT_SUPPORTED, - NOT_SUPPORTED, - &dvr_df_ioctl2, + &dvr_df_init, // init + &dvr_df_exit, // deinit + NOT_SUPPORTED, // format + NOT_SUPPORTED, // open + NOT_SUPPORTED, // close + NOT_SUPPORTED, // read + NOT_SUPPORTED, // write + NOT_SUPPORTED, // lseek + &dvr_df_ioctl, // ioctl + NOT_SUPPORTED, // remove + NOT_SUPPORTED, // mkdir + NOT_SUPPORTED, // rmdir + NOT_SUPPORTED, // dopen + NOT_SUPPORTED, // dclose + NOT_SUPPORTED, // dread + NOT_SUPPORTED, // getstat + NOT_SUPPORTED, // chstat + NOT_SUPPORTED, // rename + NOT_SUPPORTED, // chdir + NOT_SUPPORTED, // sync + NOT_SUPPORTED, // mount + NOT_SUPPORTED, // umount + NOT_SUPPORTED_S64, // lseek64 + &dvr_df_devctl, // devctl + NOT_SUPPORTED, // symlink + NOT_SUPPORTED, // readlink + &dvr_df_ioctl2, // ioctl2 }; char TEVENT_BUF[6144]; char *tevent_p; @@ -285,11 +284,6 @@ int dvr_df_ioctl2(iomanX_iop_file_t *f, int cmd, void *arg, unsigned int arglen, return -EINVAL; } -s64 dvr_df_null_long() -{ - return -134LL; -} - int dvrioctl2_rec_start( iomanX_iop_file_t *a1, const char *name, diff --git a/iop/dvrp/dvrav/src/dvrav.c b/iop/dvrp/dvrav/src/dvrav.c index e0eb7b58ffe..975db219acb 100644 --- a/iop/dvrp/dvrav/src/dvrav.c +++ b/iop/dvrp/dvrav/src/dvrav.c @@ -32,7 +32,6 @@ extern int dvrav_df_exit(iomanX_iop_device_t *dev); extern int dvrav_df_ioctl(iomanX_iop_file_t *f, int cmd, void *param); extern int dvrav_df_devctl(iomanX_iop_file_t *a1, const char *name, int cmd, void *arg, unsigned int arglen, void *buf, unsigned int buflen); extern int dvrav_df_ioctl2(iomanX_iop_file_t *f, int cmd, void *arg, unsigned int arglen, void *buf, unsigned int buflen); -extern s64 dvrav_df_null_long(); extern int avioctl2_select_position(iomanX_iop_file_t *a1, int cmd, void *arg, unsigned int arglen, void *buf, unsigned int buflen); extern int avioctl2_get_position(iomanX_iop_file_t *a1, int cmd, void *arg, unsigned int arglen, void *buf, unsigned int buflen); extern int avioctl2_position_up(iomanX_iop_file_t *a1, int cmd, void *arg, unsigned int arglen, void *buf, unsigned int buflen); @@ -110,33 +109,33 @@ struct DevctlCmdTbl_t static iomanX_iop_device_ops_t DvrFuncTbl = { - &dvrav_df_init, - &dvrav_df_exit, - NOT_SUPPORTED, - NOT_SUPPORTED, - NOT_SUPPORTED, - NOT_SUPPORTED, - NOT_SUPPORTED, - NOT_SUPPORTED, - &dvrav_df_ioctl, - NOT_SUPPORTED, - NOT_SUPPORTED, - NOT_SUPPORTED, - NOT_SUPPORTED, - NOT_SUPPORTED, - NOT_SUPPORTED, - NOT_SUPPORTED, - NOT_SUPPORTED, - NOT_SUPPORTED, - NOT_SUPPORTED, - NOT_SUPPORTED, - NOT_SUPPORTED, - NOT_SUPPORTED, - (void *)&dvrav_df_null_long, - &dvrav_df_devctl, - NOT_SUPPORTED, - NOT_SUPPORTED, - &dvrav_df_ioctl2, + &dvrav_df_init, // init + &dvrav_df_exit, // deinit + NOT_SUPPORTED, // format + NOT_SUPPORTED, // open + NOT_SUPPORTED, // close + NOT_SUPPORTED, // read + NOT_SUPPORTED, // write + NOT_SUPPORTED, // lseek + &dvrav_df_ioctl, // ioctl + NOT_SUPPORTED, // remove + NOT_SUPPORTED, // mkdir + NOT_SUPPORTED, // rmdir + NOT_SUPPORTED, // dopen + NOT_SUPPORTED, // dclose + NOT_SUPPORTED, // dread + NOT_SUPPORTED, // getstat + NOT_SUPPORTED, // chstat + NOT_SUPPORTED, // rename + NOT_SUPPORTED, // chdir + NOT_SUPPORTED, // sync + NOT_SUPPORTED, // mount + NOT_SUPPORTED, // umount + NOT_SUPPORTED_S64, // lseek64 + &dvrav_df_devctl, // devctl + NOT_SUPPORTED, // symlink + NOT_SUPPORTED, // readlink + &dvrav_df_ioctl2, // ioctl2 }; static iomanX_iop_device_t DVRAV = { .name = "dvr_av", @@ -283,11 +282,6 @@ int dvrav_df_ioctl2(iomanX_iop_file_t *f, int cmd, void *arg, unsigned int argle return -EINVAL; } -s64 dvrav_df_null_long() -{ - return -134LL; -} - int avioctl2_get_tun_offset( iomanX_iop_file_t *a1, int cmd, diff --git a/iop/dvrp/dvrdv/src/dvrdv.c b/iop/dvrp/dvrdv/src/dvrdv.c index 8e179d8ea4a..0ee6b5d63c4 100644 --- a/iop/dvrp/dvrdv/src/dvrdv.c +++ b/iop/dvrp/dvrdv/src/dvrdv.c @@ -32,7 +32,6 @@ extern int dvrdv_df_exit(iomanX_iop_device_t *dev); extern int dvrdv_df_ioctl(iomanX_iop_file_t *f, int cmd, void *param); extern int dvrdv_df_devctl(iomanX_iop_file_t *a1, const char *name, int cmd, void *arg, unsigned int arglen, void *buf, unsigned int buflen); extern int dvrdv_df_ioctl2(iomanX_iop_file_t *f, int cmd, void *arg, unsigned int arglen, void *buf, unsigned int buflen); -extern s64 dvrdv_df_null_long(); extern int dvrioctl2_dv_dubb_start(iomanX_iop_file_t *a1, const char *name, int cmd, void *arg, unsigned int arglen, void *buf, unsigned int buflen); extern int dvrioctl2_dv_dubb_stop(iomanX_iop_file_t *a1, const char *name, int cmd, void *arg, unsigned int arglen, void *buf, unsigned int buflen); extern int dvrioctl2_dv_dubb_rec_start(iomanX_iop_file_t *a1, const char *name, int cmd, void *arg, unsigned int arglen, void *buf, unsigned int buflen); @@ -56,33 +55,33 @@ struct DevctlCmdTbl_t static iomanX_iop_device_ops_t DvrFuncTbl = { - &dvrdv_df_init, - &dvrdv_df_exit, - NOT_SUPPORTED, - NOT_SUPPORTED, - NOT_SUPPORTED, - NOT_SUPPORTED, - NOT_SUPPORTED, - NOT_SUPPORTED, - &dvrdv_df_ioctl, - NOT_SUPPORTED, - NOT_SUPPORTED, - NOT_SUPPORTED, - NOT_SUPPORTED, - NOT_SUPPORTED, - NOT_SUPPORTED, - NOT_SUPPORTED, - NOT_SUPPORTED, - NOT_SUPPORTED, - NOT_SUPPORTED, - NOT_SUPPORTED, - NOT_SUPPORTED, - NOT_SUPPORTED, - (void *)&dvrdv_df_null_long, - &dvrdv_df_devctl, - NOT_SUPPORTED, - NOT_SUPPORTED, - &dvrdv_df_ioctl2, + &dvrdv_df_init, // init + &dvrdv_df_exit, // deinit + NOT_SUPPORTED, // format + NOT_SUPPORTED, // open + NOT_SUPPORTED, // close + NOT_SUPPORTED, // read + NOT_SUPPORTED, // write + NOT_SUPPORTED, // lseek + &dvrdv_df_ioctl, // ioctl + NOT_SUPPORTED, // remove + NOT_SUPPORTED, // mkdir + NOT_SUPPORTED, // rmdir + NOT_SUPPORTED, // dopen + NOT_SUPPORTED, // dclose + NOT_SUPPORTED, // dread + NOT_SUPPORTED, // getstat + NOT_SUPPORTED, // chstat + NOT_SUPPORTED, // rename + NOT_SUPPORTED, // chdir + NOT_SUPPORTED, // sync + NOT_SUPPORTED, // mount + NOT_SUPPORTED, // umount + NOT_SUPPORTED_S64, // lseek64 + &dvrdv_df_devctl, // devctl + NOT_SUPPORTED, // symlink + NOT_SUPPORTED, // readlink + &dvrdv_df_ioctl2, // ioctl2 }; static iomanX_iop_device_t DVR = { .name = "dvr_dv", @@ -233,11 +232,6 @@ int dvrdv_df_ioctl2( return -EINVAL; } -s64 dvrdv_df_null_long() -{ - return -134LL; -} - int dvrioctl2_dv_dubb_start( iomanX_iop_file_t *a1, const char *name, diff --git a/iop/dvrp/dvrfile/src/dvrfile.c b/iop/dvrp/dvrfile/src/dvrfile.c index 4df11045c78..3ceeddfba36 100644 --- a/iop/dvrp/dvrfile/src/dvrfile.c +++ b/iop/dvrp/dvrfile/src/dvrfile.c @@ -203,33 +203,33 @@ static int dvrf_translator_df_umount(iomanX_iop_file_t *f, const char *fsname) } static iomanX_iop_device_ops_t dvrf_translator_functbl = { - dvrf_df_init, - dvrf_df_exit, - dvrf_translator_df_format, - dvrf_translator_df_open, - dvrf_df_close, - dvrf_df_read, - dvrf_df_write, - dvrf_df_lseek, - dvrf_df_ioctl, - dvrf_translator_df_remove, - dvrf_translator_df_mkdir, - dvrf_translator_df_rmdir, - dvrf_translator_df_dopen, - dvrf_df_dclose, - dvrf_df_dread, - dvrf_translator_df_getstat, - dvrf_translator_df_chstat, - dvrf_translator_df_rename, - dvrf_translator_df_chdir, - dvrf_translator_df_sync, - dvrf_translator_df_mount, - dvrf_translator_df_umount, - dvrf_df_lseek64, - dvrf_translator_df_devctl, - dvrf_translator_df_symlink, - dvrf_translator_df_readlink, - dvrf_df_ioctl2, + dvrf_df_init, // init + dvrf_df_exit, // deinit + dvrf_translator_df_format, // format + dvrf_translator_df_open, // open + dvrf_df_close, // close + dvrf_df_read, // read + dvrf_df_write, // write + dvrf_df_lseek, // lseek + dvrf_df_ioctl, // ioctl + dvrf_translator_df_remove, // remove + dvrf_translator_df_mkdir, // mkdir + dvrf_translator_df_rmdir, // rmdir + dvrf_translator_df_dopen, // dopen + dvrf_df_dclose, // dclose + dvrf_df_dread, // dread + dvrf_translator_df_getstat, // getstat + dvrf_translator_df_chstat, // chstat + dvrf_translator_df_rename, // rename + dvrf_translator_df_chdir, // chdir + dvrf_translator_df_sync, // sync + dvrf_translator_df_mount, // mount + dvrf_translator_df_umount, // umount + dvrf_df_lseek64, // lseek64 + dvrf_translator_df_devctl, // devctl + dvrf_translator_df_symlink, // symlink + dvrf_translator_df_readlink, // readlink + dvrf_df_ioctl2, // ioctl2 }; #define GEN_TRANSLATION_FUNCS(basefuncname, basedevname, shouldbswapformatarg, drvname) \ diff --git a/iop/dvrp/dvripl/src/dvripl.c b/iop/dvrp/dvripl/src/dvripl.c index 0a518f0d967..b8d612f4b1f 100644 --- a/iop/dvrp/dvripl/src/dvripl.c +++ b/iop/dvrp/dvripl/src/dvripl.c @@ -34,39 +34,38 @@ extern int dvripl_df_exit(iomanX_iop_device_t *dev); extern int dvripl_df_ioctl(iomanX_iop_file_t *f, int cmd, void *param); extern int dvripl_df_devctl(iomanX_iop_file_t *a1, const char *name, int cmd, void *arg, unsigned int arglen, void *buf, unsigned int buflen); extern int dvripl_df_ioctl2(iomanX_iop_file_t *f, int cmd, void *arg, unsigned int arglen, void *buf, unsigned int buflen); -extern s64 dvripl_df_null_long(); extern int iplioctl2_update(iomanX_iop_file_t *a1, int cmd, void *arg); extern void dvr_ready(int a1, void *a2); static iomanX_iop_device_ops_t DvrFuncTbl = { - &dvripl_df_init, - &dvripl_df_exit, - NOT_SUPPORTED, - NOT_SUPPORTED, - NOT_SUPPORTED, - NOT_SUPPORTED, - NOT_SUPPORTED, - NOT_SUPPORTED, - &dvripl_df_ioctl, - NOT_SUPPORTED, - NOT_SUPPORTED, - NOT_SUPPORTED, - NOT_SUPPORTED, - NOT_SUPPORTED, - NOT_SUPPORTED, - NOT_SUPPORTED, - NOT_SUPPORTED, - NOT_SUPPORTED, - NOT_SUPPORTED, - NOT_SUPPORTED, - NOT_SUPPORTED, - NOT_SUPPORTED, - &dvripl_df_null_long, - &dvripl_df_devctl, - NOT_SUPPORTED, - NOT_SUPPORTED, - &dvripl_df_ioctl2, + &dvripl_df_init, // init + &dvripl_df_exit, // deinit + NOT_SUPPORTED, // format + NOT_SUPPORTED, // open + NOT_SUPPORTED, // close + NOT_SUPPORTED, // read + NOT_SUPPORTED, // write + NOT_SUPPORTED, // lseek + &dvripl_df_ioctl, // ioctl + NOT_SUPPORTED, // remove + NOT_SUPPORTED, // mkdir + NOT_SUPPORTED, // rmdir + NOT_SUPPORTED, // dopen + NOT_SUPPORTED, // dclose + NOT_SUPPORTED, // dread + NOT_SUPPORTED, // getstat + NOT_SUPPORTED, // chstat + NOT_SUPPORTED, // rename + NOT_SUPPORTED, // chdir + NOT_SUPPORTED, // sync + NOT_SUPPORTED, // mount + NOT_SUPPORTED, // umount + NOT_SUPPORTED_S64, // lseek64 + &dvripl_df_devctl, // devctl + NOT_SUPPORTED, // symlink + NOT_SUPPORTED, // readlink + &dvripl_df_ioctl2, // ioctl2 }; s32 dvr_ready_flag; static iomanX_iop_device_t DVRMAN = { @@ -199,11 +198,6 @@ int dvripl_df_ioctl2(iomanX_iop_file_t *f, int cmd, void *arg, unsigned int argl return -EINVAL; } -s64 dvripl_df_null_long() -{ - return -134LL; -} - int iplioctl2_update(iomanX_iop_file_t *a1, int cmd, void *arg) { int total_size; diff --git a/iop/dvrp/dvrmisc/src/dvrmisc.c b/iop/dvrp/dvrmisc/src/dvrmisc.c index b0d2cfd4625..e6df45c966b 100644 --- a/iop/dvrp/dvrmisc/src/dvrmisc.c +++ b/iop/dvrp/dvrmisc/src/dvrmisc.c @@ -33,7 +33,6 @@ extern int dvrmisc_df_exit(iomanX_iop_device_t *dev); extern int dvrmisc_df_ioctl(iomanX_iop_file_t *f, int cmd, void *param); extern int dvrmisc_df_devctl(iomanX_iop_file_t *a1, const char *name, int cmd, void *arg, unsigned int arglen, void *buf, unsigned int buflen); extern int dvrmisc_df_ioctl2(iomanX_iop_file_t *f, int cmd, void *arg, unsigned int arglen, void *buf, unsigned int buflen); -extern s64 dvrmisc_df_null_long(); extern int dvrioctl2_nop(iomanX_iop_file_t *a1, int cmd, void *arg, unsigned int arglen, void *buf, unsigned int buflen); extern int dvrioctl2_version(iomanX_iop_file_t *a1, int cmd, void *arg, unsigned int arglen, void *buf, unsigned int buflen); extern int dvrioctl2_led_hdd_rec(iomanX_iop_file_t *a1, int cmd, void *arg, unsigned int arglen, void *buf, unsigned int buflen); @@ -95,33 +94,33 @@ struct DevctlCmdTbl_t static iomanX_iop_device_ops_t DvrFuncTbl = { - &dvrmisc_df_init, - &dvrmisc_df_exit, - NOT_SUPPORTED, - NOT_SUPPORTED, - NOT_SUPPORTED, - NOT_SUPPORTED, - NOT_SUPPORTED, - NOT_SUPPORTED, - &dvrmisc_df_ioctl, - NOT_SUPPORTED, - NOT_SUPPORTED, - NOT_SUPPORTED, - NOT_SUPPORTED, - NOT_SUPPORTED, - NOT_SUPPORTED, - NOT_SUPPORTED, - NOT_SUPPORTED, - NOT_SUPPORTED, - NOT_SUPPORTED, - NOT_SUPPORTED, - NOT_SUPPORTED, - NOT_SUPPORTED, - &dvrmisc_df_null_long, - &dvrmisc_df_devctl, - NOT_SUPPORTED, - NOT_SUPPORTED, - &dvrmisc_df_ioctl2, + &dvrmisc_df_init, // init + &dvrmisc_df_exit, // deinit + NOT_SUPPORTED, // format + NOT_SUPPORTED, // open + NOT_SUPPORTED, // close + NOT_SUPPORTED, // read + NOT_SUPPORTED, // write + NOT_SUPPORTED, // lseek + &dvrmisc_df_ioctl, // ioctl + NOT_SUPPORTED, // remove + NOT_SUPPORTED, // mkdir + NOT_SUPPORTED, // rmdir + NOT_SUPPORTED, // dopen + NOT_SUPPORTED, // dclose + NOT_SUPPORTED, // dread + NOT_SUPPORTED, // getstat + NOT_SUPPORTED, // chstat + NOT_SUPPORTED, // rename + NOT_SUPPORTED, // chdir + NOT_SUPPORTED, // sync + NOT_SUPPORTED, // mount + NOT_SUPPORTED, // umount + NOT_SUPPORTED_S64, // lseek64 + &dvrmisc_df_devctl, // devctl + NOT_SUPPORTED, // symlink + NOT_SUPPORTED, // readlink + &dvrmisc_df_ioctl2, // ioctl2 }; static iomanX_iop_device_t DVRMISC = { .name = "dvr_misc", @@ -276,11 +275,6 @@ int dvrmisc_df_ioctl2( return -EINVAL; } -s64 dvrmisc_df_null_long() -{ - return -134LL; -} - int dvrioctl2_nop(iomanX_iop_file_t *a1, int cmd, void *arg, unsigned int arglen, void *buf, unsigned int buflen) { drvdrv_exec_cmd_ack cmdack; diff --git a/iop/fs/bdmfs_fatfs/src/fs_driver.c b/iop/fs/bdmfs_fatfs/src/fs_driver.c index 5a9ed9b0517..687d0ebaa0a 100644 --- a/iop/fs/bdmfs_fatfs/src/fs_driver.c +++ b/iop/fs/bdmfs_fatfs/src/fs_driver.c @@ -260,16 +260,6 @@ static DIR *fs_find_free_dir_structure(void) return NULL; } -//--------------------------------------------------------------------------- -static int fs_init(iop_device_t *driver) -{ - M_DEBUG("%s\n", __func__); - - (void)driver; - - return 1; -} - //--------------------------------------------------------------------------- static int fs_open(iop_file_t *fd, const char *name, int flags, int mode) { @@ -792,33 +782,33 @@ static int fs_devctl(iop_file_t *fd, const char *name, int cmd, void *arg, unsig } static iop_device_ops_t fs_functarray = { - &fs_init, - NOT_SUPPORTED, - NOT_SUPPORTED, - &fs_open, - &fs_close, - &fs_read, - &fs_write, - &fs_lseek, - &fs_ioctl, - &fs_remove, - &fs_mkdir, - &fs_remove, - &fs_dopen, - &fs_dclose, - &fs_dread, - &fs_getstat, - NOT_SUPPORTED, - &fs_rename, - NOT_SUPPORTED, - NOT_SUPPORTED, - NOT_SUPPORTED, - NOT_SUPPORTED, - &fs_lseek64, - &fs_devctl, - NOT_SUPPORTED, - NOT_SUPPORTED, - &fs_ioctl2, + DUMMY_IMPLEMENTATION, // init + DUMMY_IMPLEMENTATION, // deinit + NOT_SUPPORTED, // format + &fs_open, // open + &fs_close, // close + &fs_read, // read + &fs_write, // write + &fs_lseek, // lseek + &fs_ioctl, // ioctl + &fs_remove, // remove + &fs_mkdir, // mkdir + &fs_remove, // rmdir + &fs_dopen, // dopen + &fs_dclose, // dclose + &fs_dread, // dread + &fs_getstat, // getstat + NOT_SUPPORTED, // chstat + &fs_rename, // rename + NOT_SUPPORTED, // chdir + NOT_SUPPORTED, // sync + NOT_SUPPORTED, // mount + NOT_SUPPORTED, // umount + &fs_lseek64, // lseek64 + &fs_devctl, // devctl + NOT_SUPPORTED, // symlink + NOT_SUPPORTED, // readlink + &fs_ioctl2, // ioctl2 }; static iop_device_t fs_driver = { "mass", diff --git a/iop/fs/devfs/src/devfs.c b/iop/fs/devfs/src/devfs.c index eff67ab0cc7..c7874e41c0a 100644 --- a/iop/fs/devfs/src/devfs.c +++ b/iop/fs/devfs/src/devfs.c @@ -325,26 +325,6 @@ devfs_device_t *devfs_find_deviceid(HDEV hDev) return NULL; } -/** ioman init handler - * @returns Always returns 0 - */ -int devfs_init(iop_device_t *dev) - -{ - printf("devfs_init dev=%p\n", dev); - return 0; -} - -/** ioman deinit handler - * @returns Always returns 0 - */ -int devfs_deinit(iop_device_t *dev) - -{ - printf("devfs_deinit dev=%p\n", dev); - return 0; -} - /** ioman open handler * @oaram file: Pointer to the ioman file structure * @param name: Name of file to open @@ -1000,33 +980,33 @@ int devfs_getstat(iop_file_t *file, const char *name, iox_stat_t *stat) } static iop_device_ops_t devfs_ops = { - &devfs_init, - &devfs_deinit, - NOT_SUPPORTED, - &devfs_open, - &devfs_close, - &devfs_read, - NOT_SUPPORTED, - NOT_SUPPORTED, - &devfs_ioctl, - NOT_SUPPORTED, - NOT_SUPPORTED, - NOT_SUPPORTED, - &devfs_dopen, - &devfs_dclose, - &devfs_dread, - &devfs_getstat, - NOT_SUPPORTED, - NOT_SUPPORTED, - NOT_SUPPORTED, - NOT_SUPPORTED, - NOT_SUPPORTED, - NOT_SUPPORTED, - NOT_SUPPORTED, - NOT_SUPPORTED, - NOT_SUPPORTED, - NOT_SUPPORTED, - &devfs_ioctl2, + DUMMY_IMPLEMENTATION, // init + DUMMY_IMPLEMENTATION, // deinit + NOT_SUPPORTED, // format + &devfs_open, // open + &devfs_close, // close + &devfs_read, // read + NOT_SUPPORTED, // write + NOT_SUPPORTED, // lseek + &devfs_ioctl, // ioctl + NOT_SUPPORTED, // remove + NOT_SUPPORTED, // mkdir + NOT_SUPPORTED, // rmdir + &devfs_dopen, // dopen + &devfs_dclose, // dclose + &devfs_dread, // dread + &devfs_getstat, // getstat + NOT_SUPPORTED, // chstat + NOT_SUPPORTED, // rename + NOT_SUPPORTED, // chdir + NOT_SUPPORTED, // sync + NOT_SUPPORTED, // mount + NOT_SUPPORTED, // umount + NOT_SUPPORTED_S64, // lseek64 + NOT_SUPPORTED, // devctl + NOT_SUPPORTED, // symlink + NOT_SUPPORTED, // readlink + &devfs_ioctl2, // ioctl2 }; static iop_device_t devfs_device = { diff --git a/iop/fs/eromdrv/src/eromdrv.c b/iop/fs/eromdrv/src/eromdrv.c index aadf310f0ff..69578066ef0 100644 --- a/iop/fs/eromdrv/src/eromdrv.c +++ b/iop/fs/eromdrv/src/eromdrv.c @@ -42,9 +42,7 @@ typedef struct erom_fdpriv_ u32 m_xordata_size; } erom_fdpriv_t; -static int erom_nulldev(void); static int erom_op_close(iop_file_t *f); -static int erom_op_write(iop_file_t *f, void *ptr, int size); static int erom_op_lseek(iop_file_t *f, int pos, int mode); static int erom_op_open(iop_file_t *f, const char *name, int mode); static int erom_op_read(iop_file_t *f, void *ptr, int size); @@ -54,23 +52,23 @@ static erom_info_t *get_erom_info(const u32 *erom_start, const u32 *erom_end, er static const erom_dentry_t *get_direntry_by_name(erom_info_t *info, const char *name); static iop_device_ops_t erom_devops = { - (void *)erom_nulldev, - (void *)erom_nulldev, - (void *)erom_nulldev, - erom_op_open, - erom_op_close, - erom_op_read, - erom_op_write, - erom_op_lseek, - (void *)erom_nulldev, - (void *)erom_nulldev, - (void *)erom_nulldev, - (void *)erom_nulldev, - (void *)erom_nulldev, - (void *)erom_nulldev, - (void *)erom_nulldev, - (void *)erom_nulldev, - (void *)erom_nulldev, + DUMMY_IMPLEMENTATION, // init + DUMMY_IMPLEMENTATION, // deinit + NOT_SUPPORTED, // format + erom_op_open, // open + erom_op_close, // close + erom_op_read, // read + NOT_SUPPORTED, // write + erom_op_lseek, // lseek + NOT_SUPPORTED, // ioctl + NOT_SUPPORTED, // remove + NOT_SUPPORTED, // mkdir + NOT_SUPPORTED, // rmdir + NOT_SUPPORTED, // dopen + NOT_SUPPORTED, // dclose + NOT_SUPPORTED, // dread + NOT_SUPPORTED, // getstat + NOT_SUPPORTED, // chstat }; static iop_device_t erom_dev = { @@ -85,11 +83,6 @@ static erom_fdpriv_t erom_fdpriv; static erom_info_t erom_info; static const erom_dentry_t *erom_dentry; -static int erom_nulldev(void) -{ - return 0; -} - static int erom_op_close(iop_file_t *f) { (void)f; @@ -99,15 +92,6 @@ static int erom_op_close(iop_file_t *f) return 0; } -static int erom_op_write(iop_file_t *f, void *ptr, int size) -{ - (void)f; - (void)ptr; - (void)size; - - return -EIO; -} - static int erom_op_lseek(iop_file_t *f, int pos, int mode) { erom_fdpriv_t *privdata; diff --git a/iop/fs/fakehost/src/fakehost.c b/iop/fs/fakehost/src/fakehost.c index 36d622437b5..ce122570b89 100644 --- a/iop/fs/fakehost/src/fakehost.c +++ b/iop/fs/fakehost/src/fakehost.c @@ -104,27 +104,6 @@ int realfd( iop_io_file_t *f ) return (int) f->privdata; } -/** Dummy function, for where needed. - * @ingroup fakehost - */ -int dummy() -{ - M_DEBUG("dummy function called\n"); - return -EIO; -} - -/** Initialise fs driver. - * @ingroup fakehost - * - * @param driver io_device pointer to device - * @return Status (0=successful). - */ -int fd_initialize( iop_io_device_t *driver) -{ - M_PRINTF( "initializing '%s' file driver.\n", driver->name ); - return 0; -} - /** Handle open request. * @ingroup fakehost * @@ -197,23 +176,23 @@ int fd_lseek( iop_io_file_t *fd, int offset, int whence) // Function array for fileio structure. static iop_io_device_ops_t functions = { - &fd_initialize, - (void *)&dummy, - (void *)&dummy, - &fd_open, - &fd_close, - &fd_read, - (void *)&dummy, - &fd_lseek, - (void *)&dummy, - (void *)&dummy, - (void *)&dummy, - (void *)&dummy, - (void *)&dummy, - (void *)&dummy, - (void *)&dummy, - (void *)&dummy, - (void *)&dummy, + DUMMY_IMPLEMENTATION, // init + DUMMY_IMPLEMENTATION, // deinit + NOT_SUPPORTED, // format + &fd_open, // open + &fd_close, // close + &fd_read, // read + NOT_SUPPORTED, // write + &fd_lseek, // lseek + NOT_SUPPORTED, // ioctl + NOT_SUPPORTED, // remove + NOT_SUPPORTED, // mkdir + NOT_SUPPORTED, // rmdir + NOT_SUPPORTED, // dopen + NOT_SUPPORTED, // dclose + NOT_SUPPORTED, // dread + NOT_SUPPORTED, // getstat + NOT_SUPPORTED, // chstat }; // FileIO structure. diff --git a/iop/fs/http/src/ps2http.c b/iop/fs/http/src/ps2http.c index aa917b50798..542d0711981 100644 --- a/iop/fs/http/src/ps2http.c +++ b/iop/fs/http/src/ps2http.c @@ -38,6 +38,7 @@ #include #include #include +#include #include "ps2ip.h" @@ -347,24 +348,6 @@ const char *resolveAddress( struct sockaddr_in *server, const char * url, char * #endif } -/** - * Any calls we don't implement calls dummy. - */ -int httpDummy() -{ - M_PRINTF("dummy function called\n"); - return -EIO; -} - -int httpInitialize(iop_io_device_t *driver) -{ - (void)driver; - - M_PRINTF("filesystem driver initialized\n"); - - return 0; -} - /** * Open has the most work to do in the file driver. It must: * @@ -500,23 +483,23 @@ int httpLseek(iop_io_file_t *f, int offset, int mode) static iop_io_device_ops_t ps2httpOps = { - &httpInitialize, - (void *)&httpDummy, - (void *)&httpDummy, + DUMMY_IMPLEMENTATION, + DUMMY_IMPLEMENTATION, + NOT_SUPPORTED, &httpOpen, &httpClose, &httpRead, - (void *)&httpDummy, + NOT_SUPPORTED, &httpLseek, - (void *)&httpDummy, - (void *)&httpDummy, - (void *)&httpDummy, - (void *)&httpDummy, - (void *)&httpDummy, - (void *)&httpDummy, - (void *)&httpDummy, - (void *)&httpDummy, - (void *)&httpDummy, + NOT_SUPPORTED, + NOT_SUPPORTED, + NOT_SUPPORTED, + NOT_SUPPORTED, + NOT_SUPPORTED, + NOT_SUPPORTED, + NOT_SUPPORTED, + NOT_SUPPORTED, + NOT_SUPPORTED, }; static iop_io_device_t ps2httpDev = { diff --git a/iop/fs/romdrv/src/romdrv.c b/iop/fs/romdrv/src/romdrv.c index 1eb68bcc437..da2e08accaa 100644 --- a/iop/fs/romdrv/src/romdrv.c +++ b/iop/fs/romdrv/src/romdrv.c @@ -42,34 +42,32 @@ static struct RomFileSlot fileSlots[ROMDRV_MAX_FILES]; /* Function prototypes */ static int init(void); -static int romUnsupported(void); -static int romInit(iop_device_t *device); static int romOpen(iop_file_t *fd, const char *path, int mode); static int romClose(iop_file_t *); static int romRead(iop_file_t *fd, void *buffer, int size); -static int romWrite(iop_file_t *fd, void *buffer, int size); static int romLseek(iop_file_t *fd, int offset, int whence); static struct RomImg *romGetImageStat(const void *start, const void *end, struct RomImg *ImageStat); static struct RomdirFileStat *GetFileStatFromImage(const struct RomImg *ImageStat, const char *filename, struct RomdirFileStat *stat); static iop_device_ops_t ops = { - &romInit, - (void *)&romUnsupported, - (void *)&romUnsupported, - &romOpen, - &romClose, - &romRead, - &romWrite, - &romLseek, - (void *)&romUnsupported, - (void *)&romUnsupported, - (void *)&romUnsupported, - (void *)&romUnsupported, - (void *)&romUnsupported, - (void *)&romUnsupported, - (void *)&romUnsupported, - (void *)&romUnsupported, - (void *)&romUnsupported}; + DUMMY_IMPLEMENTATION, // init + DUMMY_IMPLEMENTATION, // deinit + NOT_SUPPORTED, // format + &romOpen, // open + &romClose, // close + &romRead, // read + NOT_SUPPORTED, // write + &romLseek, // lseek + NOT_SUPPORTED, // ioctl + NOT_SUPPORTED, // remove + NOT_SUPPORTED, // mkdir + NOT_SUPPORTED, // rmdir + NOT_SUPPORTED, // dopen + NOT_SUPPORTED, // dclose + NOT_SUPPORTED, // dread + NOT_SUPPORTED, // getstat + NOT_SUPPORTED, // chstat +}; static iop_device_t DeviceOps = { "rom", @@ -110,18 +108,6 @@ static int init(void) return 0; } -static int romUnsupported(void) -{ - return 0; -} - -static int romInit(iop_device_t *device) -{ - (void)device; - - return 0; -} - int romAddDevice(int unit, const void *image) { int result, OldState; @@ -265,15 +251,6 @@ static int romRead(iop_file_t *fd, void *buffer, int size) return size; } -static int romWrite(iop_file_t *fd, void *buffer, int size) -{ - (void)fd; - (void)buffer; - (void)size; - - return -EIO; -} - static int romLseek(iop_file_t *fd, int offset, int whence) { struct RomFileSlot *slot = (struct RomFileSlot *)fd->privdata; diff --git a/iop/fs/subfile/src/subfile.c b/iop/fs/subfile/src/subfile.c index c400fc1afb5..afb41ffddab 100644 --- a/iop/fs/subfile/src/subfile.c +++ b/iop/fs/subfile/src/subfile.c @@ -16,7 +16,6 @@ IRX_ID(MODNAME, 2, 1); // Based on the module from PBPX-95216 -static int subfile_op_nulldev(void); static int subfile_op_open(iop_file_t *f, const char *name, int mode); static int subfile_op_close(iop_file_t *f); static int subfile_op_read(iop_file_t *f, void *ptr, int size); @@ -31,23 +30,23 @@ typedef struct subfile_priv_fd_ } subfile_priv_fd_t; static iop_device_ops_t subfile_devops = { - (void *)subfile_op_nulldev, - (void *)subfile_op_nulldev, - (void *)subfile_op_nulldev, - subfile_op_open, - subfile_op_close, - subfile_op_read, - (void *)subfile_op_nulldev, - subfile_op_lseek, - (void *)subfile_op_nulldev, - (void *)subfile_op_nulldev, - (void *)subfile_op_nulldev, - (void *)subfile_op_nulldev, - (void *)subfile_op_nulldev, - (void *)subfile_op_nulldev, - (void *)subfile_op_nulldev, - (void *)subfile_op_nulldev, - (void *)subfile_op_nulldev, + DUMMY_IMPLEMENTATION, // init + DUMMY_IMPLEMENTATION, // deinit + NOT_SUPPORTED, // format + subfile_op_open, // open + subfile_op_close, // close + subfile_op_read, // read + NOT_SUPPORTED, // write + subfile_op_lseek, // lseek + NOT_SUPPORTED, // ioctl + NOT_SUPPORTED, // remove + NOT_SUPPORTED, // mkdir + NOT_SUPPORTED, // rmdir + NOT_SUPPORTED, // dopen + NOT_SUPPORTED, // dclose + NOT_SUPPORTED, // dread + NOT_SUPPORTED, // getstat + NOT_SUPPORTED, // chstat }; static iop_device_t subfile_dev = { "subfile", @@ -161,11 +160,6 @@ static int subfile_op_open(iop_file_t *f, const char *name, int mode) return 0; } -static int subfile_op_nulldev(void) -{ - return 0; -} - static int subfile_op_close(iop_file_t *f) { subfile_priv_fd_t *privdata; diff --git a/iop/fs/vfat/src/fs_driver.c b/iop/fs/vfat/src/fs_driver.c index fa19f8f7508..a7ca70a3eaa 100644 --- a/iop/fs/vfat/src/fs_driver.c +++ b/iop/fs/vfat/src/fs_driver.c @@ -996,40 +996,40 @@ static int fs_ioctl2(iop_file_t *fd, int cmd, void *data, unsigned int datalen, #ifndef WIN32 static iop_device_ops_t fs_functarray = { - &fs_init, - NOT_SUPPORTED, - NOT_SUPPORTED, - &fs_open, - &fs_close, - &fs_read, - &fs_write, - &fs_lseek, - &fs_ioctl, - &fs_remove, - &fs_mkdir, - &fs_rmdir, - &fs_dopen, - &fs_dclose, - &fs_dread, - &fs_getstat, - NOT_SUPPORTED, - &fs_rename, - NOT_SUPPORTED, - NOT_SUPPORTED, - NOT_SUPPORTED, - NOT_SUPPORTED, - NOT_SUPPORTED, + &fs_init, // init + DUMMY_IMPLEMENTATION, // deinit + NOT_SUPPORTED, // format + &fs_open, // open + &fs_close, // close + &fs_read, // read + &fs_write, // write + &fs_lseek, // lseek + &fs_ioctl, // ioctl + &fs_remove, // remove + &fs_mkdir, // mkdir + &fs_rmdir, // rmdir + &fs_dopen, // dopen + &fs_dclose, // dclose + &fs_dread, // dread + &fs_getstat, // getstat + NOT_SUPPORTED, // chstat + &fs_rename, // rename + NOT_SUPPORTED, // chdir + NOT_SUPPORTED, // sync + NOT_SUPPORTED, // mount + NOT_SUPPORTED, // umount + NOT_SUPPORTED_S64, // lseek64 #ifndef BUILDING_IEEE1394_DISK - &fs_devctl, + &fs_devctl, // devctl #else - NOT_SUPPORTED, + NOT_SUPPORTED, // devctl #endif /* BUILDING_IEEE1394_DISK */ - NOT_SUPPORTED, - NOT_SUPPORTED, + NOT_SUPPORTED, // symlink + NOT_SUPPORTED, // readlink #if !defined(BUILDING_IEEE1394_DISK) && !defined(BUILDING_USBHDFSD) - &fs_ioctl2, + &fs_ioctl2, // ioctl2 #else - NOT_SUPPORTED, + NOT_SUPPORTED, // ioctl2 #endif /* BUILDING_IEEE1394_DISK */ }; static iop_device_t fs_driver = { diff --git a/iop/hdd/apa/src/hdd.c b/iop/hdd/apa/src/hdd.c index 816abe84fa2..3940f3ad773 100644 --- a/iop/hdd/apa/src/hdd.c +++ b/iop/hdd/apa/src/hdd.c @@ -40,33 +40,33 @@ IRX_ID("hdd_driver", APA_MODVER_MAJOR, APA_MODVER_MINOR); #endif static iomanX_iop_device_ops_t hddOps={ - &hddInit, - &hddDeinit, - &hddFormat, - &hddOpen, - &hddClose, - &hddRead, - &hddWrite, - &hddLseek, - NOT_SUPPORTED, - &hddRemove, - NOT_SUPPORTED, - NOT_SUPPORTED, - &hddDopen, - &hddClose, - &hddDread, - &hddGetStat, - NOT_SUPPORTED, - &hddReName, - NOT_SUPPORTED, - NOT_SUPPORTED, - hddMount, - hddUmount, - NOT_SUPPORTED, - &hddDevctl, - NOT_SUPPORTED, - NOT_SUPPORTED, - &hddIoctl2, + &hddInit, // init + &hddDeinit, // deinit + &hddFormat, // format + &hddOpen, // open + &hddClose, // close + &hddRead, // read + &hddWrite, // write + &hddLseek, // lseek + NOT_SUPPORTED, // ioctl + &hddRemove, // remove + NOT_SUPPORTED, // mkdir + NOT_SUPPORTED, // rmdir + &hddDopen, // dopen + &hddClose, // dclose + &hddDread, // dread + &hddGetStat, // getstat + NOT_SUPPORTED, // chstat + &hddReName, // rename + NOT_SUPPORTED, // chdir + NOT_SUPPORTED, // sync + hddMount, // mount + hddUmount, // umount + NOT_SUPPORTED_S64, // lseek64 + &hddDevctl, // devctl + NOT_SUPPORTED, // symlink + NOT_SUPPORTED, // readlink + &hddIoctl2, // ioctl2 }; static iomanX_iop_device_t hddFioDev={ "hdd", diff --git a/iop/hdd/fsck/src/fsck.c b/iop/hdd/fsck/src/fsck.c index 17048ee0325..de951e3fad4 100644 --- a/iop/hdd/fsck/src/fsck.c +++ b/iop/hdd/fsck/src/fsck.c @@ -895,12 +895,6 @@ static void FsckThread(void *arg) SetEventFlag(fsckEventFlagID, 1); } -// 0x0000264c -static int FsckUnsupported(void) -{ - return 0; -} - // 0x00000340 static int fsckCheckBitmap(pfs_mount_t *mount, void *buffer) { @@ -1218,33 +1212,33 @@ static int FsckIoctl2(iomanX_iop_file_t *fd, int cmd, void *arg, unsigned int ar } static iomanX_iop_device_ops_t FsckDeviceOps = { - (void *)&FsckUnsupported, - (void *)&FsckUnsupported, - NULL, - &FsckOpen, - &FsckClose, - NULL, - NULL, - NULL, - (void *)&FsckUnsupported, - (void *)&FsckUnsupported, - (void *)&FsckUnsupported, - (void *)&FsckUnsupported, - (void *)&FsckUnsupported, - (void *)&FsckUnsupported, - (void *)&FsckUnsupported, - (void *)&FsckUnsupported, - (void *)&FsckUnsupported, - (void *)&FsckUnsupported, - (void *)&FsckUnsupported, - (void *)&FsckUnsupported, - (void *)&FsckUnsupported, - (void *)&FsckUnsupported, - (void *)&FsckUnsupported, - (void *)&FsckUnsupported, - (void *)&FsckUnsupported, - (void *)&FsckUnsupported, - &FsckIoctl2}; + DUMMY_IMPLEMENTATION, // init + DUMMY_IMPLEMENTATION, // deinit + NOT_SUPPORTED, // format + &FsckOpen, // open + &FsckClose, // close + NOT_SUPPORTED, // read + NOT_SUPPORTED, // write + NOT_SUPPORTED, // lseek + NOT_SUPPORTED, // ioctl + NOT_SUPPORTED, // remove + NOT_SUPPORTED, // mkdir + NOT_SUPPORTED, // rmdir + NOT_SUPPORTED, // dopen + NOT_SUPPORTED, // dclose + NOT_SUPPORTED, // dread + NOT_SUPPORTED, // getstat + NOT_SUPPORTED, // chstat + NOT_SUPPORTED, // rename + NOT_SUPPORTED, // chdir + NOT_SUPPORTED, // sync + NOT_SUPPORTED, // mount + NOT_SUPPORTED, // umount + NOT_SUPPORTED_S64, // lseek64 + NOT_SUPPORTED, // devctl + NOT_SUPPORTED, // symlink + NOT_SUPPORTED, // readlink + &FsckIoctl2}; // ioctl2 static iomanX_iop_device_t FsckDevice = { "fsck", diff --git a/iop/hdd/fssk/src/fssk.c b/iop/hdd/fssk/src/fssk.c index 38de566320f..35b64b04d26 100644 --- a/iop/hdd/fssk/src/fssk.c +++ b/iop/hdd/fssk/src/fssk.c @@ -563,11 +563,6 @@ static void FsskThread(pfs_mount_t *mount) SetEventFlag(fsskEventFlagID, 1); } -static int FsskUnsupported(void) -{ - return 0; -} - static int FsskOpen(iomanX_iop_file_t *fd, const char *name, int flags, int mode) { int blockfd, result; @@ -721,33 +716,33 @@ static int FsskIoctl2(iomanX_iop_file_t *fd, int cmd, void *arg, unsigned int ar } static iomanX_iop_device_ops_t FsskDeviceOps = { - (void *)&FsskUnsupported, - (void *)&FsskUnsupported, - NULL, - &FsskOpen, - &FsskClose, - NULL, - NULL, - NULL, - (void *)&FsskUnsupported, - (void *)&FsskUnsupported, - (void *)&FsskUnsupported, - (void *)&FsskUnsupported, - (void *)&FsskUnsupported, - (void *)&FsskUnsupported, - (void *)&FsskUnsupported, - (void *)&FsskUnsupported, - (void *)&FsskUnsupported, - (void *)&FsskUnsupported, - (void *)&FsskUnsupported, - (void *)&FsskUnsupported, - (void *)&FsskUnsupported, - (void *)&FsskUnsupported, - (void *)&FsskUnsupported, - (void *)&FsskUnsupported, - (void *)&FsskUnsupported, - (void *)&FsskUnsupported, - &FsskIoctl2}; + DUMMY_IMPLEMENTATION, // init + DUMMY_IMPLEMENTATION, // deinit + NOT_SUPPORTED, // format + &FsskOpen, // open + &FsskClose, // close + NOT_SUPPORTED, // read + NOT_SUPPORTED, // write + NOT_SUPPORTED, // lseek + NOT_SUPPORTED, // ioctl + NOT_SUPPORTED, // remove + NOT_SUPPORTED, // mkdir + NOT_SUPPORTED, // rmdir + NOT_SUPPORTED, // dopen + NOT_SUPPORTED, // dclose + NOT_SUPPORTED, // dread + NOT_SUPPORTED, // getstat + NOT_SUPPORTED, // chstat + NOT_SUPPORTED, // rename + NOT_SUPPORTED, // chdir + NOT_SUPPORTED, // sync + NOT_SUPPORTED, // mount + NOT_SUPPORTED, // umount + NOT_SUPPORTED_S64, // lseek64 + NOT_SUPPORTED, // devctl + NOT_SUPPORTED, // symlink + NOT_SUPPORTED, // readlink + &FsskIoctl2}; // ioctl2 static iomanX_iop_device_t FsskDevice = { "fssk", diff --git a/iop/hdd/hdck/src/hdck.c b/iop/hdd/hdck/src/hdck.c index e739a3588f5..8644311a9d3 100644 --- a/iop/hdd/hdck/src/hdck.c +++ b/iop/hdd/hdck/src/hdck.c @@ -34,33 +34,34 @@ static u8 IOBuffer[128 * 512]; static u8 IOBuffer2[128 * 512]; static iomanX_iop_device_ops_t HdckDeviceOps = { - &HdckInit, - NOT_SUPPORTED, - NOT_SUPPORTED, - NOT_SUPPORTED, - NOT_SUPPORTED, - NOT_SUPPORTED, - NOT_SUPPORTED, - NOT_SUPPORTED, - NOT_SUPPORTED, - NOT_SUPPORTED, - NOT_SUPPORTED, - NOT_SUPPORTED, - NOT_SUPPORTED, - NOT_SUPPORTED, - NOT_SUPPORTED, - NOT_SUPPORTED, - NOT_SUPPORTED, - NOT_SUPPORTED, - NOT_SUPPORTED, - NOT_SUPPORTED, - NOT_SUPPORTED, - NOT_SUPPORTED, - NOT_SUPPORTED, - &HdckDevctl, - NULL, - NULL, - NULL}; + &HdckInit, // init + DUMMY_IMPLEMENTATION, // deinit + NOT_SUPPORTED, // format + NOT_SUPPORTED, // open + NOT_SUPPORTED, // close + NOT_SUPPORTED, // read + NOT_SUPPORTED, // write + NOT_SUPPORTED, // lseek + NOT_SUPPORTED, // ioctl + NOT_SUPPORTED, // remove + NOT_SUPPORTED, // mkdir + NOT_SUPPORTED, // rmdir + NOT_SUPPORTED, // dopen + NOT_SUPPORTED, // dclose + NOT_SUPPORTED, // dread + NOT_SUPPORTED, // getstat + NOT_SUPPORTED, // chstat + NOT_SUPPORTED, // rename + NOT_SUPPORTED, // chdir + NOT_SUPPORTED, // sync + NOT_SUPPORTED, // mount + NOT_SUPPORTED, // umount + NOT_SUPPORTED_S64, // lseek64 + &HdckDevctl, // devctl + NOT_SUPPORTED, // symlink + NOT_SUPPORTED, // readlink + NOT_SUPPORTED, // ioctl2 +}; static iomanX_iop_device_t HdckDevice = { "hdck", diff --git a/iop/hdd/hdsk/src/hdsk.c b/iop/hdd/hdsk/src/hdsk.c index 1b50344da57..a1f9a0b32e5 100644 --- a/iop/hdd/hdsk/src/hdsk.c +++ b/iop/hdd/hdsk/src/hdsk.c @@ -725,33 +725,33 @@ static int HdskDevctl(iomanX_iop_file_t *fd, const char *name, int cmd, void *ar } static iomanX_iop_device_ops_t HdskDeviceOps = { - &HdskInit, - NOT_SUPPORTED, - NOT_SUPPORTED, - NOT_SUPPORTED, - NOT_SUPPORTED, - NOT_SUPPORTED, - NOT_SUPPORTED, - NOT_SUPPORTED, - NOT_SUPPORTED, - NOT_SUPPORTED, - NOT_SUPPORTED, - NOT_SUPPORTED, - NOT_SUPPORTED, - NOT_SUPPORTED, - NOT_SUPPORTED, - NOT_SUPPORTED, - NOT_SUPPORTED, - NOT_SUPPORTED, - NOT_SUPPORTED, - NOT_SUPPORTED, - NOT_SUPPORTED, - NOT_SUPPORTED, - NOT_SUPPORTED, - &HdskDevctl, - NOT_SUPPORTED, - NOT_SUPPORTED, - NOT_SUPPORTED, + &HdskInit, // init + DUMMY_IMPLEMENTATION, // deinit + NOT_SUPPORTED, // format + NOT_SUPPORTED, // open + NOT_SUPPORTED, // close + NOT_SUPPORTED, // read + NOT_SUPPORTED, // write + NOT_SUPPORTED, // lseek + NOT_SUPPORTED, // ioctl + NOT_SUPPORTED, // remove + NOT_SUPPORTED, // mkdir + NOT_SUPPORTED, // rmdir + NOT_SUPPORTED, // dopen + NOT_SUPPORTED, // dclose + NOT_SUPPORTED, // dread + NOT_SUPPORTED, // getstat + NOT_SUPPORTED, // chstat + NOT_SUPPORTED, // rename + NOT_SUPPORTED, // chdir + NOT_SUPPORTED, // sync + NOT_SUPPORTED, // mount + NOT_SUPPORTED, // umount + NOT_SUPPORTED_S64, // lseek64 + &HdskDevctl, // devctl + NOT_SUPPORTED, // symlink + NOT_SUPPORTED, // readlink + NOT_SUPPORTED, // ioctl2 }; static iomanX_iop_device_t HdskDevice = { diff --git a/iop/hdd/pfs/src/pfs.c b/iop/hdd/pfs/src/pfs.c index 20163038f4c..e6ea5e26526 100644 --- a/iop/hdd/pfs/src/pfs.c +++ b/iop/hdd/pfs/src/pfs.c @@ -37,33 +37,33 @@ IRX_ID("pfs_driver", PFS_MAJOR, PFS_MINOR); // Globals static iomanX_iop_device_ops_t pfsOps = { - &pfsFioInit, - &pfsFioDeinit, - &pfsFioFormat, - &pfsFioOpen, - &pfsFioClose, - &pfsFioRead, - &pfsFioWrite, - &pfsFioLseek, - &pfsFioIoctl, - &pfsFioRemove, - &pfsFioMkdir, - &pfsFioRmdir, - &pfsFioDopen, - &pfsFioClose, - &pfsFioDread, - &pfsFioGetstat, - &pfsFioChstat, - &pfsFioRename, - &pfsFioChdir, - &pfsFioSync, - &pfsFioMount, - &pfsFioUmount, - &pfsFioLseek64, - &pfsFioDevctl, - &pfsFioSymlink, - &pfsFioReadlink, - &pfsFioIoctl2, + &pfsFioInit, // init + &pfsFioDeinit, // deinit + &pfsFioFormat, // format + &pfsFioOpen, // open + &pfsFioClose, // close + &pfsFioRead, // read + &pfsFioWrite, // write + &pfsFioLseek, // lseek + &pfsFioIoctl, // ioctl + &pfsFioRemove, // remove + &pfsFioMkdir, // mkdir + &pfsFioRmdir, // rmdir + &pfsFioDopen, // dopen + &pfsFioClose, // dclose + &pfsFioDread, // dread + &pfsFioGetstat, // getstat + &pfsFioChstat, // chstat + &pfsFioRename, // rename + &pfsFioChdir, // chdir + &pfsFioSync, // sync + &pfsFioMount, // mount + &pfsFioUmount, // umount + &pfsFioLseek64, // lseek64 + &pfsFioDevctl, // devctl + &pfsFioSymlink, // symlink + &pfsFioReadlink, // readlink + &pfsFioIoctl2, // ioctl2 }; static iomanX_iop_device_t pfsFioDev = { diff --git a/iop/kernel/include/ioman.h b/iop/kernel/include/ioman.h index c73562b3395..42b386268da 100644 --- a/iop/kernel/include/ioman.h +++ b/iop/kernel/include/ioman.h @@ -71,8 +71,14 @@ typedef struct _iop_device { struct _iop_device_ops *ops; } iop_device_t; -static inline int not_supported_op (void) {return -ENOTSUP;} -#define NOT_SUPPORTED (void*)¬_supported_op +static inline int not_supported_int(void) {return -ENOTSUP;} +static inline signed long long not_supported_s64(void) {return -ENOTSUP;} +static inline int dummy_implementation_int(void) { return 0; } +static inline signed long long dummy_implementation_s64(void) { return 0; } +#define NOT_SUPPORTED (void*)¬_supported_int +#define NOT_SUPPORTED_S64 (void*)¬_supported_s64 +#define DUMMY_IMPLEMENTATION (void*)&dummy_implementation_int +#define DUMMY_IMPLEMENTATION_S64 (void*)&dummy_implementation_s64 typedef struct _iop_device_ops { int (*init)(iop_device_t *); diff --git a/iop/kernel/include/iomanX.h b/iop/kernel/include/iomanX.h index 14bb5f82903..12aeb042f25 100644 --- a/iop/kernel/include/iomanX.h +++ b/iop/kernel/include/iomanX.h @@ -88,8 +88,14 @@ typedef struct _iomanX_iop_device { struct _iomanX_iop_device_ops *ops; } iomanX_iop_device_t; -static inline int not_supported_op (void) {return -ENOTSUP;} -#define NOT_SUPPORTED (void*)¬_supported_op +static inline int not_supported_int(void) {return -ENOTSUP;} +static inline signed long long not_supported_s64(void) {return -ENOTSUP;} +static inline int dummy_implementation_int(void) { return 0; } +static inline signed long long dummy_implementation_s64(void) { return 0; } +#define NOT_SUPPORTED (void*)¬_supported_int +#define NOT_SUPPORTED_S64 (void*)¬_supported_s64 +#define DUMMY_IMPLEMENTATION (void*)&dummy_implementation_int +#define DUMMY_IMPLEMENTATION_S64 (void*)&dummy_implementation_s64 typedef struct _iomanX_iop_device_ops { int (*init)(iomanX_iop_device_t *); diff --git a/iop/network/smbman/src/smb_fio.c b/iop/network/smbman/src/smb_fio.c index aad39ab3c4b..9a99dfdda08 100644 --- a/iop/network/smbman/src/smb_fio.c +++ b/iop/network/smbman/src/smb_fio.c @@ -26,33 +26,33 @@ int smbman_io_sema; // driver ops func tab static iop_device_ops_t smbman_ops = { - &smb_init, - &smb_deinit, - NOT_SUPPORTED, - &smb_open, - &smb_close, - &smb_read, - &smb_write, - &smb_lseek, - NOT_SUPPORTED, - &smb_remove, - &smb_mkdir, - &smb_rmdir, - &smb_dopen, - &smb_dclose, - &smb_dread, - &smb_getstat, - NOT_SUPPORTED, - &smb_rename, - &smb_chdir, - NOT_SUPPORTED, - NOT_SUPPORTED, - NOT_SUPPORTED, - &smb_lseek64, - &smb_devctl, - NOT_SUPPORTED, - NOT_SUPPORTED, - NOT_SUPPORTED + &smb_init, // init + &smb_deinit, // deinit + NOT_SUPPORTED, // format + &smb_open, // open + &smb_close, // close + &smb_read, // read + &smb_write, // write + &smb_lseek, // lseek + NOT_SUPPORTED, // ioctl + &smb_remove, // remove + &smb_mkdir, // mkdir + &smb_rmdir, // rmdir + &smb_dopen, // dopen + &smb_dclose, // dclose + &smb_dread, // dread + &smb_getstat, // getstat + NOT_SUPPORTED, // chstat + &smb_rename, // rename + &smb_chdir, // chdir + NOT_SUPPORTED, // sync + NOT_SUPPORTED, // mount + NOT_SUPPORTED, // umount + &smb_lseek64, // lseek64 + &smb_devctl, // devctl + NOT_SUPPORTED, // symlink + NOT_SUPPORTED, // readlink + NOT_SUPPORTED // ioctl2 }; // driver descriptor diff --git a/iop/network/udptty/src/udptty.c b/iop/network/udptty/src/udptty.c index 2deccb9492c..8263705bde1 100644 --- a/iop/network/udptty/src/udptty.c +++ b/iop/network/udptty/src/udptty.c @@ -44,23 +44,23 @@ static int tty_write(iop_file_t *file, void *buf, size_t size); /* device ops */ static iop_device_ops_t tty_ops = { - tty_init, - tty_deinit, - NOT_SUPPORTED, - (void *)tty_stdout_fd, - (void *)tty_stdout_fd, - NOT_SUPPORTED, - (void *)tty_write, - NOT_SUPPORTED, - NOT_SUPPORTED, - NOT_SUPPORTED, - NOT_SUPPORTED, - NOT_SUPPORTED, - NOT_SUPPORTED, - NOT_SUPPORTED, - NOT_SUPPORTED, - NOT_SUPPORTED, - NOT_SUPPORTED, + tty_init, // init + tty_deinit, // deinit + NOT_SUPPORTED, // format + (void *)tty_stdout_fd, // open + (void *)tty_stdout_fd, // close + NOT_SUPPORTED, // read + (void *)tty_write, // write + NOT_SUPPORTED, // lseek + NOT_SUPPORTED, // ioctl + NOT_SUPPORTED, // remove + NOT_SUPPORTED, // mkdir + NOT_SUPPORTED, // rmdir + NOT_SUPPORTED, // dopen + NOT_SUPPORTED, // dclose + NOT_SUPPORTED, // dread + NOT_SUPPORTED, // getstat + NOT_SUPPORTED, // chstat }; /* device descriptor */ diff --git a/iop/system/ioman/src/ioman.c b/iop/system/ioman/src/ioman.c index 735e17cc1b5..01cd85f798c 100644 --- a/iop/system/ioman/src/ioman.c +++ b/iop/system/ioman/src/ioman.c @@ -36,6 +36,8 @@ IRX_ID("IO/File_Manager", 1, 1); #include "errno.h" +#include + #define MAX_DEVICES 16 #define MAX_FILES 16 @@ -50,29 +52,24 @@ static int should_print_known_devices = 1; extern struct irx_export_table _exp_ioman; #endif -static int tty_noop() -{ - return 0; -} - iop_io_device_ops_t tty_dev_operations = { - &tty_noop, - &tty_noop, - &tty_noop, - &tty_noop, - &tty_noop, - &tty_noop, - &tty_noop, - &tty_noop, - &tty_noop, - &tty_noop, - &tty_noop, - &tty_noop, - &tty_noop, - &tty_noop, - &tty_noop, - &tty_noop, - &tty_noop, + DUMMY_IMPLEMENTATION, + DUMMY_IMPLEMENTATION, + NOT_SUPPORTED, + NOT_SUPPORTED, + NOT_SUPPORTED, + NOT_SUPPORTED, + NOT_SUPPORTED, + NOT_SUPPORTED, + NOT_SUPPORTED, + NOT_SUPPORTED, + NOT_SUPPORTED, + NOT_SUPPORTED, + NOT_SUPPORTED, + NOT_SUPPORTED, + NOT_SUPPORTED, + NOT_SUPPORTED, + NOT_SUPPORTED, }; iop_io_device_t tty_device = { diff --git a/iop/system/iomanx/src/iomanX.c b/iop/system/iomanx/src/iomanX.c index ea13e71071b..7485af6487c 100644 --- a/iop/system/iomanx/src/iomanX.c +++ b/iop/system/iomanx/src/iomanX.c @@ -85,33 +85,33 @@ struct ioman_dev_listentry static int showdrvflag = 1; #ifndef IOMANX_ENABLE_LEGACY_IOMAN_HOOK static iomanX_iop_device_ops_t dev_tty_dev_operations = { - (void *)&tty_noop, - (void *)&tty_noop, - (void *)&tty_noop, - (void *)&tty_noop, - (void *)&tty_noop, - (void *)&tty_noop, - (void *)&tty_noop, - (void *)&tty_noop, - (void *)&tty_noop, - (void *)&tty_noop, - (void *)&tty_noop, - (void *)&tty_noop, - (void *)&tty_noop, - (void *)&tty_noop, - (void *)&tty_noop, - (void *)&tty_noop, - (void *)&tty_noop, - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, + DUMMY_IMPLEMENTATION, // init + DUMMY_IMPLEMENTATION, // deinit + NOT_SUPPORTED, // format + NOT_SUPPORTED, // open + NOT_SUPPORTED, // close + NOT_SUPPORTED, // read + NOT_SUPPORTED, // write + NOT_SUPPORTED, // lseek + NOT_SUPPORTED, // ioctl + NOT_SUPPORTED, // remove + NOT_SUPPORTED, // mkdir + NOT_SUPPORTED, // rmdir + NOT_SUPPORTED, // dopen + NOT_SUPPORTED, // dclose + NOT_SUPPORTED, // dread + NOT_SUPPORTED, // getstat + NOT_SUPPORTED, // chstat + NOT_SUPPORTED, // rename + NOT_SUPPORTED, // chdir + NOT_SUPPORTED, // sync + NOT_SUPPORTED, // mount + NOT_SUPPORTED, // umount + NOT_SUPPORTED_S64, // lseek64 + NOT_SUPPORTED, // devctl + NOT_SUPPORTED, // symlink + NOT_SUPPORTED, // readlink + NOT_SUPPORTED, // ioctl2 }; static iomanX_iop_device_t dev_tty = { "tty", @@ -1012,13 +1012,6 @@ static const char *parsefile(const char *path, iomanX_iop_device_t **p_device, i // Unofficial: unused "io request for unsupported operation" func removed -#ifndef IOMANX_ENABLE_LEGACY_IOMAN_HOOK -static int tty_noop(void) -{ - return 0; -} -#endif - int iomanX_AddDrv(iomanX_iop_device_t *device) { #ifdef IOMANX_USE_DEVICE_LINKED_LIST diff --git a/iop/usb/keyboard/src/ps2kbd.c b/iop/usb/keyboard/src/ps2kbd.c index d6be352e41d..db0758788ce 100644 --- a/iop/usb/keyboard/src/ps2kbd.c +++ b/iop/usb/keyboard/src/ps2kbd.c @@ -1112,23 +1112,23 @@ int fio_close(iop_file_t *f) static iop_device_ops_t fio_ops = { - &fio_init, - NOT_SUPPORTED, - &fio_format, - &fio_open, - &fio_close, - &fio_read, - NOT_SUPPORTED, - NOT_SUPPORTED, - &fio_ioctl, - NOT_SUPPORTED, - NOT_SUPPORTED, - NOT_SUPPORTED, - NOT_SUPPORTED, - NOT_SUPPORTED, - NOT_SUPPORTED, - NOT_SUPPORTED, - NOT_SUPPORTED, + &fio_init, // init + DUMMY_IMPLEMENTATION, // deinit + &fio_format, // format + &fio_open, // open + &fio_close, // close + &fio_read, // read + NOT_SUPPORTED, // write + NOT_SUPPORTED, // lseek + &fio_ioctl, // ioctl + NOT_SUPPORTED, // remove + NOT_SUPPORTED, // mkdir + NOT_SUPPORTED, // rmdir + NOT_SUPPORTED, // dopen + NOT_SUPPORTED, // dclose + NOT_SUPPORTED, // dread + NOT_SUPPORTED, // getstat + NOT_SUPPORTED, // chstat }; static iop_device_t kbd_filedrv = {