All of lore.kernel.org
 help / color / mirror / Atom feed
From: walter harms <wharms@bfs.de>
To: askb <askb23@gmail.com>
Cc: linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org
Subject: Re: [PATCH] mm/ksm.c - Fix compile warnings (PS ignore my formatting
Date: Wed, 04 Nov 2009 09:57:54 +0000	[thread overview]
Message-ID: <4AF15022.1020408@bfs.de> (raw)
In-Reply-To: <1257317010.14838.55.camel@linux-k65f.site>



askb schrieb:
> Found the compiler warning on linux-next: 	
> 
> mm/ksm.c: In function ‘ksm_scan_thread’:
> mm/ksm.c:1083: warning: ‘page2[0u]’ may be used uninitialized in this
> function
> mm/ksm.c:1083: note: ‘page2[0u]’ was declared here
> 
> fix for the above warning:
> 
> Signed-off-by: Anil SB <askb23@gmail.com>
> 
> diff --git a/mm/ksm.c b/mm/ksm.c
> index bef1af4..2ea0fd3 100644
> --- a/mm/ksm.c
> +++ b/mm/ksm.c
> @@ -1080,7 +1080,7 @@ static void stable_tree_append(struct rmap_item *rmap_item,
>   */
>  static void cmp_and_merge_page(struct page *page, struct rmap_item *rmap_item)
>  {
> -	struct page *page2[1];
> +	struct page *page2[1] = {NULL};
>  	struct rmap_item *tree_rmap_item;
>  	unsigned int checksum;
>  	int err;
> 
> 

a 1 element array looks strange, did you look what kind of magic is here used ?

re,
 wh


WARNING: multiple messages have this Message-ID (diff)
From: walter harms <wharms@bfs.de>
To: askb <askb23@gmail.com>
Cc: linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org
Subject: Re: [PATCH] mm/ksm.c - Fix compile warnings (PS ignore my formatting in previous email)
Date: Wed, 04 Nov 2009 10:57:54 +0100	[thread overview]
Message-ID: <4AF15022.1020408@bfs.de> (raw)
In-Reply-To: <1257317010.14838.55.camel@linux-k65f.site>



askb schrieb:
> Found the compiler warning on linux-next: 	
> 
> mm/ksm.c: In function ‘ksm_scan_thread’:
> mm/ksm.c:1083: warning: ‘page2[0u]’ may be used uninitialized in this
> function
> mm/ksm.c:1083: note: ‘page2[0u]’ was declared here
> 
> fix for the above warning:
> 
> Signed-off-by: Anil SB <askb23@gmail.com>
> 
> diff --git a/mm/ksm.c b/mm/ksm.c
> index bef1af4..2ea0fd3 100644
> --- a/mm/ksm.c
> +++ b/mm/ksm.c
> @@ -1080,7 +1080,7 @@ static void stable_tree_append(struct rmap_item *rmap_item,
>   */
>  static void cmp_and_merge_page(struct page *page, struct rmap_item *rmap_item)
>  {
> -	struct page *page2[1];
> +	struct page *page2[1] = {NULL};
>  	struct rmap_item *tree_rmap_item;
>  	unsigned int checksum;
>  	int err;
> 
> 

a 1 element array looks strange, did you look what kind of magic is here used ?

re,
 wh


  reply	other threads:[~2009-11-04  9:57 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-11-04  6:43 [PATCH] mm/ksm.c - Fix compile warnings (PS ignore my formatting in previous email) askb
2009-11-04  6:55 ` [PATCH] mm/ksm.c - Fix compile warnings (PS ignore my formatting askb
2009-11-04  9:57 ` walter harms [this message]
2009-11-04  9:57   ` [PATCH] mm/ksm.c - Fix compile warnings (PS ignore my formatting in previous email) walter harms
2009-11-04 11:28   ` askb
2009-11-04 11:40     ` [PATCH] mm/ksm.c - Fix compile warnings (PS ignore my askb
2009-11-09  8:16     ` [PATCH] mm/ksm.c - Fix compile warnings (PS ignore my formatting walter harms
2009-11-09  8:16       ` [PATCH] mm/ksm.c - Fix compile warnings (PS ignore my formatting in previous email) walter harms
2009-11-09 10:51     ` [PATCH] mm/ksm.c - Fix compile warnings (PS ignore my formatting Hugh Dickins
2009-11-09 10:51       ` [PATCH] mm/ksm.c - Fix compile warnings (PS ignore my formatting in previous email) Hugh Dickins
2009-11-09 13:45       ` askb
2009-11-09 13:57         ` [PATCH] mm/ksm.c - Fix compile warnings (PS ignore my askb
2009-11-09 15:54         ` [PATCH] mm/ksm.c - Fix compile warnings (PS ignore my formatting Hugh Dickins
2009-11-09 15:54           ` [PATCH] mm/ksm.c - Fix compile warnings (PS ignore my formatting in previous email) Hugh Dickins

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4AF15022.1020408@bfs.de \
    --to=wharms@bfs.de \
    --cc=askb23@gmail.com \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.