linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2] xen:  Convert kmap() to kmap_local_page()
@ 2022-04-19 23:43 Alaa Mohamed
  2022-04-20  6:03 ` Julia Lawall
  2022-04-21 21:15 ` Boris Ostrovsky
  0 siblings, 2 replies; 11+ messages in thread
From: Alaa Mohamed @ 2022-04-19 23:43 UTC (permalink / raw)
  To: outreachy
  Cc: boris.ostrovsky, jgross, sstabellini, xen-devel, linux-kernel,
	ira.weiny, eng.alaamohamedsoliman.am

kmap() is being deprecated and these usages are all local to the thread
so there is no reason kmap_local_page() can't be used.

Replace kmap() calls with kmap_local_page().

Signed-off-by: Alaa Mohamed <eng.alaamohamedsoliman.am@gmail.com>
---
changes in V2:
	-edit commit subject
	-edit commit message
---
 drivers/xen/gntalloc.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/xen/gntalloc.c b/drivers/xen/gntalloc.c
index 4849f94372a4..55acb32842a3 100644
--- a/drivers/xen/gntalloc.c
+++ b/drivers/xen/gntalloc.c
@@ -178,9 +178,9 @@ static void __del_gref(struct gntalloc_gref *gref)
 	unsigned long addr;
 
 	if (gref->notify.flags & UNMAP_NOTIFY_CLEAR_BYTE) {
-		uint8_t *tmp = kmap(gref->page);
+		uint8_t *tmp = kmap_local_page(gref->page);
 		tmp[gref->notify.pgoff] = 0;
-		kunmap(gref->page);
+		kunmap_local(tmp);
 	}
 	if (gref->notify.flags & UNMAP_NOTIFY_SEND_EVENT) {
 		notify_remote_via_evtchn(gref->notify.event);
-- 
2.35.2


^ permalink raw reply related	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2022-04-25 15:35 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-04-19 23:43 [PATCH v2] xen: Convert kmap() to kmap_local_page() Alaa Mohamed
2022-04-20  6:03 ` Julia Lawall
2022-04-20 13:22   ` Fabio M. De Francesco
2022-04-20 13:28     ` Julia Lawall
2022-04-20 13:40     ` Julia Lawall
2022-04-20 13:55       ` Fabio M. De Francesco
2022-04-20 13:57         ` Julia Lawall
2022-04-20 14:07           ` Fabio M. De Francesco
2022-04-25 15:29             ` Ira Weiny
2022-04-25 15:34               ` Julia Lawall
2022-04-21 21:15 ` Boris Ostrovsky

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).