From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0908AC43334 for ; Sat, 18 Jun 2022 05:55:54 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 797206B0071; Sat, 18 Jun 2022 01:55:54 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 7468B6B0072; Sat, 18 Jun 2022 01:55:54 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 60E3A6B0073; Sat, 18 Jun 2022 01:55:54 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0014.hostedemail.com [216.40.44.14]) by kanga.kvack.org (Postfix) with ESMTP id 5205B6B0071 for ; Sat, 18 Jun 2022 01:55:54 -0400 (EDT) Received: from smtpin02.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay13.hostedemail.com (Postfix) with ESMTP id 2630760BC6 for ; Sat, 18 Jun 2022 05:55:54 +0000 (UTC) X-FDA: 79590295428.02.8DEFADF Received: from alexa-out-sd-02.qualcomm.com (alexa-out-sd-02.qualcomm.com [199.106.114.39]) by imf23.hostedemail.com (Postfix) with ESMTP id 42A5114008F for ; Sat, 18 Jun 2022 05:55:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; i=@quicinc.com; q=dns/txt; s=qcdkim; t=1655531753; x=1687067753; h=message-id:date:mime-version:subject:to:cc:references: from:in-reply-to:content-transfer-encoding; bh=FDvypuKshD2tJX7p4O/SIVh6mhDa1g35QqNCGSIqRG0=; b=VNsg5QEd56pWRgdsQsSlyMuwqhQEi1cpYNwloyZjBdZMlDjwmecHP3sV +flmosTpYE2H5RKqQS3sLKWSgFRMnw+htWIVKl8NyNCXq7yWic+fWeH4R JC86zGQqruy+I+1+BTXcZElXTTnZ85qCQ+o+0sfr42ir+uK+Ud5H+lFEw E=; Received: from unknown (HELO ironmsg05-sd.qualcomm.com) ([10.53.140.145]) by alexa-out-sd-02.qualcomm.com with ESMTP; 17 Jun 2022 22:55:51 -0700 X-QCInternal: smtphost Received: from nasanex01c.na.qualcomm.com ([10.47.97.222]) by ironmsg05-sd.qualcomm.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 17 Jun 2022 22:55:51 -0700 Received: from nalasex01a.na.qualcomm.com (10.47.209.196) by nasanex01c.na.qualcomm.com (10.47.97.222) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.22; Fri, 17 Jun 2022 22:55:51 -0700 Received: from [10.216.6.110] (10.80.80.8) by nalasex01a.na.qualcomm.com (10.47.209.196) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.22; Fri, 17 Jun 2022 22:55:48 -0700 Message-ID: <5ec7b561-551b-f02a-9b7b-65d05ccdabbc@quicinc.com> Date: Sat, 18 Jun 2022 11:25:43 +0530 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.9.1 Subject: Re: mm/madvise.c:1438:6: warning: Redundant assignment of 'ret' to itself. [selfAssignment] Content-Language: en-US To: kernel test robot , Michal Hocko , "Minchan Kim" CC: , , Andrew Morton , Linux Memory Management List References: <202206180617.UzO7ymnD-lkp@intel.com> From: Charan Teja Kalla In-Reply-To: <202206180617.UzO7ymnD-lkp@intel.com> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Originating-IP: [10.80.80.8] X-ClientProxiedBy: nasanex01b.na.qualcomm.com (10.46.141.250) To nalasex01a.na.qualcomm.com (10.47.209.196) ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1655531753; a=rsa-sha256; cv=none; b=UaBCA+QDqV4letEQQP3jREajE7iEkXLJhEseDDCVCieUnztCiJGJWbo+7K+es1VUUZ8OxB Jh9t1T3E/uQcHR74hV6gayw5Rf+nrju5e3U4eWySpT9FiOvimC2Q1twRpj9g39ZFso2ZAs 9plE1A13ovn7cTnsLEy2EJq8e+jD2N8= ARC-Authentication-Results: i=1; imf23.hostedemail.com; dkim=pass header.d=quicinc.com header.s=qcdkim header.b=VNsg5QEd; dmarc=pass (policy=none) header.from=quicinc.com; spf=pass (imf23.hostedemail.com: domain of quic_charante@quicinc.com designates 199.106.114.39 as permitted sender) smtp.mailfrom=quic_charante@quicinc.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1655531753; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=FDvypuKshD2tJX7p4O/SIVh6mhDa1g35QqNCGSIqRG0=; b=vtoJSWH9ddxGU1fPwz3EqBYZnLCouj7dMzftG+++Ir0NsL9MZ/RLfmMXuZay0U4fTGmc7V JHJ17YaYZFGF8BLvP+zUQVri/O7W0vEa6N1NoSfCBfop++02zklExBZAbxcxvR4VkKnI6v HdXDkQmIktGNzsrL5YAtM8BCIC7gYek= Authentication-Results: imf23.hostedemail.com; dkim=pass header.d=quicinc.com header.s=qcdkim header.b=VNsg5QEd; dmarc=pass (policy=none) header.from=quicinc.com; spf=pass (imf23.hostedemail.com: domain of quic_charante@quicinc.com designates 199.106.114.39 as permitted sender) smtp.mailfrom=quic_charante@quicinc.com X-Rspam-User: X-Stat-Signature: ede7nphjxdh6zkygit99zysbgsrny34h X-Rspamd-Queue-Id: 42A5114008F X-Rspamd-Server: rspam08 X-HE-Tag: 1655531753-945739 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000001, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: Hello Andrew, On 6/18/2022 4:34 AM, kernel test robot wrote: > tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master > head: 4b35035bcf80ddb47c0112c4fbd84a63a2836a18 > commit: 5bd009c7c9a9e888077c07535dc0c70aeab242c3 mm: madvise: return correct bytes advised with process_madvise > date: 3 months ago > compiler: mips-linux-gcc (GCC) 11.3.0 > reproduce (cppcheck warning): > # apt-get install cppcheck > git checkout 5bd009c7c9a9e888077c07535dc0c70aeab242c3 > cppcheck --quiet --enable=style,performance,portability --template=gcc FILE > > If you fix the issue, kindly add following tag where applicable > Reported-by: kernel test robot > > > 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. Thanks, Charan