Received: by 2002:ac0:946b:0:0:0:0:0 with SMTP id j40csp207162imj; Thu, 14 Feb 2019 18:42:02 -0800 (PST) X-Google-Smtp-Source: AHgI3IaumtVFdqpngHRchy+2uuGvNkePeuyZ+MRKCf/zdYnMGyy54ql1OXFHGZzXAWonItOokdMD X-Received: by 2002:aa7:8497:: with SMTP id u23mr7514725pfn.253.1550198522143; Thu, 14 Feb 2019 18:42:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1550198522; cv=none; d=google.com; s=arc-20160816; b=aKpJRPn9CgaqFFSIKhSNXfp5D3zY9OGgEe2/6bxehBOrS/onkWQhsw9FnnNcPRW0Tr 1uiBJCzz+1xCzQMIl2ZBzjdGkYDkFtvbD2CbS0ZeSlrFStVTXHrEpFfGJMNU6DvItMNy 0oooI9ew93beX77NGi7xeq3+moeRAXYb1vsR0spF5ra67CsfonW6aALroSssY01XtYHm YHKLUcVmKecG5XjFQsrdydnFpBobZ8B32pWsbHJZNizc1bhKTrMND0X2QnO03vK3ExTX H9tTKh64E3lqdNia8KIt7smApTFDCwCG8dPo+YlVLP3h/u3K3J4SN+MUqgL8uJyh6c0B 4Oaw== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=4o9BoG34N76NSmXGEL17AV09Q0qswkGASg1OBvo/FOU=; b=KRUoD272Ku2y71MKlDPM/TPvACYRIAdFCJZnT+GmrkIZpcUOJ4A2bozAmsvcITigiN 2+qvV1ooWVTeufjtrGUQXSXcLgJHnbOrX2qb3nYu1K3YYLwvi2Q4uF5LrWjHOC5R1qIP mXT2tLkck72ZzvSExTXCSt4suhLowl67Alom/9201eGM4Q1i46i3MOxV33X2xM4mowPT xHyCdH33DIfWRi8U9mMedInFmHmmUTOMHZqWygLwzfREQ9KLcodEra1uLHiXov/sSUNS cinxCgJLuhoaGFWgJWJI0IjB9v3W753G+r1zxHgTQBq7fFmxAJYDDKGnbueLVBLWv8+Y NF/Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=iC4g+1xm; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t4si3786467pgv.168.2019.02.14.18.41.46; Thu, 14 Feb 2019 18:42:02 -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=iC4g+1xm; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730689AbfBOCkg (ORCPT + 99 others); Thu, 14 Feb 2019 21:40:36 -0500 Received: from mail.kernel.org ([198.145.29.99]:50092 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2389129AbfBOCJ6 (ORCPT ); Thu, 14 Feb 2019 21:09:58 -0500 Received: from sasha-vm.mshome.net (c-73-47-72-35.hsd1.nh.comcast.net [73.47.72.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 11B7D21B68; Fri, 15 Feb 2019 02:09:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1550196597; bh=2K0MItoCg0hnOi1BYWUODwaGFGgRj3BR7iSEEWFpinY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=iC4g+1xmxzH03ZDRZzXYULcbA3CJnN65zv7cYkuso4rL83//V06zPzJAm4w+aKU2U Kb7OflP1mA1KQhRGJsWSKbj+5tac5/bJOK6VhMm2VJQEzH+x0QCqzHlCeyKhodyusN toOjh6dDMAWKuujs/HAx995+/ZUKQSMiRvVoRUnk= From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Nathan Chancellor , Greg Kroah-Hartman , Sasha Levin , devel@driverdev.osuosl.org Subject: [PATCH AUTOSEL 4.20 35/77] staging: rtl8723bs: Fix build error with Clang when inlining is disabled Date: Thu, 14 Feb 2019 21:08:13 -0500 Message-Id: <20190215020855.176727-35-sashal@kernel.org> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20190215020855.176727-1-sashal@kernel.org> References: <20190215020855.176727-1-sashal@kernel.org> MIME-Version: 1.0 X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Nathan Chancellor [ 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 bcc8dfa8e672..9efb4dcb9d3a 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