lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Thu, 30 Apr 2009 08:47:34 +0200
From:	Ingo Molnar <mingo@...e.hu>
To:	KOSAKI Motohiro <kosaki.motohiro@...fujitsu.com>
Cc:	LKML <linux-kernel@...r.kernel.org>,
	Li Zefan <lizf@...fujitsu.com>,
	Steven Rostedt <srostedt@...hat.com>,
	Frederic Weisbecker <fweisbec@...il.com>,
	Jens Axboe <jens.axboe@...cle.com>,
	Arnaldo Carvalho de Melo <acme@...hat.com>
Subject: Re: [PATCH] blktrace: swap arg name "from" and "to" of
	blk_add_trace_remap


* KOSAKI Motohiro <kosaki.motohiro@...fujitsu.com> 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@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ