From: Michal Hocko <mhocko@suse.cz>
To: "Kirill A. Shutemov" <kirill.shutemov@linux.intel.com>
Cc: Andrew Morton <akpm@linux-foundation.org>,
linux-mm@kvack.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] memcg: fix static checker warning
Date: Mon, 26 Jan 2015 14:37:33 +0100 [thread overview]
Message-ID: <20150126133733.GA22689@dhcp22.suse.cz> (raw)
In-Reply-To: <1422276248-40456-1-git-send-email-kirill.shutemov@linux.intel.com>
On Mon 26-01-15 14:44:08, Kirill A. Shutemov wrote:
> The patch "mm: remove rest usage of VM_NONLINEAR and pte_file()" from
> Jan 17, 2015, leads to the following static checker warning:
>
> mm/memcontrol.c:4794 mc_handle_file_pte()
> warn: passing uninitialized 'pgoff'
>
> After the patch, the only case when mc_handle_file_pte() called is
> pte_none(ptent). The 'if' check is redundant and lead to the warning.
> Let's drop it.
>
> Signed-off-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
> Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Acked-by: Michal Hocko <mhocko@suse.cz>
> ---
> mm/memcontrol.c | 3 +--
> 1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/mm/memcontrol.c b/mm/memcontrol.c
> index cd42f14d138a..a6140c0764f4 100644
> --- a/mm/memcontrol.c
> +++ b/mm/memcontrol.c
> @@ -4792,8 +4792,7 @@ static struct page *mc_handle_file_pte(struct vm_area_struct *vma,
> return NULL;
>
> mapping = vma->vm_file->f_mapping;
> - if (pte_none(ptent))
> - pgoff = linear_page_index(vma, addr);
> + pgoff = linear_page_index(vma, addr);
>
> /* page is moved even if it's not RSS of this task(page-faulted). */
> #ifdef CONFIG_SWAP
> --
> 2.1.4
>
> --
> To unsubscribe, send a message with 'unsubscribe linux-mm' in
> the body to majordomo@kvack.org. For more info on Linux MM,
> see: http://www.linux-mm.org/ .
> Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
--
Michal Hocko
SUSE Labs
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
prev parent reply other threads:[~2015-01-26 13:37 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-01-26 12:44 [PATCH] memcg: fix static checker warning Kirill A. Shutemov
2015-01-26 13:37 ` Michal Hocko [this message]
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=20150126133733.GA22689@dhcp22.suse.cz \
--to=mhocko@suse.cz \
--cc=akpm@linux-foundation.org \
--cc=kirill.shutemov@linux.intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).