From patchwork Wed Mar 6 10:52:36 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 159740 Delivered-To: patch@linaro.org Received: by 2002:a02:5cc1:0:0:0:0:0 with SMTP id w62csp6017956jad; Wed, 6 Mar 2019 02:53:13 -0800 (PST) X-Google-Smtp-Source: APXvYqw/koe2sj8HgQmz01cmMwkO+NEOJeBFWA9Zzm6pmF4LSTbAU6hQy2mox75Gxy+IcumG5ZpB X-Received: by 2002:a17:902:b087:: with SMTP id p7mr6297664plr.56.1551869593852; Wed, 06 Mar 2019 02:53:13 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1551869593; cv=none; d=google.com; s=arc-20160816; b=GdpC2PSTXCAxARRoAFVqxtUPORl/vUX1KDmjL5XaorOWqjg1KFt6vUBlHTWN90a/pX SsKbrk3b+tQUjeeedmx+yVZPm+xnLrq3d/t0rRCLnf160zH0+Y4EmShod2oU6ruc5ESi 7Tds0NRdaoppGgjTuFJEx11uOvxaPomjzcaOfA52pLRDIeUogcZAjrjIJV7Ou1cEqKxJ Z3Lzb/sJCL7+jVP49q2+DzJDrKBDQXgY15k+2kSGV2bwEYLN0x19PIA8Pe8zx97GgvET mS/BbBBEBUXps36ktsF+Lh4I38LAYFR01gPpBUw8uGnDW8ZOlCKQbzB4vroWQEdNeLyT exJg== 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=kQmGSteyN3KYVwwcrqbyE9MXAKVYo2UTMY7Jk6oDasg=; b=xjiV7ZdiSVGk8wm0/9Kh1TpyM+Fdl37jO6JhoFBpTCYHJYQsykQqbrF2ZqCxcZ1PkL uoaf5Ul5bXgcFUgaumUUjGXJBb+daRsiz3TmqiByN1ff45kPGqbR6VQvmP8fHgOwP5Jr A/narE+nX2OfgJ84ENNKBx97VqcIVZL7OGlS8RBrFT/n+Sy9IfKe13qb+uRXdZsi0JxJ 5hhZusllI3ce10v/09Iq0+pbK7kmVQWDrVjvYy/BgyAiRJIPow/cv+tCer+7mYMO37yt qeT+TEWyzj0ZwGyGihTii2lM/d56inu16OSV7CFGIAIQsqSCXLgwbG8Erc0kHyqud5JK ah9Q== 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 q192si1191687pgq.8.2019.03.06.02.53.13; Wed, 06 Mar 2019 02:53:13 -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 S1730008AbfCFKxL (ORCPT + 31 others); Wed, 6 Mar 2019 05:53:11 -0500 Received: from mout.kundenserver.de ([212.227.126.135]:35909 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727809AbfCFKxL (ORCPT ); Wed, 6 Mar 2019 05:53:11 -0500 Received: from wuerfel.lan ([109.192.41.194]) by mrelayeu.kundenserver.de (mreue009 [212.227.15.129]) with ESMTPA (Nemesis) id 1MZkxj-1gUoEv4BE7-00Wr18; Wed, 06 Mar 2019 11:52:51 +0100 From: Arnd Bergmann To: netdev@vger.kernel.org Cc: Arnd Bergmann , "David S. Miller" , YueHaibing , linux-kernel@vger.kernel.org Subject: [PATCH 1/2] appletalk: Fix compile regression Date: Wed, 6 Mar 2019 11:52:36 +0100 Message-Id: <20190306105249.2165038-1-arnd@arndb.de> X-Mailer: git-send-email 2.20.0 MIME-Version: 1.0 X-Provags-ID: V03:K1:/jRd9q1XZJAFsz3r5gJJf4LaKq31rWb+CKKYKuPWmai36hTMVOl yDKw3+8qmqmyABGtbcDBmGEIdfg+WdkNRJ0jz18sOSBnsB2/R4SOrpbCESSfSZYzhY/h48D uDxEnAJE0XYxKHq1zx/0iiJ97gTKbkG81iEts6VZjMbYbENAb5uX6kggBnqjX5BM2Cr4fhM SkmbwV+nFOUOFNPM0VOfQ== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1; V03:K0:Zo5N12rnU68=:wi1oYA8ybpBHfDDE6wGLJx l+NATxFimdrWdwUUF/ltvg/cidhkREWJ/h657pVzBwgFjRgrvd6hw9+pwpbqjPjpEquckBlzI BHWcHyTLJKE/UKw/xWPaMfw/Vn0yCHCTDNGzj/XWEQuKci6oPCCD6GQADvwimbsDtM7ENXdPH DTjoNEt/4iFT7GFiVHULn5hFF9opeZNaE8lT0eZC6lpvQPUNTgzNdJEvqXlNl9KqjliM9Yc83 QI1hJmJbzYq2s9a2LiX+7xPZfobtMeynLKPb8aB4EEOM77hWEocvdw27dvIVs+2DqKKCUD9d3 6qW5MsBIJvc7rzIZzCdpeOFqgxBw1L/ST90UEKtfQZe607BeTllCXh1wFVtk6w1u85nS5tKMs oofLhaxbK0kG0oZeGtuZAY/1O02qyTvumcw/vqsIHCNiRmze9b0ogf41ai+ZTC1LTJyOOIqsb OtgP4Y5fEDZ0uJmtEJkcYIAAl7guCCU1oz8QG1lyAaoC/nwvuMQfMifDtsTE+PgqJlSy/57fU XzOH6US9JKNvtzosHdtf8LlH6x2psRjS7wgkpaWbTJ8U48tYiQC4VQqOYloSajJrx7ehohVZ7 71mxKxr8X3CF8pR4MPWrlxS4xiQuL26Nw/y3W25q5pvR3SBETwey+Pi19cK5L19/ye9EVBLg2 BJfKfV2TvlgSLgCQb/YTpFQpAod59cxpHN//FhwJQ1lqeTpkS1O7943KUvIzt+fWXB0oz4+Wx R9zntaUkH0trrwQTwk08VshocMBCrNp0+HmMpw== 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 --- resent with mailing list on Cc --- 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__ */