lkml.org 
[lkml]   [2009]   [Nov]   [4]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH] mm/ksm.c - Fix compile warnings (PS ignore my formatting in previous email)
From
Date
On Wed, 2009-11-04 at 10:57 +0100, walter harms wrote:
>
> 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 ?
>
>From my understanding, it is used for place holder to check and return
an identical page from stable_tree_search(). Can we do with a double
indirection to struct page instead of the above?
PS point me in the right direction.

Regards.

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

\
 
 \ /
  Last update: 2009-11-04 12:33    [W:0.060 / U:0.244 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site