OSDN Git Service

net/rds: Pass a pointer to virt_to_page()
authorLinus Walleij <linus.walleij@linaro.org>
Mon, 29 Aug 2022 13:20:01 +0000 (15:20 +0200)
committerJakub Kicinski <kuba@kernel.org>
Thu, 1 Sep 2022 02:12:32 +0000 (19:12 -0700)
commita60511cf15204e41f4edbcdc4ee80208d528917c
tree3f6942004461f61bcda7022c7ffea47b828f1fa6
parent7305b78ae45f2ce19fbb9e83d7a8c45214d2cdc9
net/rds: Pass a pointer to virt_to_page()

Functions that work on a pointer to virtual memory such as
virt_to_pfn() and users of that function such as
virt_to_page() are supposed to pass a pointer to virtual
memory, ideally a (void *) or other pointer. However since
many architectures implement virt_to_pfn() as a macro,
this function becomes polymorphic and accepts both a
(unsigned long) and a (void *).

If we instead implement a proper virt_to_pfn(void *addr)
function the following happens (occurred on arch/arm):

net/rds/message.c:357:56: warning: passing argument 1
  of 'virt_to_pfn' makes pointer from integer without a
  cast [-Wint-conversion]

Fix this with an explicit cast.

Cc: Santosh Shilimkar <santosh.shilimkar@oracle.com>
Cc: rds-devel@oss.oracle.com
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Link: https://lore.kernel.org/r/20220829132001.114858-1-linus.walleij@linaro.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
net/rds/message.c