cassini: Use page_address() instead of kmap_atomic()
authorAnirudh Venkataramanan <anirudh.venkataramanan@intel.com>
Wed, 23 Nov 2022 20:52:16 +0000 (12:52 -0800)
committerDavid S. Miller <davem@davemloft.net>
Fri, 25 Nov 2022 10:44:01 +0000 (10:44 +0000)
commitc191445874bba16a636a88fc4afc7c3ab09228fd
tree5f5cc756b7aff6261a8d2dbaf9f065c913da9ce4
parentf61e6d3ca4dac83d7093e7be7ceabce95e738e68
cassini: Use page_address() instead of kmap_atomic()

Pages for Rx buffers are allocated in cas_page_alloc() using either
GFP_ATOMIC or GFP_KERNEL. Memory allocated with GFP_KERNEL/GFP_ATOMIC can't
come from highmem and so there's no need to kmap() them. Just use
page_address() instead. This makes the variable 'addr' unnecessary, so
remove it too.

Note that kmap_atomic() disables preemption and page-fault processing,
but page_address() doesn't. When removing uses of kmap_atomic(), one has to
check if the code being executed between the map/unmap implicitly depends
on page-faults and/or preemption being disabled. If yes, then code to
disable page-faults and/or preemption should also be added for functional
correctness. That however doesn't appear to be the case here, so just
page_address() is used.

I don't have hardware, so this change has only been compile tested.

Cc: Ira Weiny <ira.weiny@intel.com>
Cc: Fabio M. De Francesco <fmdefrancesco@gmail.com>
Signed-off-by: Anirudh Venkataramanan <anirudh.venkataramanan@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/sun/cassini.c