From: "Fabio M. De Francesco" <fmdefrancesco@gmail.com>
To: Dan Carpenter <dan.carpenter@oracle.com>
Cc: "Greg Kroah-Hartman" <gregkh@linuxfoundation.org>,
"Benjamin Philip" <benjamin.philip495@gmail.com>,
"Bart Van Assche" <bvanassche@acm.org>,
"Martin K. Petersen" <martin.petersen@oracle.com>,
"Eric W. Biederman" <ebiederm@xmission.com>,
"Colin Ian King" <colin.king@intel.com>,
"Samuel Sjöberg" <info@samuelsjoberg.se>,
"Charlie Sands" <sandsch@northvilleschools.net>,
linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org,
outreachy@lists.linux.dev, ira.weiny@intel.com
Subject: Re: [PATCH v2] staging: rts5208: Convert kmap() to kmap_local_page()
Date: Tue, 29 Mar 2022 17:02:54 +0200 [thread overview]
Message-ID: <4055501.1IzOArtZ34@leap> (raw)
In-Reply-To: <20220329091827.GY3293@kadam>
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
>
>
prev parent reply other threads:[~2022-03-29 15:03 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-03-29 5:55 [PATCH v2] staging: rts5208: Convert kmap() to kmap_local_page() Fabio M. De Francesco
2022-03-29 9:18 ` Dan Carpenter
2022-03-29 15:02 ` Fabio M. De Francesco [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4055501.1IzOArtZ34@leap \
--to=fmdefrancesco@gmail.com \
--cc=benjamin.philip495@gmail.com \
--cc=bvanassche@acm.org \
--cc=colin.king@intel.com \
--cc=dan.carpenter@oracle.com \
--cc=ebiederm@xmission.com \
--cc=gregkh@linuxfoundation.org \
--cc=info@samuelsjoberg.se \
--cc=ira.weiny@intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-staging@lists.linux.dev \
--cc=martin.petersen@oracle.com \
--cc=outreachy@lists.linux.dev \
--cc=sandsch@northvilleschools.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox