blockdev: convert some macros to static inlines