Re: [PATCH V4 05/16] scsi: ipr: use sg helper to operate scatterlist

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Jun 17, 2019 at 10:24:23AM +0200, Christoph Hellwig wrote:
> > -	for (i = 0; i < (len / bsize_elem); i++, buffer += bsize_elem) {
> > -		struct page *page = sg_page(&scatterlist[i]);
> > +	for (i = 0; i < (len / bsize_elem); i++, sg = sg_next(sg), buffer += bsize_elem) {
> 
> Please split the overly long line.

Fine.

> 
> > +		struct page *page = sg_page(sg);
> >  
> >  		kaddr = kmap(page);
> >  		memcpy(kaddr, buffer, bsize_elem);
> >  		kunmap(page);
> 
> Not new in this patch, but this is buggy as scatterlists could have
> offsets.  This should probably use the scatterlist.c copy helper
> eventually.

This sglist is allocated by driver, see ipr_copy_ucode_buffer(), so
offset for any element is zero.

Thanks,
Ming
_______________________________________________
devel mailing list
devel@xxxxxxxxxxxxxxxxxxxxxx
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel



[Index of Archives]     [Linux Driver Backports]     [DMA Engine]     [Linux GPIO]     [Linux SPI]     [Video for Linux]     [Linux USB Devel]     [Linux Coverity]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux