From patchwork Tue Mar 5 13:24:21 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 159647 Delivered-To: patch@linaro.org Received: by 2002:a02:5cc1:0:0:0:0:0 with SMTP id w62csp4967074jad; Tue, 5 Mar 2019 05:24:52 -0800 (PST) X-Google-Smtp-Source: APXvYqw5jzCe+lNH91uTlqp/RZg4OArrwuzarOXH2bmkZgT4JX3wkouPreANZ4T3KnHbdS1oBSsC X-Received: by 2002:a17:902:d90d:: with SMTP id c13mr1175311plz.42.1551792292698; Tue, 05 Mar 2019 05:24:52 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1551792292; cv=none; d=google.com; s=arc-20160816; b=wxoYp9R7VlCuZ3FHlsVJM3gHXfNIyV/3YZ27qYeEl4TnUbxgYCOVjXLfCIIWmIkJgg yIVVrjwasNNUn9ARjhaUJZyVYSHNkSSeiumxK1Cw+UFGEX69+EzqlYgqsgwD13uy3504 QpxilZFB3wfZXs/+VMZuMZeMJaMqxHGyk36ti8JPjtqaVWR8aSKC2W7YpIiVu8IIxhRC i3xfxWBHFJeKJUXvVkSyw240qRN3qUhlqhc416c+I5q/7f3vBeDbZFj0hTagGzoX4vdY UNOqYcv1SZXG3lTpCQOlgJAJPyS2rfl/8r9ICfyQ7HLmGige3A0mok4IzVaoq8bXf2kZ 6MPg== 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 :message-id:date:subject:cc:to:from; bh=u32sBFkIHiVJKIag8l/sCKY/5h0/4Ki+dQVeDlghGnU=; b=KimvdV+FjRMBHEIkYEQ8cp2ysNTSYye/mUzw0fqbozht8HzhXhtC6TQHKC9/t5JISX 473F3nOP0Eduw30xvWkag00UBqjx9OSEe0hElm7LWL9wu2cpx2N3KER+BKODbbxEr7RE MXT7mZ7y14/FjfpudwmYU/cFGeBfhHMvSNmkdvxuQuoUNh2RtGEssmthW2k/FJVOBmTx huXL5Q4SRU0a4FcKnawpsG1Rey6WTJ2pmcde1oEvuuErMPa8YHHIKogygug6PDCX8SO3 l7uXbMj/XDpcCTDGufT1wCfCFk8tmITcjvblSmBJMWnaAcvZRGaRqvJjG6yr2kH6tCOi 49SA== ARC-Authentication-Results: i=1; mx.google.com; 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 f34si8409700ple.279.2019.03.05.05.24.52; Tue, 05 Mar 2019 05:24:52 -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; 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 S1728386AbfCENYu (ORCPT + 31 others); Tue, 5 Mar 2019 08:24:50 -0500 Received: from mout.kundenserver.de ([212.227.17.24]:47469 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727026AbfCENYt (ORCPT ); Tue, 5 Mar 2019 08:24:49 -0500 Received: from wuerfel.lan ([109.192.41.194]) by mrelayeu.kundenserver.de (mreue107 [212.227.15.145]) with ESMTPA (Nemesis) id 1MmU1H-1hRwEj2jjN-00iWp7; Tue, 05 Mar 2019 14:24:32 +0100 From: Arnd Bergmann To: YueHaibing , "David S. Miller" Cc: Arnd Bergmann , linux-kernel@vger.kernel.org Subject: [PATCH] appletalk: Fix compile regression Date: Tue, 5 Mar 2019 14:24:21 +0100 Message-Id: <20190305132430.3821758-1-arnd@arndb.de> X-Mailer: git-send-email 2.20.0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bNaUNYfENg7TW6Kvfr4E0IDQ== Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- include/linux/atalk.h | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) -- 2.20.0 diff --git a/include/linux/atalk.h b/include/linux/atalk.h index 5a90f28d5ff2..d5cfc0b15b76 100644 --- a/include/linux/atalk.h +++ b/include/linux/atalk.h @@ -161,16 +161,26 @@ extern int sysctl_aarp_resolve_time; extern int 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__ */