Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp255198pxb; Mon, 13 Sep 2021 18:30:35 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzCfqQhsn4ENIhk0WYHzTj5nyYO9zifkmbzy3MQvn43mpDtrJ4uNDEzN0M4pZZRMO+wpRX9 X-Received: by 2002:a17:906:368c:: with SMTP id a12mr15997109ejc.143.1631583035679; Mon, 13 Sep 2021 18:30:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631583035; cv=none; d=google.com; s=arc-20160816; b=NAXYQY8LXjEzLI47MXb4r9iK/IUrnSKHfNie/PxRpP778VX4iWZgDUzlesF5ibCG2o mVYVYilDnpJDNSZxOjmC49bQoNhI12/cE9qEp7U7jV1+thqxHkAzGoQO9DwEtQfYJevU eHsTeLEM20cMnCA5iI9rExDaHPpOsLjRrJgxDsyzpbSsfEiCFOdaZScM7ypBFB1qdCZN NC5X7Ymra+UtKO//Td2J/qYXCXGRtdg1Ys652/trln9bSJDLRnhhJwIgmYign936U8e2 Y9g9D0/dISmoEnpl0ET+RB0rsE1CctIF0XUh0kG8GlTSm+2QG9+0uRTg15s/5+V/YVYZ Kpnw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:reply-to:cc:from:to :dkim-signature:date; bh=XX4N+dD43FqDtNWZ+Y9OiIIuX7aACcGRhQqGpdYZRRc=; b=FH1aQFHYWE61iR6FE6vempLM0cN4PuX5KWYoW7o+TeX/owSxkkAw/WkCEYHOtnLqOm 98rrb3Nreq1f+LCSbdaO+OGBLbenzpjqcXWFAbKO/YuUfUgwn1ZjMXF1Kpv+3XF1+5Kl uiUTwwN0nQSf7gzHFnaUSSv9bU6j2uun1+PDkF2BGOdxJtCEAyCufZymSH4Z2cCrjKdG PM9M+Df3bfBbkzGELnYVpD+S1q50R0khux2LQygTelN6/EobGiFVzJ3WEmqhLnSH1cwg gRNMVAwDgxP3B67IuiLtz18RG45dMzmUmHmU0Tom3zMkjBSFYIK4p7dow+1toOAloSy1 o+SA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bryanbrattlof.com header.s=protonmail header.b=pKrFLwsY; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bryanbrattlof.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id d23si8400670eds.175.2021.09.13.18.30.11; Mon, 13 Sep 2021 18:30:35 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@bryanbrattlof.com header.s=protonmail header.b=pKrFLwsY; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bryanbrattlof.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S244458AbhIMXoU (ORCPT + 99 others); Mon, 13 Sep 2021 19:44:20 -0400 Received: from mail-4322.protonmail.ch ([185.70.43.22]:48171 "EHLO mail-4322.protonmail.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236079AbhIMXoT (ORCPT ); Mon, 13 Sep 2021 19:44:19 -0400 Date: Mon, 13 Sep 2021 23:42:55 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bryanbrattlof.com; s=protonmail; t=1631576581; bh=XX4N+dD43FqDtNWZ+Y9OiIIuX7aACcGRhQqGpdYZRRc=; h=Date:To:From:Cc:Reply-To:Subject:In-Reply-To:References:From; b=pKrFLwsYETPNjpMkp9fOZL305a/OS+qI/FiSdeQMtNHU8iDCp+Hs5V7NIK0kV+YDF 0wc++Tds/I61l1DzkdXPzLNXgXARvT+43GE1QvlrEYGWkFr/vP8waaGMAAifuEFUU+ jWhRVHJ7riT1ka+lj3at18KaOWp2fYxSTjIm+/vpWHots9b3zN8HEomwaB6zg64TZl BNXm+zRuziaIFzsBxUeP947KQIkZhxfA6XMJQs4oPQJ6OtiN/AtB25uhmUpFkF7owO OTSkONFRlii0Vf9/4NJBiCYVfyPqNcwJwivWpVk9nsEmYx35xMTfk2yYgYnGQlQlYu XNaRxlK+AtGrQ== To: Greg Kroah-Hartman From: Bryan Brattlof Cc: linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org Reply-To: Bryan Brattlof Subject: Re: [PATCH] staging: rtl8723bs: define wowlan_stub only when CONFIG_PM is enabled Message-ID: <20210913234247.ptqjjbilrtkzc4id@h510> In-Reply-To: References: <20210913140937.1490133-1-hello@bryanbrattlof.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-1.2 required=10.0 tests=ALL_TRUSTED,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF shortcircuit=no autolearn=disabled version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on mailout.protonmail.ch Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On this day, September 13, 2021, thus sayeth Greg Kroah-Hartman: > On Mon, Sep 13, 2021 at 02:10:12PM +0000, Bryan Brattlof wrote: > > The wake-on-lan stub is needed only when the device power management > > functionality is enabled in the kernel. Conditionally define > > wowlan_stub to avoid potential unused object warnings. > > > > Signed-off-by: Bryan Brattlof > > --- > > drivers/staging/rtl8723bs/os_dep/ioctl_cfg80211.c | 2 ++ > > 1 file changed, 2 insertions(+) > > > > diff --git a/drivers/staging/rtl8723bs/os_dep/ioctl_cfg80211.c b/driver= s/staging/rtl8723bs/os_dep/ioctl_cfg80211.c > > index 34da8a569709..f4a9b4b7c97e 100644 > > --- a/drivers/staging/rtl8723bs/os_dep/ioctl_cfg80211.c > > +++ b/drivers/staging/rtl8723bs/os_dep/ioctl_cfg80211.c > > @@ -47,6 +47,7 @@ static const u32 rtw_cipher_suites[] =3D { > > * Moreover wowlan has to be enabled via a the nl80211_set_wowlan call= back. > > * (from user space, e.g. iw phy0 wowlan enable) > > */ > > +#if defined(CONFIG_PM) > > static const struct wiphy_wowlan_support wowlan_stub =3D { > > =09.flags =3D WIPHY_WOWLAN_ANY, > > =09.n_patterns =3D 0, > > @@ -54,6 +55,7 @@ static const struct wiphy_wowlan_support wowlan_stub = =3D { > > =09.pattern_min_len =3D 0, > > =09.max_pkt_offset =3D 0, > > }; > > +#endif > > > > static struct ieee80211_rate rtw_rates[] =3D { > > =09RATETAB_ENT(10, 0x1, 0), > > -- > > 2.30.2 > > > > > > Do you get a build warning with the code as-is? > > Having #if in .c files is generally a bad idea, are you sure there is no > other way to solve this? > Hi Greg, Turns out I should have played with the CONFIG_PM setting more before I sent you this patch. All of this can be ripped out. :) This is the warning I get with staging-next being where it is now: CC [M] drivers/staging/rtl8723bs/os_dep/xmit_linux.o drivers/staging/rtl8723bs/os_dep/ioctl_cfg80211.c:50:42: warning: =E2=80= =98wowlan_stub=E2=80=99 defined but not used [-Wunused-const-variable=3D] 50 | static const struct wiphy_wowlan_support wowlan_stub =3D { | ^~~~~~~~~~~ I'm using tinyconfig plus the rtl8723bs driver and it's dependencies to build a microscopic buildroot image for an Intel Compute Stick I managed to get my hands on recently. I assumed disabling the power management parts of the kernel produced it and didn't think twice. :/ I'll be back with a v2 that rips all of this out. Thanks again Greg, ~Bryan