Received: by 2002:ac0:aed5:0:0:0:0:0 with SMTP id t21csp2282066imb; Mon, 4 Mar 2019 00:41:57 -0800 (PST) X-Google-Smtp-Source: APXvYqy5kkKd0B6RkMhL0kKVcpG6mwhUvejUHd8k/KwqRLKPXEi5jWjH2zo5OlUt9zX8vA+xqDs+ X-Received: by 2002:a17:902:2e81:: with SMTP id r1mr18580472plb.278.1551688917251; Mon, 04 Mar 2019 00:41:57 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1551688917; cv=none; d=google.com; s=arc-20160816; b=UDYsc+FrGVierM1kmwnqtme9XUw+uR7JENYkGRolyBHj9JI9JxRpBre3euktDQ6W1l qFjSonhtdbKUu/Yca62FFj2PcAGhjXF5/4Cn+ncXfTEZvJUa0pdBiannmuzZjquAjikW eHjJQnsqaAa8C1Je46/dZ3K/9rDegQVMQv9B2ZXAI8yUrXsEp6cNU2o9Upgtmd0Z/6xE HuaCqYPyZKdHuMkJcy5guA0TJ1cNt5I4kYIsp8EE+Vcs43mTF/E5/ehGSfj/ZYZD4vnA inEC8O/nRVv2+HoWrJ3kumJVBKq7z8KkweUYsJ/Jviohsnq621QE3qyoPbx43W0Gp2C9 rqCw== 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=ntOHdb42Sm+kfF3LkL/ePUxiDzKpXwMAZp+dVexa64Y=; b=YyAilSXXzDYVsjKlUpksVg3Av6D5VB55JrC7FYTJs6etcps54E7LbdFwq6yLtIlXup Qo/Vcrjn1ZNaqC4+NxEePLuG5rg1TEU9NiEQAc14Wuq4HYtA3XXCt425OjLvqCE+Bj7W HIizY3TDBT6jH0iWXMW5zWYDuZac2jIHIyCNsXczP/c9DZweV8qqD588/ho3LmYofZvO gVtpawjiEasZU+sGQeTc1eCJff26Y/j7otddBol4viIQg6IcirEGCbMapHKF8tujJoT7 lXll1wcWR6O/vCWqRLPnV7cxw0OeeFMLX74eniLhLVKllnper59GPE3Jg/HDK+4LUelK bM1w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=Oh+SD+g8; 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 c4si4750889pgk.353.2019.03.04.00.41.42; Mon, 04 Mar 2019 00:41:57 -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=Oh+SD+g8; 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 S1727866AbfCDIjv (ORCPT + 99 others); Mon, 4 Mar 2019 03:39:51 -0500 Received: from mail.kernel.org ([198.145.29.99]:37880 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727842AbfCDIdW (ORCPT ); Mon, 4 Mar 2019 03:33:22 -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 5806120823; Mon, 4 Mar 2019 08:33:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1551688401; bh=EFko5CZtXZ6xLx1sXQrM9RK9rO9o5ACk7foEUeVkc90=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Oh+SD+g8Mz/hedOmKjDzuDTnBQfYtM1TKUyhCSz0MzuogZuTpNtS4b7/LgjxtvbIW u7D/fRcgRbXFQf3lok+fsU3fhD7hIp9ZulNrd/aLFvkrunopG60BtcPPx2jPzgWLlh HkkKpsfqn8TIzfheM7K5Kf4BjBeyjLMr7bhoou6E= 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.20 33/88] staging: rtl8723bs: Fix build error with Clang when inlining is disabled Date: Mon, 4 Mar 2019 09:22:16 +0100 Message-Id: <20190304081631.904376999@linuxfoundation.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190304081630.610632175@linuxfoundation.org> References: <20190304081630.610632175@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.20-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 bcc8dfa8e6728..9efb4dcb9d3a8 100644 --- a/drivers/staging/rtl8723bs/include/ieee80211.h +++ b/drivers/staging/rtl8723bs/include/ieee80211.h @@ -850,18 +850,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