Skip to content

Commit

Permalink
mips: provide unxlate_dev_mem_ptr() in asm/io.h
Browse files Browse the repository at this point in the history
The unxlate_dev_mem_ptr() function has no prototype on the mips
architecture, which does not include asm-generic/io.h, so gcc warns
about the __weak definition:

drivers/char/mem.c:94:29: error: no previous prototype for 'unxlate_dev_mem_ptr' [-Werror=missing-prototypes]

Since everyone else already gets the generic definition or has a custom
one, there is not really much point in having a __weak version as well.

Remove this one, and instead add a trivial macro to the mips header.
Once we convert mips to use the asm-generic header, this can go away
again.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
  • Loading branch information
Arnd Bergmann authored and Thomas Bogendoerfer committed Jun 9, 2023
1 parent c5e4d83 commit 99b619b
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 7 deletions.
1 change: 1 addition & 0 deletions arch/mips/include/asm/io.h
Original file line number Diff line number Diff line change
Expand Up @@ -554,6 +554,7 @@ extern void (*_dma_cache_inv)(unsigned long start, unsigned long size);
* access
*/
#define xlate_dev_mem_ptr(p) __va(p)
#define unxlate_dev_mem_ptr(p, v) do { } while (0)

void __ioread64_copy(void *to, const void __iomem *from, size_t count);

Expand Down
7 changes: 0 additions & 7 deletions drivers/char/mem.c
Original file line number Diff line number Diff line change
Expand Up @@ -90,13 +90,6 @@ static inline int range_is_allowed(unsigned long pfn, unsigned long size)
}
#endif

#ifndef unxlate_dev_mem_ptr
#define unxlate_dev_mem_ptr unxlate_dev_mem_ptr
void __weak unxlate_dev_mem_ptr(phys_addr_t phys, void *addr)
{
}
#endif

static inline bool should_stop_iteration(void)
{
if (need_resched())
Expand Down

0 comments on commit 99b619b

Please sign in to comment.