Skip to content

Commit

Permalink
block: Turn bvec_k{un,}map_irq() into static inline functions
Browse files Browse the repository at this point in the history
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
93055c3 ("ps3disk: passing wrong variable =
to
bvec_kunmap_irq()")

Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: Jens Axboe <jaxboe@fusionio.com>
  • Loading branch information
Geert Uytterhoeven authored and Jens Axboe committed Oct 21, 2010
1 parent 7681bfe commit 11a691b
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions include/linux/bio.h
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 11a691b

Please sign in to comment.