Re: [PATCH v2] staging: rts5208: Convert kmap() to kmap_local_page()

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

 



On marted? 29 marzo 2022 11:18:27 CEST Dan Carpenter wrote:
> On Tue, Mar 29, 2022 at 07:55:39AM +0200, Fabio M. De Francesco wrote:
> > diff --git a/drivers/staging/rts5208/rtsx_transport.c b/drivers/staging/rts5208/rtsx_transport.c
> > index 805dc18fac0a..56b6cc845619 100644
> > --- a/drivers/staging/rts5208/rtsx_transport.c
> > +++ b/drivers/staging/rts5208/rtsx_transport.c
> > @@ -92,13 +92,11 @@ unsigned int rtsx_stor_access_xfer_buf(unsigned char *buffer,
> >  			while (sglen > 0) {
> >  				unsigned int plen = min(sglen, (unsigned int)
> >  						PAGE_SIZE - poff);
> > -				unsigned char *ptr = kmap(page);
> >  
> >  				if (dir == TO_XFER_BUF)
> > -					memcpy(ptr + poff, buffer + cnt, plen);
> > +					memcpy_to_page(page + poff, 0, buffer + cnt, plen);
> 
> You meant:
> 
> 	memcpy_to_page(page, poff, buffer + cnt, plen);
> 

Yes, correct. I meant exactly what you wrote.

It's the first time that I use these API and, after 30 seconds look at their 
prototypes, I thought that either have the same semantics.

I don't yet know if I'm wrong. However, even if either were correct, yours 
would be more consistent and elegant. Therefore, I am going to change these
calls and submit a v3.

Thanks for your review,

Fabio M. De Francesco

> >  				else
> > -					memcpy(buffer + cnt, ptr + poff, plen);
> > -				kunmap(page);
> > +					memcpy_from_page(buffer + cnt, page + poff, 0, plen);
> 
> Same.
> 
> regards,
> dan carpenter
> 
> 








[Index of Archives]     [Linux Driver Development]     [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