Received: by 2002:a25:b323:0:0:0:0:0 with SMTP id l35csp1802484ybj; Sun, 22 Sep 2019 12:15:17 -0700 (PDT) X-Google-Smtp-Source: APXvYqxflCodpbkYSw32BlvGu5CupCYN4DwwU8CqMFVeIspcs5Ln1TBDZOh+QgvC7GD4cRMwNOIX X-Received: by 2002:a17:906:6445:: with SMTP id l5mr14501418ejn.12.1569179717850; Sun, 22 Sep 2019 12:15:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1569179717; cv=none; d=google.com; s=arc-20160816; b=qDW2XNt8pJirI1i6kpxEJKVufgKjjC8YijVa6CoosVoxuFAAhnWNtvZ/kNnO+hbcOY UUPxtWya10Ov0B8/NNwOFlACkO8Io25qd6yUWbvWxuXVR2AD6lmcVgZE40wap4LMArru 9wzCd2BH2hiFiVcBNANRZF2F9UNKI+ePSQ2wq2nWg4qaUV8Jt6NLJvkMb075uRwcF+aW UU/5V/t5BOz9NuXnWQ27R5MbYwVV28CXzvAnJTDpiHr/M2zmE+pRAbI5iRnsaKQDMWzq EyycDV9fHkOY/uZDPgTyEVEb9lCOjTdZsmoB2hF21IBejg1n2HPGGeEBns24i4LS8hIR 78mg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:message-id :in-reply-to:date:references:subject:cc:to:from:dmarc-filter :dkim-signature:dkim-signature; bh=oqxPOMoc31h6OJumkHYbPL41dqfbxpRWl3eyleLAQSY=; b=vGlQzm/VLM123jYHU4NyK7wcC/M1aN2Y3MknTsamxPuwV7RdHACgsGzNtXUlxr4xFv 4YbnhpwSGjq3cbjwhOhF2DEJggEeO+gpBOCnHEmmMKuU+9bRHTcXT+Zn3FbV2L31Mnpr hxii5MLKYW8n2qkoHLOwIRNGXpZKjdXIFJQYRZ5ksVHXpMf3fenudeyCiqWlrsw1KXp8 ncxN1tmUPmeeVTl3Dl9rbXOPn9wo1Jhud0k1X2uzYN6poadBmPazCXLg5ZzQtbMbdqmo LksL/MyA5butkwZgwUbJMP6NoVRCWaByrLk5FWUb+NVtXPzv/f/TwMyO49xMPjoYgarB YrzQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@codeaurora.org header.s=default header.b=dBuCwvCb; dkim=pass header.i=@codeaurora.org header.s=default header.b=O4ChcviM; spf=pass (google.com: best guess record for domain of linux-wireless-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id jx7si4059783ejb.84.2019.09.22.12.14.53; Sun, 22 Sep 2019 12:15:17 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-wireless-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@codeaurora.org header.s=default header.b=dBuCwvCb; dkim=pass header.i=@codeaurora.org header.s=default header.b=O4ChcviM; spf=pass (google.com: best guess record for domain of linux-wireless-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731099AbfIUHoh (ORCPT + 99 others); Sat, 21 Sep 2019 03:44:37 -0400 Received: from smtp.codeaurora.org ([198.145.29.96]:55612 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731070AbfIUHoh (ORCPT ); Sat, 21 Sep 2019 03:44:37 -0400 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id 3FAB061418; Sat, 21 Sep 2019 07:44:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1569051876; bh=gA8cGjniPi0jJ64mrNJLr1YFpWaOETKiC3O3WaorSWw=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From; b=dBuCwvCbwbCmLyon0bVwz5hqGtg4peC0cIfPwWav4rHAg5Ea4xIjvfsHTj5iNO/Bo nQ7u0VNFvzYQC2SdFZW/hiYpltj/y1jC8MPQoht/idA+gCVGv7osFNnjZB/dTmXNZ2 CddFUv8Eq03LzKTWRmS8JeCIqkOD3Lxo5ur3Q95I= X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on pdx-caf-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.7 required=2.0 tests=ALL_TRUSTED,BAYES_00, DKIM_INVALID,DKIM_SIGNED,SPF_NONE autolearn=no autolearn_force=no version=3.4.0 Received: from x230.qca.qualcomm.com (37-136-106-186.rev.dnainternet.fi [37.136.106.186]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: kvalo@smtp.codeaurora.org) by smtp.codeaurora.org (Postfix) with ESMTPSA id 93B5661197; Sat, 21 Sep 2019 07:44:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1569051875; bh=gA8cGjniPi0jJ64mrNJLr1YFpWaOETKiC3O3WaorSWw=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From; b=O4ChcviMDaRHzsMeoTLDx0iohPpWM9kCm0YWi66r+UfW804FhFBlZKx5DfF0CG1PQ zUQ8DdNoDG12/R6/8l4I5ehZKCALU1MzuJ5P2TmN5vL+g/6l24xldXCeEvu+BuwjYp kz9pUnz0N9sHa87VO2HMlrUaVvzV6RKmvvha6h7w= DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org 93B5661197 Authentication-Results: pdx-caf-mail.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: pdx-caf-mail.web.codeaurora.org; spf=none smtp.mailfrom=kvalo@codeaurora.org From: Kalle Valo To: Larry Finger Cc: linux-wireless@vger.kernel.org, pkshih@realtek.com Subject: Re: [PATCH] rtlwifi: rtl_pci: Fix errors when CONFIG_RTLWIFI_DEBUG is not set References: <20190920022533.23085-1-Larry.Finger@lwfinger.net> Date: Sat, 21 Sep 2019 10:44:31 +0300 In-Reply-To: <20190920022533.23085-1-Larry.Finger@lwfinger.net> (Larry Finger's message of "Thu, 19 Sep 2019 21:25:33 -0500") Message-ID: <87h856ayao.fsf@codeaurora.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org Larry Finger writes: > When rtlwifi debugging is disabled, missing globals occur due to the > attempt execution of code that is never generated. Do you have the exact error message? I don't know why this is failing. > Signed-off-by: Larry Finger > --- > drivers/net/wireless/realtek/rtlwifi/pci.c | 4 ++++ > 1 file changed, 4 insertions(+) > > diff --git a/drivers/net/wireless/realtek/rtlwifi/pci.c b/drivers/net/wireless/realtek/rtlwifi/pci.c > index 6087ec7a90a6..2f8aad28f1c0 100644 > --- a/drivers/net/wireless/realtek/rtlwifi/pci.c > +++ b/drivers/net/wireless/realtek/rtlwifi/pci.c > @@ -2298,8 +2298,10 @@ int rtl_pci_probe(struct pci_dev *pdev, > } > rtlpriv->mac80211.mac80211_registered = 1; > > +#ifdef CONFIG_RTLWIFI_DEBUG > /* add for debug */ > rtl_debug_add_one(hw); > +#endif > > /*init rfkill */ > rtl_init_rfkill(hw); /* Init PCI sw */ > @@ -2349,8 +2351,10 @@ void rtl_pci_disconnect(struct pci_dev *pdev) > wait_for_completion(&rtlpriv->firmware_loading_complete); > clear_bit(RTL_STATUS_INTERFACE_START, &rtlpriv->status); > > +#ifdef CONFIG_RTLWIFI_DEBUG > /* remove form debug */ > rtl_debug_remove_one(hw); > +#endif Then I checked debug.h I see that it's supposed to be handled already: #ifdef CONFIG_RTLWIFI_DEBUG void rtl_debug_add_one(struct ieee80211_hw *hw); void rtl_debug_remove_one(struct ieee80211_hw *hw); void rtl_debugfs_add_topdir(void); void rtl_debugfs_remove_topdir(void); #else #define rtl_debug_add_one(hw) #define rtl_debug_remove_one(hw) #define rtl_debugfs_add_topdir() #define rtl_debugfs_remove_topdir() #endif But the else part looks weird, I'm used to using inline functions instead of defines: static inline void rtl_debug_add_one(struct ieee80211_hw *hw) {} static inline void rtl_debug_remove_one(struct ieee80211_hw *hw) {} static inline void rtl_debugfs_add_topdir(void) {} static inline void rtl_debugfs_remove_topdir(void) {} Inline functions also make it possible for the compiler to check the types are correct. -- Kalle Valo