From: Geert Uytterhoeven Date: Thu, 21 Oct 2010 08:32:29 +0000 (+0200) Subject: block: Turn bvec_k{un,}map_irq() into static inline functions X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=11a691bea48887c27425cc40bf291e74c922df25;p=openwrt%2Fstaging%2Fblogic.git block: Turn bvec_k{un,}map_irq() into static inline functions Convert bvec_k{un,}map_irq() from macros to static inline functions if !CONFIG_HIGHMEM, so we can easier detect mistakes like the one fixed in 93055c31045a2d5599ec613a0c6cdcefc481a460 ("ps3disk: passing wrong variable = to bvec_kunmap_irq()") Signed-off-by: Geert Uytterhoeven Signed-off-by: Jens Axboe --- diff --git a/include/linux/bio.h b/include/linux/bio.h index 2c3fd7421607..ba679992d39b 100644 --- a/include/linux/bio.h +++ b/include/linux/bio.h @@ -346,8 +346,15 @@ static inline void bvec_kunmap_irq(char *buffer, unsigned long *flags) } #else -#define bvec_kmap_irq(bvec, flags) (page_address((bvec)->bv_page) + (bvec)->bv_offset) -#define bvec_kunmap_irq(buf, flags) do { *(flags) = 0; } while (0) +static inline char *bvec_kmap_irq(struct bio_vec *bvec, unsigned long *flags) +{ + return page_address(bvec->bv_page) + bvec->bv_offset; +} + +static inline void bvec_kunmap_irq(char *buffer, unsigned long *flags) +{ + *flags = 0; +} #endif static inline char *__bio_kmap_irq(struct bio *bio, unsigned short idx,