linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: "Chen, Rong A" <rong.a.chen@intel.com>
To: Michal Hocko <mhocko@suse.com>, Julia Lawall <julia.lawall@inria.fr>
Cc: Charan Teja Kalla <quic_charante@quicinc.com>,
	kernel test robot <lkp@intel.com>,
	Minchan Kim <minchan@kernel.org>,
	kbuild-all@lists.01.org, linux-kernel@vger.kernel.org,
	Andrew Morton <akpm@linux-foundation.org>,
	Linux Memory Management List <linux-mm@kvack.org>
Subject: Re: [kbuild-all] Re: mm/madvise.c:1438:6: warning: Redundant assignment of 'ret' to itself. [selfAssignment]
Date: Wed, 22 Jun 2022 10:37:36 +0800	[thread overview]
Message-ID: <0a9d1c96-3a8d-70ee-1490-f65c1b4a6f00@intel.com> (raw)
In-Reply-To: <YrDHFJkwcn5Ga3yy@dhcp22.suse.cz>



On 6/21/2022 3:14 AM, Michal Hocko wrote:
> On Mon 20-06-22 12:54:56, Julia Lawall wrote:
>>
>>
>> On Mon, 20 Jun 2022, Michal Hocko wrote:
>>
>>> On Sat 18-06-22 11:25:43, Charan Teja Kalla wrote:
>>>> Hello Andrew,
>>>>
[...]
>>>>> cppcheck warnings: (new ones prefixed by >>)
>>>>>>> mm/madvise.c:1438:6: warning: Redundant assignment of 'ret' to itself. [selfAssignment]
>>>>>      ret = (total_len - iov_iter_count(&iter)) ? : ret;
>>>>
>>>> Other way to avoid this warning is by creating another local variable
>>>> that holds the total bytes processed. Having another local variable to
>>>> get rid off some compilation warning doesn't seem proper to me. So,
>>>> leaving this warning unless you ask me to fix this.
>>>
>>> Is this a new warning? I do not see it supported by my gcc 10.x. Do we
>>
>> cppcheck is a static analysis tool.  It looks like it doesn't have a
>> proper understanding of ?:
> 
> Ohh, thanks for the clarification! I thought this was a gcc feature.
> Then I would suggest to report a bug report against the static checker
> rather than making any changes to the kernel to workaround it.
> 

Hi all,

Sorry for the inconvenience, we have added the warning to ignore list
to avoid reporting it again.

Best Regards,
Rong Chen


      reply	other threads:[~2022-06-22  2:39 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-17 23:04 kernel test robot
2022-06-18  5:55 ` Charan Teja Kalla
2022-06-20 16:29   ` Michal Hocko
2022-06-20 16:54     ` [kbuild-all] " Julia Lawall
2022-06-20 19:14       ` Michal Hocko
2022-06-22  2:37         ` Chen, Rong A [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=0a9d1c96-3a8d-70ee-1490-f65c1b4a6f00@intel.com \
    --to=rong.a.chen@intel.com \
    --cc=akpm@linux-foundation.org \
    --cc=julia.lawall@inria.fr \
    --cc=kbuild-all@lists.01.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=lkp@intel.com \
    --cc=mhocko@suse.com \
    --cc=minchan@kernel.org \
    --cc=quic_charante@quicinc.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