[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20220329091827.GY3293@kadam>
Date: Tue, 29 Mar 2022 12:18:27 +0300
From: Dan Carpenter <dan.carpenter@...cle.com>
To: "Fabio M. De Francesco" <fmdefrancesco@...il.com>
Cc: Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Benjamin Philip <benjamin.philip495@...il.com>,
Bart Van Assche <bvanassche@....org>,
"Martin K. Petersen" <martin.petersen@...cle.com>,
"Eric W. Biederman" <ebiederm@...ssion.com>,
Colin Ian King <colin.king@...el.com>,
Samuel Sjöberg <info@...uelsjoberg.se>,
Charlie Sands <sandsch@...thvilleschools.net>,
linux-staging@...ts.linux.dev, linux-kernel@...r.kernel.org,
outreachy@...ts.linux.dev, ira.weiny@...el.com
Subject: Re: [PATCH v2] staging: rts5208: Convert kmap() to kmap_local_page()
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);
> else
> - memcpy(buffer + cnt, ptr + poff, plen);
> - kunmap(page);
> + memcpy_from_page(buffer + cnt, page + poff, 0, plen);
Same.
regards,
dan carpenter
Powered by blists - more mailing lists