Skip to content

Commit

Permalink
powerpc/io: Expect immutable pointer in virt_to_phys() prototype
Browse files Browse the repository at this point in the history
virt_to_phys() doesn't need the address pointer to be mutable.

At the same time allowing it to be mutable leads to the following build
warning for constant pointers:

  warning: passing argument 1 of ‘virt_to_phys’ discards ‘const’ qualifier from pointer target type

Signed-off-by: Stanislav Kinsburskii <stanislav.kinsburskii@gmail.com>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://msgid.link/168155747391.13678.10634415747614468991.stgit@skinsburskii.localdomain
  • Loading branch information
Stanislav Kinsburskii authored and mpe committed Oct 19, 2023
1 parent 6db51ff commit b28d1cc
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion arch/powerpc/include/asm/io.h
Original file line number Diff line number Diff line change
Expand Up @@ -950,7 +950,7 @@ extern void __iomem *__ioremap_caller(phys_addr_t, unsigned long size,
* almost all conceivable cases a device driver should not be using
* this function
*/
static inline unsigned long virt_to_phys(volatile void * address)
static inline unsigned long virt_to_phys(const volatile void * address)
{
WARN_ON(IS_ENABLED(CONFIG_DEBUG_VIRTUAL) && !virt_addr_valid(address));

Expand Down

0 comments on commit b28d1cc

Please sign in to comment.