Received: by 2002:ac0:bc90:0:0:0:0:0 with SMTP id a16csp5640272img; Wed, 27 Mar 2019 12:14:51 -0700 (PDT) X-Google-Smtp-Source: APXvYqwpOOA4TQhYhsTil95EC/4T5W47BxDYjEKEWl1enSTPcYg72m4BI75eNb1CLVaT55z3YFvN X-Received: by 2002:a63:2c3:: with SMTP id 186mr35714437pgc.161.1553714091530; Wed, 27 Mar 2019 12:14:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1553714091; cv=none; d=google.com; s=arc-20160816; b=JT/CEUd4bj1sNFsN0n7rX4eT3N+2iC/hcucOU50/QanA/ZCK2QCPMtUvSsdnrSgoY3 sybuexMuUdtL1fBPljodfIa+thvn4o3295wzhh4AX7qiJvVemEkDSiV68//LEhG4OdBU J9Z1QbuE1khqdpyuM7mO2O9GmITad6X+MwW8zhZpKptrgdUAX2fK1jQ20OS1dLWYgLn/ pr3X/UvaRu1VTBSLx3mFJa3u7tQ/KqxrCn9gvQ1/Dc5e8UKmeipAZDofBlHzCK8zpjok 0n1UA2vCreesczz/N7IGX4rOlVKISq8sfMj9Ehp2WFhU8wy6NIMvYTcQfs8a/sw9vX5o 49BA== 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=2AtbPvQQ27qMXXCKnCBYgUzvgingeUI9ucE5qJ4dbls=; b=nomgcYuDURGf3APZiuhJofO/QkXRcmAlpTBxMitxwqPrr5CptMUuzSfqLuRhOUwqIh GyiBBBQdtrCGjaxt4UC6Il/825w2rnpB+asHWn4XUzl4+0Yyz61TY26xPkkMg0rmQbAN OJrDK9pEUCJEyLhwOMagiqSRN56xVb0oeXaoISzHA+Bhbs5hAWEpIjjZKB+4X4m7G13F Kp9tSN7L51k1PXMcbe1nw+vuJbfqS+a/iO0I0NTUfO0kx299dNDFbQrC+bkM0Oc/Doxc 7akbvhgV2gKUORnh7/NnBPn9bnCsogbA1CcZqxJ+1uP6Ygl746Lp1um5A76bJ2Um3UJa 69lQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=BSTPOeD7; 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 y18si1425166pll.172.2019.03.27.12.14.36; Wed, 27 Mar 2019 12:14:51 -0700 (PDT) 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=BSTPOeD7; 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 S2389270AbfC0TMr (ORCPT + 99 others); Wed, 27 Mar 2019 15:12:47 -0400 Received: from mail.kernel.org ([198.145.29.99]:52322 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388093AbfC0SKV (ORCPT ); Wed, 27 Mar 2019 14:10:21 -0400 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 8726F2147C; Wed, 27 Mar 2019 18:10:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1553710220; bh=E1GN1LeJDi807T8NKXejwTTUECyuEWTycUHjLlB74v0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=BSTPOeD7o0wXhKN138QYr8oSIAtZhE86WKz1DpIdU/JBbV1Zm2nq/uF4CtFVFj83X s9zhTu59YkXLOuwRqNH0dbzSUL5erzc7fLAUSG995HiFJQ6H6bsSVp89I9VIAIqtlH p5oLrmCRPtUSWgj59qYv4KyyFamovC14DDWAwdb0= From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Arnd Bergmann , "David S . Miller" , Sasha Levin , netdev@vger.kernel.org Subject: [PATCH AUTOSEL 5.0 259/262] appletalk: Fix compile regression Date: Wed, 27 Mar 2019 14:01:54 -0400 Message-Id: <20190327180158.10245-259-sashal@kernel.org> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20190327180158.10245-1-sashal@kernel.org> References: <20190327180158.10245-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: Arnd Bergmann [ Upstream commit 27da0d2ef998e222a876c0cec72aa7829a626266 ] A bugfix just broke compilation of appletalk when CONFIG_SYSCTL is disabled: In file included from net/appletalk/ddp.c:65: net/appletalk/ddp.c: In function 'atalk_init': include/linux/atalk.h:164:34: error: expected expression before 'do' #define atalk_register_sysctl() do { } while(0) ^~ net/appletalk/ddp.c:1934:7: note: in expansion of macro 'atalk_register_sysctl' rc = atalk_register_sysctl(); This is easier to avoid by using conventional inline functions as stubs rather than macros. The header already has inline functions for other purposes, so I'm changing over all the macros for consistency. Fixes: 6377f787aeb9 ("appletalk: Fix use-after-free in atalk_proc_exit") Signed-off-by: Arnd Bergmann Signed-off-by: David S. Miller Signed-off-by: Sasha Levin --- include/linux/atalk.h | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/include/linux/atalk.h b/include/linux/atalk.h index 23f805562f4e..840cf92307ba 100644 --- a/include/linux/atalk.h +++ b/include/linux/atalk.h @@ -161,16 +161,26 @@ extern int sysctl_aarp_resolve_time; extern void atalk_register_sysctl(void); extern void atalk_unregister_sysctl(void); #else -#define atalk_register_sysctl() do { } while(0) -#define atalk_unregister_sysctl() do { } while(0) +static inline int atalk_register_sysctl(void) +{ + return 0; +} +static inline void atalk_unregister_sysctl(void) +{ +} #endif #ifdef CONFIG_PROC_FS extern int atalk_proc_init(void); extern void atalk_proc_exit(void); #else -#define atalk_proc_init() ({ 0; }) -#define atalk_proc_exit() do { } while(0) +static inline int atalk_proc_init(void) +{ + return 0; +} +static inline void atalk_proc_exit(void) +{ +} #endif /* CONFIG_PROC_FS */ #endif /* __LINUX_ATALK_H__ */ -- 2.19.1