From: Christoph Hellwig Subject: Re: [PATCH V4 09/16] staging: rtsx: use sg helper to operate scatterlist Date: Mon, 17 Jun 2019 10:27:06 +0200 Message-ID: <20190617082706.GI7455@lst.de> References: <20190617030349.26415-1-ming.lei@redhat.com> <20190617030349.26415-10-ming.lei@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Content-Disposition: inline In-Reply-To: <20190617030349.26415-10-ming.lei@redhat.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: driverdev-devel-bounces@linuxdriverproject.org Sender: "devel" To: Ming Lei Cc: Michael Schmitz , devel@driverdev.osuosl.org, Hannes Reinecke , Benjamin Block , linux-scsi@vger.kernel.org, "Martin K . Petersen" , Greg Kroah-Hartman , linux-usb@vger.kernel.org, James Smart , "Ewan D . Milne" , Jim Gill , James Bottomley , Brian King , Finn Thain , Kim Bradley , "Juergen E . Fischer" , Christoph Hellwig , Dan Carpenter , Bart Van Assche List-Id: linux-scsi@vger.kernel.org On Mon, Jun 17, 2019 at 11:03:42AM +0800, Ming Lei wrote: > Use the scatterlist iterators and remove direct indexing of the > scatterlist array. > > This way allows us to pre-allocate one small scatterlist, which can be > chained with one runtime allocated scatterlist if the pre-allocated one > isn't enough for the whole request. The scatterlist handling here looks completely bogus, it really needs to stop using the index and switch to proper sg_next-based iteration.