linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Michal Hocko <mhocko@kernel.org>
To: Weikang Shi <swkhack@gmail.com>
Cc: akpm@linux-foundation.org, alexander.h.duyck@intel.com,
	vbabka@suse.cz, mgorman@suse.de, l.stach@pengutronix.de,
	vdavydov.dev@gmail.com, linux-mm@kvack.org,
	linux-kernel@vger.kernel.org, my_email@gmail.com
Subject: Re: [PATCH] fs: fix local var type
Date: Thu, 23 Aug 2018 13:13:55 +0200	[thread overview]
Message-ID: <20180823111355.GD29735@dhcp22.suse.cz> (raw)
In-Reply-To: <1535014754-31918-1-git-send-email-swkhack@gmail.com>

On Thu 23-08-18 01:59:14, Weikang Shi wrote:
> In the seq_hex_dump function,the remaining variable is int, but it receive a type of size_t argument.
> So I change the type of remaining

The changelog should explain _why_ we need this fix. Is any of the code
path overflowing?

Besides that I do not think this fix is complete. What about linelen?

Why do we even need len to be size_t? Why it cannot be int as well. I
strongly doubt we need more than 32b here.
 
> Signed-off-by: Weikang Shi <swkhack@gmail.com>
> ---
>  fs/seq_file.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/fs/seq_file.c b/fs/seq_file.c
> index 1dea7a8..d0e8bec 100644
> --- a/fs/seq_file.c
> +++ b/fs/seq_file.c
> @@ -847,7 +847,8 @@ void seq_hex_dump(struct seq_file *m, const char *prefix_str, int prefix_type,
>  		  bool ascii)
>  {
>  	const u8 *ptr = buf;
> -	int i, linelen, remaining = len;
> +	int i, linelen;
> +	size_t remaining = len;
>  	char *buffer;
>  	size_t size;
>  	int ret;
> -- 
> 2.7.4
> 

-- 
Michal Hocko
SUSE Labs

  reply	other threads:[~2018-08-23 11:13 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-08-23  8:59 Weikang Shi
2018-08-23 11:13 ` Michal Hocko [this message]
2018-08-23 11:23   ` David Laight
2018-08-23 11:58 ` kbuild test robot
2018-08-24  5:32 ` kbuild test robot

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=20180823111355.GD29735@dhcp22.suse.cz \
    --to=mhocko@kernel.org \
    --cc=akpm@linux-foundation.org \
    --cc=alexander.h.duyck@intel.com \
    --cc=l.stach@pengutronix.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=mgorman@suse.de \
    --cc=my_email@gmail.com \
    --cc=swkhack@gmail.com \
    --cc=vbabka@suse.cz \
    --cc=vdavydov.dev@gmail.com \
    /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