From patchwork Sun Jan 23 12:39:41 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Sven Eckelmann X-Patchwork-Id: 18454 X-Patchwork-Delegate: sw@simonwunderlich.de Return-Path: X-Original-To: patchwork@open-mesh.org Delivered-To: patchwork@open-mesh.org Received: from diktynna.open-mesh.org (localhost [IPv6:::1]) by diktynna.open-mesh.org (Postfix) with ESMTP id 22ED482521; Sun, 23 Jan 2022 13:39:53 +0100 (CET) Received: from dvalin.narfation.org (dvalin.narfation.org [IPv6:2a00:17d8:100::8b1]) by diktynna.open-mesh.org (Postfix) with ESMTPS id 7D4BF807DD for ; Sun, 23 Jan 2022 13:39:50 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=narfation.org; s=20121; t=1642941589; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=7MjWG2BrKTtJiPqm6l/C8yIAEEx4gmEYww5hVW27ASo=; b=aSe3tUEaut3eU9WkXp4anfKeIfA8guxd4GxmulHGZfGxKvxeGlyhzq5HuZDHC9T0oEfOzi jOSC4zk6AJiWX5wLRaXK9RR3965BwUBZzjFq9lo8It4jqKRjn5MNUcq8RiXqM1C18p+UBW Mpj52GHB4ujzk/xCqdQINa1Wwcaa3x8= From: Sven Eckelmann To: b.a.t.m.a.n@lists.open-mesh.org Cc: Sven Eckelmann Subject: [PATCH] batman-adv: compat: Fix linux/build_bug.h include for Linux 4.9.297 Date: Sun, 23 Jan 2022 13:39:41 +0100 Message-Id: <20220123123941.132618-1-sven@narfation.org> X-Mailer: git-send-email 2.30.2 MIME-Version: 1.0 ARC-Authentication-Results: i=1; diktynna.open-mesh.org; dkim=pass header.d=narfation.org header.s=20121 header.b=aSe3tUEa; dmarc=pass (policy=none) header.from=narfation.org; spf=pass (diktynna.open-mesh.org: domain of sven@narfation.org designates 2a00:17d8:100::8b1 as permitted sender) smtp.mailfrom=sven@narfation.org ARC-Seal: i=1; s=20121; d=open-mesh.org; t=1642941590; a=rsa-sha256; cv=none; b=cFNrNaufLcweEKIhSeIjwbteYj9guX3mQNo0W/rOVwA5MX/PeVeANqDVVzAsRPl7U/7hfT vXPWgmSX8bKwiImvdIQrYLIwPHgPiGW4GrNchUntRUxMqQMrD8RXOV6/4UPTpGHk7YXds2 wpXEWo7fEQmS0RiGTTGAkbBWwKpcv70= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=open-mesh.org; s=20121; t=1642941590; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding:dkim-signature; bh=7MjWG2BrKTtJiPqm6l/C8yIAEEx4gmEYww5hVW27ASo=; b=pu7VC6ilmuyeDmcxjSD+w4uFc3RAhylT3VDVqDsZrDXFwTKlaLT8rJkTz4xOeKp5lEEKGF j79YjBuG0vNNhp8mh6aLljYfB5erPAC4MIDACxZyIePkTXNhjJw6J+t/BHD41HDBNxvlYJ 8gyHzSy2A9vqFtmeW+5sVKivBohgcA0= Message-ID-Hash: WGO4VIL3YE65T77YOAWQDNZ3V7R6QT3P X-Message-ID-Hash: WGO4VIL3YE65T77YOAWQDNZ3V7R6QT3P X-MailFrom: sven@narfation.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-b.a.t.m.a.n.lists.open-mesh.org-0; header-match-b.a.t.m.a.n.lists.open-mesh.org-1; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; suspicious-header X-Mailman-Version: 3.2.1 Precedence: list Reply-To: The list for a Better Approach To Mobile Ad-hoc Networking List-Id: The list for a Better Approach To Mobile Ad-hoc Networking Archived-At: List-Archive: List-Help: List-Post: List-Subscribe: List-Unsubscribe: Linux 4.9.297 doesn't provide BUILD_BUG_ON anymore in linux/bug.h also identified itself with the version number 4.9.255 when decoding the LINUX_VERSION_CODE. So we have to try to guess now if we need to include linux/build_bug.h based on whether BUILD_BUG_ON is defined or not after including linux/bug.h. If not doing this, the build will fail with errors like: net/batman-adv/bat_algo.c:146:1: error: undefined identifier 'BUILD_BUG_ON_ZERO' net/batman-adv/bat_algo.c:146:1: error: undefined identifier 'BUILD_BUG_ON_ZERO' net/batman-adv/bat_algo.c:146:1: error: undefined identifier 'BUILD_BUG_ON_ZERO' net/batman-adv/bat_algo.c:146:1: error: undefined identifier 'BUILD_BUG_ON_ZERO' net/batman-adv/bat_algo.c:146:1: error: undefined identifier 'BUILD_BUG_ON_ZERO' net/batman-adv/bat_algo.c:146:1: error: undefined identifier 'BUILD_BUG_ON_ZERO' In file included from ./arch/x86/include/asm/cpufeatures.h:5, from ./arch/x86/include/asm/cmpxchg.h:5, from ./arch/x86/include/asm/atomic.h:7, from ./include/linux/atomic.h:4, from net/batman-adv/main.h:207, from net/batman-adv/bat_algo.c:7: ./arch/x86/include/asm/qspinlock.h: In function ‘virt_spin_lock’: ./arch/x86/include/asm/required-features.h:104:29: error: implicit declaration of function ‘BUILD_BUG_ON_ZERO’ [-Werror=implicit-function-declaration] Signed-off-by: Sven Eckelmann --- compat-include/linux/build_bug.h | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/compat-include/linux/build_bug.h b/compat-include/linux/build_bug.h index 0eecc688..1002431d 100644 --- a/compat-include/linux/build_bug.h +++ b/compat-include/linux/build_bug.h @@ -15,6 +15,17 @@ #include_next #else #include + +/* Linux 4.9.297 doesn't provide BUILD_BUG_ON anymore in linux/bug.h + * also identified itself with the version number 4.9.255 when decoding the + * LINUX_VERSION_CODE. So we have to try to guess now if we need to include + * linux/build_bug.h based on whether BUILD_BUG_ON is defined or not after + * including linux/bug.h + */ +#ifndef BUILD_BUG_ON +#include_next +#endif + #endif #endif /* _NET_BATMAN_ADV_COMPAT_LINUX_BUILD_BUG_H_ */