]> git.baikalelectronics.ru Git - kernel.git/commit
[PATCH] libata: fix qc->n_elem == 0 case handling in ata_qc_next_sg
authorTejun Heo <htejun@gmail.com>
Mon, 20 Feb 2006 14:48:38 +0000 (23:48 +0900)
committerJeff Garzik <jgarzik@pobox.com>
Mon, 20 Feb 2006 21:48:18 +0000 (16:48 -0500)
commit3033e7ed930f7724d952fba0080b4c8f3878dc24
tree3d02d3dfef8803fe9130ebac2172b6271b907109
parent5b5417848fa9dfbfee5b58287dd8c18200ca49ef
[PATCH] libata: fix qc->n_elem == 0 case handling in ata_qc_next_sg

This patch makes ata_for_each_sg() start with pad_sgent when
qc->n_elem is zero.  Previously, ata_for_each_sg() unconditionally
started with qc->__sg, handling the first sg to fill_sg() routines
even when the entry was invalid.  And while at it, unwind ?: in
ata_qc_next_sg() into if statement.

Signed-off-by: Tejun Heo <htejun@gmail.com>
Signed-off-by: Jeff Garzik <jgarzik@pobox.com>
include/linux/libata.h