Received: by 2002:ac0:aed5:0:0:0:0:0 with SMTP id t21csp2284481imb; Mon, 4 Mar 2019 00:47:22 -0800 (PST) X-Google-Smtp-Source: APXvYqyUTGd0wzY4tL9WuDb3/tvdc1WD0ARvee5NkGSwNLb+kl1kbrcZGHhhynkA/ArYUzWv+G81 X-Received: by 2002:a65:47ca:: with SMTP id f10mr17421530pgs.124.1551689242306; Mon, 04 Mar 2019 00:47:22 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1551689242; cv=none; d=google.com; s=arc-20160816; b=bbKVoPU0RFLhSMxCo5eaf4Sl+2qwJHdqQE0pPoEYZcglUGXuvamuHUeoVgBUnoc2MD kgcnl4Jm7YAYRDHwWGSJC4S2g3lfn38MT8revqhJzJVNJ1b+VZCfowdSqDBydCiKkorK 099NxXy7XhQXu09VEP7002L6Nj1HrYYIvSNRCU0usWscSj5dNw42VrM479G8E02OnPbD CZLKVc4qrddKyIPyzWB8BG4U2nBBAbeD2yQ+VVum1+3oRLINJKv0wuuQqO7Fhvi/ZCen 2kpS94N6Rb50lqqUKDYuH5GP7PFR5/lc7iIeKRdYYYcXkdquo354GYV7edEEbT+mV4kQ zd0g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=4rvSI17r1+K/K5jRlz5/23PMHjkW/sA1RFQkTcJSN6E=; b=ly1sDiWA4M9OaF+b24l2oB1yE0kTA/oDYDm2u7kKauFsUUHqtOiOeT3ATqdKLRmzeS EWACjgKfBZwAykXQEvLSX4RoeyIM/Az/Xu8XsE5huQqUt9m97JIb+vmVc0YlGB1sd1LA 2vWy92tzevYI2cPd5x3EKtXfvHBspw0WvoGf69E2o5CVlSxTMjyoPJqj7R24DU9P4uDu cSpUNiQQM07yVwQJ0biPtCqzEwKUNQe4ueir1NsEtUdm8CAfsHif67dYKcR/GRwerwjm 7q9MG6i/PHNRX+lghAnM2yGmsKRPNqkheJDRQDiX+r499gYQlp1xy+0R036w4Vd4J91a UTyg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="aN1h/oMj"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-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 t191si4752678pgd.270.2019.03.04.00.47.07; Mon, 04 Mar 2019 00:47:22 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-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=@kernel.org header.s=default header.b="aN1h/oMj"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726954AbfCDIY7 (ORCPT + 99 others); Mon, 4 Mar 2019 03:24:59 -0500 Received: from mail.kernel.org ([198.145.29.99]:43706 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726384AbfCDIY5 (ORCPT ); Mon, 4 Mar 2019 03:24:57 -0500 Received: from localhost (5356596B.cm-6-7b.dynamic.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id A01DA20823; Mon, 4 Mar 2019 08:24:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1551687897; bh=ghKX10K8mfcCwRX1vm5b186wbDN4iFoS/6H13+Jmmfs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=aN1h/oMjTXCRSKxUruzS0nesd4fQQwlTxygaMEUy+EQUt91Vqve8GPogER8uxWHHX 9eMsGbYgD0xLTzgh9V0h/aJIDzIktM1xyD2pNdrVO8iyQO9p1ycPRLeoLcDIJscU01 nQFp5kn/88hAGvFVU4TTASVKSwfu64Axfzk4Eurs= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Nathan Chancellor , Sasha Levin Subject: [PATCH 4.14 23/52] staging: rtl8723bs: Fix build error with Clang when inlining is disabled Date: Mon, 4 Mar 2019 09:22:21 +0100 Message-Id: <20190304081618.574051840@linuxfoundation.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190304081617.159014799@linuxfoundation.org> References: <20190304081617.159014799@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review X-Patchwork-Hint: ignore MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.14-stable review patch. If anyone has any objections, please let me know. ------------------ [ Upstream commit 97715058b70da1262fd07798c8b2e3e894f759dd ] When CONFIG_NO_AUTO_INLINE was present in linux-next (which added '-fno-inline-functions' to KBUILD_CFLAGS), an allyesconfig build with Clang failed at the modpost stage: ERROR: "is_broadcast_mac_addr" [drivers/staging/rtl8723bs/r8723bs.ko] undefined! ERROR: "is_zero_mac_addr" [drivers/staging/rtl8723bs/r8723bs.ko] undefined! ERROR: "is_multicast_mac_addr" [drivers/staging/rtl8723bs/r8723bs.ko] undefined! These functions were marked as extern inline, meaning that if inlining doesn't happen, the function will be undefined, as it is above. This happens to work with GCC because the '-fno-inline-functions' option respects the __inline attribute so all instances of these functions are inlined as expected and the definition doesn't actually matter. However, with Clang and '-fno-inline-functions', a function has to be marked with the __always_inline attribute to be considered for inlining, which none of these functions are. Clang tries to find the symbol definition elsewhere as it was told and fails, which trickles down to modpost. To make sure that this code compiles regardless of compiler and make the intention of the code clearer, use 'static' to ensure these functions are always defined, regardless of inlining. Additionally, silence a checkpatch warning by switching from '__inline' to 'inline'. Signed-off-by: Nathan Chancellor Signed-off-by: Greg Kroah-Hartman Signed-off-by: Sasha Levin --- drivers/staging/rtl8723bs/include/ieee80211.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/staging/rtl8723bs/include/ieee80211.h b/drivers/staging/rtl8723bs/include/ieee80211.h index 73ce63770c3ce..fa9c80fc77739 100644 --- a/drivers/staging/rtl8723bs/include/ieee80211.h +++ b/drivers/staging/rtl8723bs/include/ieee80211.h @@ -1008,18 +1008,18 @@ enum ieee80211_state { #define IP_FMT "%pI4" #define IP_ARG(x) (x) -extern __inline int is_multicast_mac_addr(const u8 *addr) +static inline int is_multicast_mac_addr(const u8 *addr) { return ((addr[0] != 0xff) && (0x01 & addr[0])); } -extern __inline int is_broadcast_mac_addr(const u8 *addr) +static inline int is_broadcast_mac_addr(const u8 *addr) { return ((addr[0] == 0xff) && (addr[1] == 0xff) && (addr[2] == 0xff) && \ (addr[3] == 0xff) && (addr[4] == 0xff) && (addr[5] == 0xff)); } -extern __inline int is_zero_mac_addr(const u8 *addr) +static inline int is_zero_mac_addr(const u8 *addr) { return ((addr[0] == 0x00) && (addr[1] == 0x00) && (addr[2] == 0x00) && \ (addr[3] == 0x00) && (addr[4] == 0x00) && (addr[5] == 0x00)); -- 2.19.1