linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Al Viro <viro@zeniv.linux.org.uk>
To: kernel test robot <lkp@intel.com>
Cc: kbuild-all@lists.01.org, linux-fsdevel@vger.kernel.org
Subject: Re: [vfs:work.epoll 17/27] fs/eventpoll.c:1629:3: warning: Assignment of function parameter has no effect outside the function. Did you forget dereferencing
Date: Mon, 26 Oct 2020 02:35:59 +0000	[thread overview]
Message-ID: <20201026023559.GC3576660@ZenIV.linux.org.uk> (raw)
In-Reply-To: <202010261043.dPTrCpUD-lkp@intel.com>

On Mon, Oct 26, 2020 at 10:09:47AM +0800, kernel test robot wrote:
> tree:   https://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs.git work.epoll
> head:   319c15174757aaedacc89a6e55c965416f130e64
> commit: ff07952aeda8563d5080da3a0754db83ed0650f6 [17/27] ep_send_events_proc(): fold into the caller
> compiler: h8300-linux-gcc (GCC) 9.3.0
> 
> If you fix the issue, kindly add following tag as appropriate
> Reported-by: kernel test robot <lkp@intel.com>
> 
> 
> "cppcheck warnings: (new ones prefixed by >>)"
> >> fs/eventpoll.c:1629:3: warning: Assignment of function parameter has no effect outside the function. Did you forget dereferencing it? [uselessAssignmentPtrArg]
>      events++;
>      ^

Who the hell has come up with that warning?  What happens is,
essentially,

f(..., events, ....)
	loop in which we have
		g(events, something); // store the next sample
		events++;

More specifically, it's 
>   1620			if (__put_user(revents, &events->events) ||
>   1621			    __put_user(epi->event.data, &events->data)) {
>   1622				list_add(&epi->rdllink, &txlist);
>   1623				ep_pm_stay_awake(epi);
>   1624				if (!res)
>   1625					res = -EFAULT;
>   1626				break;
>   1627			}
>   1628			res++;
> > 1629			events++;

If anything, that should be reported to the maintainers of the buggy code.
Which is not the kernel in this case.

Google search on that thing brings this:

	Cppcheck is an analysis tool for C/C++ code. It detects the types of
bugs that the compilers normally fail to detect. The goal is no false positives.

IOW, that should be reported to the authors of that thing, seeing that
their stated goal is obviously missed in this case.  Badly.  Assignments of
function parameters can be perfectly idiomatic and this case is such.

  reply	other threads:[~2020-10-26  3:02 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-26  2:09 [vfs:work.epoll 17/27] fs/eventpoll.c:1629:3: warning: Assignment of function parameter has no effect outside the function. Did you forget dereferencing kernel test robot
2020-10-26  2:35 ` Al Viro [this message]
2020-10-26  9:45   ` [kbuild-all] " Rong Chen

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=20201026023559.GC3576660@ZenIV.linux.org.uk \
    --to=viro@zeniv.linux.org.uk \
    --cc=kbuild-all@lists.01.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=lkp@intel.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;
as well as URLs for NNTP newsgroup(s).