Re: [PATCH] blktrace: swap arg name "from" and "to" ofblk_add_trace_remap

From: Ingo Molnar
Date: Thu Apr 30 2009 - 02:48:09 EST



* KOSAKI Motohiro <kosaki.motohiro@xxxxxxxxxxxxxx> wrote:

>
> Subject: [PATCH] blktrace: swap arg name "from" and "to" of blk_add_trace_remap
>
> Impact: cleanup for improve readability
>
> Currently, blk_add_trace_remap has following prototype.
>
> static void blk_add_trace_remap(struct request_queue *q, struct bio *bio,
> dev_t dev, sector_t from, sector_t to)
>
> but caller pass "from" secter as 4th arg, "to" sector as 5th arg.
>
> example,
> --------------------------------------------------------
> static inline void blk_partition_remap(struct bio *bio)
> {
> struct block_device *bdev = bio->bi_bdev;
>
> if (bio_sectors(bio) && bdev != bdev->bd_contains) {
> struct hd_struct *p = bdev->bd_part;
>
> bio->bi_sector += p->start_sect;
> bio->bi_bdev = bdev->bd_contains;
>
> trace_block_remap(bdev_get_queue(bio->bi_bdev), bio,
> bdev->bd_dev, bio->bi_sector,
> bio->bi_sector - p->start_sect);
> }
> }
> --------------------------------------------------------
>
> Oh my god, it's reverse order.
> Fortunately, print logic reverse again. the twice reversing hide problem.

heh ... well spotted.

> but, but...
> It repeatedly confuse reviewer (include me!).
> Then, swapping argment name is better.

Agreed. Li, Jens, what do you think?

Ingo
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/