MIPS: Fix GCC-4.6 ‘set but not used’ warning in arch/mips/mm/init.c [Linux 2.6.38]

This Linux kernel change "MIPS: Fix GCC-4.6 ‘set but not used’ warning in arch/mips/mm/init.c" is included in the Linux 2.6.38 release. This change is authored by David Daney <ddaney [at] caviumnetworks.com> on Mon Jan 24 14:51:37 2011 -0800. The commit for this change in Linux stable tree is d3ce0e9 (patch).

MIPS: Fix GCC-4.6 'set but not used' warning in arch/mips/mm/init.c

Under some combinations of CONFIG_*, lastpfn in page_is_ram is 'set
but not used'.  Mark it as __maybe_unused to quiet the warning/error.

Signed-off-by: David Daney <[email protected]>
To: [email protected]
Patchwork: https://patchwork.linux-mips.org/patch/2033/
Signed-off-by: Ralf Baechle <[email protected]>

There are 2 lines of Linux source code added/deleted in this change. Code changes to Linux kernel are as follows.

 arch/mips/mm/init.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/mips/mm/init.c b/arch/mips/mm/init.c
index 2efcbd2..279599e 100644
--- a/arch/mips/mm/init.c
+++ b/arch/mips/mm/init.c
@@ -324,7 +324,7 @@ int page_is_ram(unsigned long pagenr)
 void __init paging_init(void)
 {
    unsigned long max_zone_pfns[MAX_NR_ZONES];
-   unsigned long lastpfn;
+   unsigned long lastpfn __maybe_unused;

    pagetable_init();

Leave a Reply

Your email address will not be published. Required fields are marked *