Received: by 2002:a05:6a10:6d25:0:0:0:0 with SMTP id gq37csp1985065pxb; Mon, 13 Sep 2021 09:29:02 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw+2d5NcMJ23K7t9uc/4FrC4+vGF8frz0gIs8klPpHOW3UkVXcmOv8y2LAB11AXH+uZ6L1R X-Received: by 2002:a05:6602:2436:: with SMTP id g22mr10017968iob.109.1631550542235; Mon, 13 Sep 2021 09:29:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631550542; cv=none; d=google.com; s=arc-20160816; b=hJEARoHZIdvdHx4moXSBOhgpiPYyyNTzg//5DBR5aCXCbyqGgH7KP/buF3I6I6TyKj e2GaItiXw+E4J2PGDfyrqY4FV8Mlf0IiutigloykQHLWsk0ZwKIyPbZOexFj6XgQBje7 MqQ4hC7BnRwNLMfC3rcuwtnWEgUQQQM+ARbxHpHEaqMePi1pTsjaN6zd/Y3H6IQ6lj2i w3nRgyNM0Wro9jsrpcqtBwN1pVZFabbeAgSc9050s9uIgpJdDM5JtZsqo24x89tswfsO AG+kOPSVLwXXMIH9fVyu2EmuaotP1Zn3Hp6U5SV690gpsqIz7EwVTLu9fLlD8+gceYn8 B57w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=G2hopjbHuX9aGay2L+knJVrlpUsZpP6jeqC5WlO7Z8Y=; b=KkEMZ5AHhZcR2lqk/xXduhYRSbkQgHbOR0DBvLM9HYyIa7+MLv4rtpheeEQdVwOhI4 IcRL8CObjU2UmE6n9RLkq0Nl4R30P3ScR0yS6+UyF2U2B5Xms6jvyJYswk4spE56z1eo vLFMLUa8hJghcsSXSJn4T/3NpdnO6JI4NjhaHVqZb4BFPatkzRsObqY9igddXhMSfSxV WzREOA1aP1no7dFBiQ34YHOTmXtwuulP/CAU7odHwxDzdenIvODr4lmQo0h28klll1Je q6JogdppUIkKWXsvFl6/QAI/pt9cifThTGIGLh5ib7XAY2ZZ5SqgUfWvsoPi3pMgTIBj NqQA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=Z350u0T1; 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=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id i18si7436075jan.99.2021.09.13.09.28.50; Mon, 13 Sep 2021 09:29:02 -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=@linuxfoundation.org header.s=korg header.b=Z350u0T1; 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=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237503AbhIMQ1P (ORCPT + 99 others); Mon, 13 Sep 2021 12:27:15 -0400 Received: from mail.kernel.org ([198.145.29.99]:57820 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237290AbhIMQ1N (ORCPT ); Mon, 13 Sep 2021 12:27:13 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id A65F86023B; Mon, 13 Sep 2021 16:25:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1631550358; bh=k2gjCgqIRciyyDVHRUfYHy8eLkHaUsw4OJP6DmYTCeo=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=Z350u0T1rMBl/EKHNv9LAI/QocjghKC+Qf2vJce4bbOxLjiKlU1terzrbpBQHluat dg3H0bT13pXwXCI5dGNxJVnONBmm5K68MpdjT6tdGCbGHjXUlhKV+0PHofh4le4NnF jFSPMEy02et4JrWKnET1rBsonSytWZflFLKdxi+4= Date: Mon, 13 Sep 2021 18:25:56 +0200 From: Greg Kroah-Hartman To: Bryan Brattlof Cc: linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org Subject: Re: [PATCH] staging: rtl8723bs: define wowlan_stub only when CONFIG_PM is enabled Message-ID: References: <20210913140937.1490133-1-hello@bryanbrattlof.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210913140937.1490133-1-hello@bryanbrattlof.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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/drivers/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[] = { > * Moreover wowlan has to be enabled via a the nl80211_set_wowlan callback. > * (from user space, e.g. iw phy0 wowlan enable) > */ > +#if defined(CONFIG_PM) > static const struct wiphy_wowlan_support wowlan_stub = { > .flags = WIPHY_WOWLAN_ANY, > .n_patterns = 0, > @@ -54,6 +55,7 @@ static const struct wiphy_wowlan_support wowlan_stub = { > .pattern_min_len = 0, > .max_pkt_offset = 0, > }; > +#endif > > static struct ieee80211_rate rtw_rates[] = { > RATETAB_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? thanks, greg k-h