lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <51A63E51.2060202@cogentembedded.com>
Date:	Wed, 29 May 2013 21:43:45 +0400
From:	Sergei Shtylyov <sergei.shtylyov@...entembedded.com>
To:	Jiang Liu <liuj97@...il.com>
CC:	Andrew Morton <akpm@...ux-foundation.org>,
	Jiang Liu <jiang.liu@...wei.com>,
	David Rientjes <rientjes@...gle.com>,
	Wen Congyang <wency@...fujitsu.com>,
	Mel Gorman <mgorman@...e.de>, Minchan Kim <minchan@...nel.org>,
	KAMEZAWA Hiroyuki <kamezawa.hiroyu@...fujitsu.com>,
	Michal Hocko <mhocko@...e.cz>,
	James Bottomley <James.Bottomley@...senPartnership.com>,
	David Howells <dhowells@...hat.com>,
	Mark Salter <msalter@...hat.com>,
	Jianguo Wu <wujianguo@...wei.com>, linux-mm@...ck.org,
	linux-arch@...r.kernel.org, linux-kernel@...r.kernel.org,
	Geert Uytterhoeven <geert@...ux-m68k.org>,
	Greg Ungerer <gerg@...inux.org>,
	Thadeu Lima de Souza Cascardo <cascardo@...oscopio.com>,
	linux-m68k@...ts.linux-m68k.org
Subject: Re: [PATCH, v2 13/13] mm/m68k: fix build warning of unused variable

Hello.

On 05/29/2013 06:44 PM, Jiang Liu wrote:

> Fix build warning of unused variable:
> arch/m68k/mm/init.c: In function 'mem_init':
> arch/m68k/mm/init.c:151:6: warning: unused variable 'i' [-Wunused-variable]
>
> Signed-off-by: Jiang Liu <jiang.liu@...wei.com>
> Cc: Geert Uytterhoeven <geert@...ux-m68k.org>
> Cc: Greg Ungerer <gerg@...inux.org>
> Cc: Thadeu Lima de Souza Cascardo <cascardo@...oscopio.com>
> Cc: linux-m68k@...ts.linux-m68k.org
> Cc: linux-kernel@...r.kernel.org
> ---
>   arch/m68k/mm/init.c | 13 ++++++++-----
>   1 file changed, 8 insertions(+), 5 deletions(-)
>
> diff --git a/arch/m68k/mm/init.c b/arch/m68k/mm/init.c
> index 6e0a938..6b4baa6 100644
> --- a/arch/m68k/mm/init.c
> +++ b/arch/m68k/mm/init.c
> @@ -146,14 +146,11 @@ void __init print_memmap(void)
>   		MLK_ROUNDUP(__bss_start, __bss_stop));
>   }
>   
> -void __init mem_init(void)
> +static inline void init_pointer_tables(void)
>   {
> +#if defined(CONFIG_MMU) && !defined(CONFIG_SUN3) && !defined(CONFIG_COLDFIRE)

    #ifdef's in the function bodies are frowned upon, this should better be:

#if defined(CONFIG_MMU) && !defined(CONFIG_SUN3) && !defined(CONFIG_COLDFIRE)

static inline void init_pointer_tables(void)
{
[...]
}
#else
static inline void init_pointer_tables(void) {}
#endif

>   	int i;
>   
> -	/* this will put all memory onto the freelists */
> -	free_all_bootmem();
> -
> -#if defined(CONFIG_MMU) && !defined(CONFIG_SUN3) && !defined(CONFIG_COLDFIRE)
>   	/* insert pointer tables allocated so far into the tablelist */
>   	init_pointer_table((unsigned long)kernel_pg_dir);
>   	for (i = 0; i < PTRS_PER_PGD; i++) {
> @@ -165,7 +162,13 @@ void __init mem_init(void)
>   	if (zero_pgtable)
>   		init_pointer_table((unsigned long)zero_pgtable);
>   #endif
> +}
>   
> +void __init mem_init(void)
> +{
> +	/* this will put all memory onto the freelists */
> +	free_all_bootmem();
> +	init_pointer_tables();
>   	mem_init_print_info(NULL);
>   	print_memmap();
>   }

WBR, Sergei

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ