Received: by 2002:a05:6a10:83d0:0:0:0:0 with SMTP id o16csp11769pxh; Thu, 7 Apr 2022 21:09:25 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzNGTY7v755dn8x5FeeaLKxOCW7fYGSuWofp387cg7XYX+396SeXG+hbaDRV1yjd4TzXNpv X-Received: by 2002:a17:902:f54a:b0:156:5f53:5f48 with SMTP id h10-20020a170902f54a00b001565f535f48mr17338462plf.29.1649390964796; Thu, 07 Apr 2022 21:09:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649390964; cv=none; d=google.com; s=arc-20160816; b=Lryc1bA3A0QEZJH0KatZBfc7pAcen7ZEiefoKe7QpOS5DD2OHMsBNEQJ7vfM3VFiQ9 GbsKV1fb6VlXFwWolhctJQuBVjdcS7wr/myZn2ss2MKSBK56B+dLVCY5FIqCSkZztlOx PpPUAsYdGJdCb+UIfa44oaeIrSafsH2f6Bwskd0DvUZ4o4dugAAQJEIdQ7HV/d9aP7tC ddIVIxXLkR/3LYYw4YMvv3wYfSbE963zBDvLqAtVvY8/5zS4siShue+Dbto+D34zhEIx yGfoO+WraHzQJf+o5652UFLZGz7+kj6NEahMGLAS4yzqBAoCQNvbYgoYs0qky4PGU2IW gu2Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject:dkim-signature; bh=de3gXk7pr2ShJB1/O3bw/Kg+MQt+mud9PEL3N/BRboA=; b=NX1iuyKpCWWjyot8oa6kqWeBKOTL+4EOfCbV7E3Hhc+hmgYDXiF5eLl95P3RhnNyu1 12RjgkpnXCqFZ6YpDHi65aDhoZOGLiJ50a8H8aPid8jdOvjX19ulasiqBLB296hQn98l +6fAp5QcPkDGvxpoYuR9iODPkcICM7debyBBuNOMb8X4pJaVoiGrs0f43xk+WHc6pj8t pJGkCPevVK7vyC/28ZbQ6Q/VUgve3UMOuqYHSKp+xjyNY+xyVPQMILyba/jRuY27FsaU vB3uwg54E2PSVBgoZuMrkoSxTWswEQjtyRXoU5Nnp3WMQENI0+mRIx5w5X8xxD+SFNyc 2ePQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=Qo6ivHLl; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id c2-20020a170902aa4200b00153b2d16548si1423871plr.336.2022.04.07.21.09.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 07 Apr 2022 21:09:24 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=Qo6ivHLl; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 5489B1DCCCE; Thu, 7 Apr 2022 20:34:36 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231853AbiDHDga (ORCPT + 99 others); Thu, 7 Apr 2022 23:36:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43284 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231675AbiDHDgY (ORCPT ); Thu, 7 Apr 2022 23:36:24 -0400 Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2F27C1DAF80 for ; Thu, 7 Apr 2022 20:34:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1649388862; x=1680924862; h=subject:to:cc:references:from:message-id:date: mime-version:in-reply-to:content-transfer-encoding; bh=aSyvIypGGicAMNQ8lFC8djATk8FWKxMAmHnCSBLhX+Q=; b=Qo6ivHLl04vwx3D+kZG1kU/dU4LbHaOz9OX8uWVme3QuUrkPmGz6Mn0n uWQXo76csytpvZPIe5mSiZ6Wq4wMiX+/CLbU+eGDldf+xxRrBqJarpISG TiP0YZuUMNU5M8P/nI6bpLKkmad5RcUYE/Radeg/PaKOokCu37mWEnWVP wQaBNKDRcZm1v/6Vg4y9Z8eAt8IfNX6NPSA3cwB7LN1AXLykgI2AhE6mA gCDAaZsYBU3Zfe10PjOXHu3TNHornbVs2/VMFK3zMx+zYxn4db8J0eAk5 siXNMQ4dDBDBtw2/xZIE2pFS6Y/ty2diWcipq2S6OAGHdZcAqT2O5/YQI w==; X-IronPort-AV: E=McAfee;i="6400,9594,10310"; a="261192700" X-IronPort-AV: E=Sophos;i="5.90,243,1643702400"; d="scan'208";a="261192700" Received: from orsmga004.jf.intel.com ([10.7.209.38]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Apr 2022 20:34:21 -0700 X-IronPort-AV: E=Sophos;i="5.90,243,1643702400"; d="scan'208";a="659327943" Received: from rongch2-mobl.ccr.corp.intel.com (HELO [10.255.28.94]) ([10.255.28.94]) by orsmga004-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Apr 2022 20:34:19 -0700 Subject: Re: [kbuild-all] Re: drivers/cxl/pci.c:439:7: warning: Local variable 'rc' shadows outer variable [shadowVariable] To: Randy Dunlap , kernel test robot , Ben Widawsky Cc: kbuild-all@lists.01.org, linux-kernel@vger.kernel.org, Dan Williams , Jonathan Cameron References: <202204021950.bTbpM2Gy-lkp@intel.com> <810c4865-45c1-ec93-4f72-2086461756c3@intel.com> From: "Chen, Rong A" Message-ID: <634e887e-4d22-ea90-0ea3-14b9cad9396b@intel.com> Date: Fri, 8 Apr 2022 11:34:18 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Firefox/78.0 Thunderbird/78.12.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-4.8 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,NICE_REPLY_A,RDNS_NONE,SPF_HELO_NONE, T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 4/7/2022 8:11 AM, Randy Dunlap wrote: > > > On 4/6/22 04:17, Chen, Rong A wrote: >> >> >> On 4/4/2022 3:29 AM, Randy Dunlap wrote: >>> Hi lkp/ktr, >>> >>> On 4/2/22 04:26, kernel test robot wrote: >>>> tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master >>>> head:   88e6c0207623874922712e162e25d9dafd39661e >>>> commit: 523e594d9cc03db962c741ce02c8a58aab58a123 cxl/pci: Implement wait for media active >>>> date:   7 weeks ago >>>> compiler: alpha-linux-gcc (GCC) 11.2.0 >>>> >>>> If you fix the issue, kindly add following tag as appropriate >>>> Reported-by: kernel test robot >>>> >>>> >>>> cppcheck warnings: (new ones prefixed by >>) >>>>>> drivers/cxl/pci.c:439:7: warning: Local variable 'rc' shadows outer variable [shadowVariable] >>>>       int rc; >>>>           ^ >>>>     drivers/cxl/pci.c:431:6: note: Shadowed declaration >>>>      int rc, i; >>>>          ^ >>>>     drivers/cxl/pci.c:439:7: note: Shadow variable >>>>       int rc; >>>>           ^ >>>> >>>> cppcheck possible warnings: (new ones prefixed by >>, may not real problems) >>>> >>>>>> drivers/cxl/port.c:63:1: warning: There is an unknown macro here somewhere. Configuration is required. If __stringify is a macro then please configure it. [unknownMacro] >>>>     MODULE_ALIAS_CXL(CXL_DEVICE_PORT); >>>>     ^ >>>> -- >>> >>> Can you provide a cppcheck config file and command line >>> for this, please? >> >> Hi Randy, >> >> The below command can show the warning: >> $ cppcheck --quiet --enable=style,performance,portability --template=gcc drivers/cxl/port.c >> drivers/cxl/port.c:63:1: warning: There is an unknown macro here somewhere. Configuration is required. If __stringify is a macro then please configure it. [unknownMacro] >> MODULE_ALIAS_CXL(CXL_DEVICE_PORT); >> ^ > > Hm, that still shows me nothing. There must be something else. > Maybe it's version-related? I have: Hi Randy, I'm using version 2.3: $ cppcheck --version Cppcheck 2.3 and I can't see the warning too if using Cppcheck 1.86. Best Regards, Rong Chen > > $ cppcheck --version > Cppcheck 1.82 > >> >> Best Regards, >> Rong Chen >> >>> >>> My naive testing does not see any of these warnings -- >>> although I can easily spot the problems in the source file. >>> >>> thanks. > > thanks. >