• Arnd Bergmann's avatar
    ubifs: fix function pointer cast warnings · ec724e53
    Arnd Bergmann authored
    ubifs has a number of callback functions for ubifs_lpt_scan_nolock() using
    two different prototypes, either passing a struct scan_data or
    a struct ubifs_lp_stats, but the caller expects a void pointer instead.
    
    clang-16 now warns about this:
    
    fs/ubifs/find.c:170:9: error: cast from 'int (*)(struct ubifs_info *, const struct ubifs_lprops *, int, struct scan_data *)' to 'ubifs_lpt_scan_callback' (aka 'int (*)(struct ubifs_info *, const struct ubifs_lprops *, int, void *)') converts to incompatible function type [-Werror,-Wcast-function-type-strict]
      170 |                                     (ubifs_lpt_scan_callback)scan_for_dirty_cb,
          |                                     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    fs/ubifs/find.c:449:9: error: cast from 'int (*)(struct ubifs_info *, const struct ubifs_lprops *, int, struct scan_data *)' to 'ubifs_lpt_scan_callback' (aka 'int (*)(struct ubifs_info *, const struct ubifs_lprops *, int, void *)') converts to incompatible function type [-Werror,-Wcast-function-type-strict]
      449 |                                     (ubifs_lpt_scan_callback)scan_for_free_cb,
          |                                     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    
    Change all of these callback functions to actually take the void * argument
    that is passed by their caller.
    Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
    Reviewed-by: default avatarZhihao Cheng <chengzhihao1@huawei.com>
    Signed-off-by: default avatarRichard Weinberger <richard@nod.at>
    ec724e53
lprops.c 35.4 KB