Received: by 2002:a05:6512:2355:0:0:0:0 with SMTP id p21csp103663lfu; Thu, 7 Apr 2022 22:11:34 -0700 (PDT) X-Google-Smtp-Source: ABdhPJytx3u5+eLy97nn+QDIIJzBxGm0xQI/O7pead3FL0u1y08QLwm0IjIcqo6Sd6A49f71JSiS X-Received: by 2002:a17:903:183:b0:158:1e89:1191 with SMTP id z3-20020a170903018300b001581e891191mr1174213plg.122.1649394693843; Thu, 07 Apr 2022 22:11:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649394693; cv=none; d=google.com; s=arc-20160816; b=kWY9eiRAISkGeixHd2mBNcdtlsjfPJDW9Wa6LVUh0oSXiLqxAgpRLLaWROkOgsBfxl 0Yg4/ytHDUtV1dGs9P1DPS8X6cS+y2IrCZK0GVAYVMhZwfmwqhQQys8xV1t+8vTWlIgJ KLIkwgdV/3c11A8URORMTseGd7UCiOhHJTiUlgqOmjrapmdd9L8BXkPhD38T1gqiBpJu Vbl1zcpUnD5gWBLg2l9MhWh9nthF5g9FYxcpjCxzTViluahtLCKQagMkpNQvLdmFVO58 dFLLFUi2ygG/gQw0HCGXCiZPELdlgQ9ceCv86/SB49ZseJUQoFAhzRL/0HMH7j5KoUtR jwhw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=VMFaadv7ujq2jUeu1wP3w1khQ+Jtg60cfctxO+6olWg=; b=zM77zJtCjwgdr+Uk2g2UvcL8x2jMoKbdHTMlygtM7Eu7NsD08NihcDFHpvorXJns/S saQ2faEcExcWdHrX0ywiLB5ZrOoJWMXKrBU1AR8Oquhl4Wsxsao9qISZxNc017z2TZwY +uVc6z6Rw+QIvfH0vTwX4DhQQBWIMu4WcN0fL4bA+iB3d4O2fOqYnSsZ24HLkh2IluuD 7NpwRkaV1kt6YXREpuSkApFCEV8gM2E6GR5lN5b4f0w0xex8Z6KB3Y0jBfik6cHh8+fZ RqdpbU3QN5iUrH3rjSq7BN80RGb0rDt7VbCiLsuks43W2wbcHIKCN+mcPDo1E+4/BS19 V8lw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=desiato.20200630 header.b="CY8ir/U7"; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id g3-20020a63b143000000b0039cdd72b9c5si288642pgp.640.2022.04.07.22.11.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 07 Apr 2022 22:11:33 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=desiato.20200630 header.b="CY8ir/U7"; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 88D3D2F7107; Thu, 7 Apr 2022 21:37:45 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234305AbiDHEjk (ORCPT + 99 others); Fri, 8 Apr 2022 00:39:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52596 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234287AbiDHEji (ORCPT ); Fri, 8 Apr 2022 00:39:38 -0400 Received: from desiato.infradead.org (desiato.infradead.org [IPv6:2001:8b0:10b:1:d65d:64ff:fe57:4e05]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 948292F3D08 for ; Thu, 7 Apr 2022 21:37:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=desiato.20200630; h=Content-Transfer-Encoding:Content-Type :In-Reply-To:From:References:Cc:To:Subject:MIME-Version:Date:Message-ID: Sender:Reply-To:Content-ID:Content-Description; bh=VMFaadv7ujq2jUeu1wP3w1khQ+Jtg60cfctxO+6olWg=; b=CY8ir/U7WvFg8b0jLYtNELcwqj CTt4QnTQiCObdGXKrs+7JipEyonsu0At5ngasmvTf9gSeHC/iRpvT7qidmfoMRamBeElOAigkZXnj FzfaAE58OReHWHeCZ74srmqlNK+KcIHmFy8ckliCe3wRCKbZ2INzAuqBqFPVPJ4NwwBZme/XHA9Km 0E9eyKm95pbzQwLeaqOxQqrIlxCEbe4aYmzUEyV0CCpmBwjIEMiOL1LSJv/hNYWhBpmo4L9iIswUQ N/wDwuRklsiIX0qYMxVDRDCbEqt23QLUaCeWQJv62tp/6srk3yt6PSRQyNZvuHvfXIzwoZFxZeuBt 46nYtxzw==; Received: from [2601:1c0:6280:3f0::aa0b] by desiato.infradead.org with esmtpsa (Exim 4.94.2 #2 (Red Hat Linux)) id 1ncgN8-002mWF-0U; Fri, 08 Apr 2022 04:37:22 +0000 Message-ID: Date: Thu, 7 Apr 2022 21:37:16 -0700 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.7.0 Subject: Re: [kbuild-all] Re: drivers/cxl/pci.c:439:7: warning: Local variable 'rc' shadows outer variable [shadowVariable] Content-Language: en-US To: "Chen, Rong A" , 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> <634e887e-4d22-ea90-0ea3-14b9cad9396b@intel.com> From: Randy Dunlap In-Reply-To: <634e887e-4d22-ea90-0ea3-14b9cad9396b@intel.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-4.8 required=5.0 tests=BAYES_00,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/22 20:34, Chen, Rong A wrote: > > > 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 Hi Rong, I downloaded version 2.7 and I can see the warnings now. Thanks! >> >> $ 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. >> -- ~Randy