From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.0 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2113BC43381 for ; Fri, 15 Feb 2019 18:51:30 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id EBDCB222A1 for ; Fri, 15 Feb 2019 18:51:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2403761AbfBOSv3 (ORCPT ); Fri, 15 Feb 2019 13:51:29 -0500 Received: from smtprelay0075.hostedemail.com ([216.40.44.75]:46632 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S2387731AbfBOSv2 (ORCPT ); Fri, 15 Feb 2019 13:51:28 -0500 Received: from filter.hostedemail.com (clb03-v110.bra.tucows.net [216.40.38.60]) by smtprelay01.hostedemail.com (Postfix) with ESMTP id 1A057100E86C2; Fri, 15 Feb 2019 18:51:27 +0000 (UTC) X-Session-Marker: 6A6F6540706572636865732E636F6D X-HE-Tag: ducks76_63ca496c67f48 X-Filterd-Recvd-Size: 3434 Received: from XPS-9350.home (unknown [47.151.153.53]) (Authenticated sender: joe@perches.com) by omf12.hostedemail.com (Postfix) with ESMTPA; Fri, 15 Feb 2019 18:51:25 +0000 (UTC) Message-ID: <620a93625ac3709bf6df5e31bcdcdd319db140ef.camel@perches.com> Subject: Re: [net-next 5/5] net: sock: remove the definition of SOCK_DEBUG() From: Joe Perches To: Eric Dumazet , Cong Wang Cc: Yafang Shao , David Miller , Daniel Borkmann , netdev , shaoyafang@didiglobal.com Date: Fri, 15 Feb 2019 10:51:24 -0800 In-Reply-To: References: <1550242187-29660-1-git-send-email-laoar.shao@gmail.com> <1550242187-29660-6-git-send-email-laoar.shao@gmail.com> Content-Type: text/plain; charset="ISO-8859-1" User-Agent: Evolution 3.30.1-1build1 Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org On Fri, 2019-02-15 at 10:22 -0800, Eric Dumazet wrote: > On Fri, Feb 15, 2019 at 10:13 AM Cong Wang wrote: > > On Fri, Feb 15, 2019 at 8:26 AM Eric Dumazet wrote: > > > On Fri, Feb 15, 2019 at 6:50 AM Yafang Shao wrote: > > > > As SOCK_DEBUG() isn't used any more, we can get ride of it now. > > > > > > > > > > No, we are still using this infrastructure from time to time. > > > > > > I told you I agreed to remove the current (obsolete) TCP call sites, > > > I never suggested to remove SOCK_DEBUG() completely. > > > > Since when do we upstream care about any out-of-tree users? > > > > You can always carry a patch to keep it downstream if you want, > > no one can stop you doing it. > > Somehow the patch series seems to present things in this way : > > Eric Dumazet suggested to remove completely the SOCK_DEBUG() interface. Well, you kinda did. It's certainly reasonable to interpret what you wrote as such. On Tue, 2019-02-12 at 18:15 -0800, Eric Dumazet wrote: > Just remove all SOCK_DEBUG() calls, there are leftovers of very ancient times. My suggestion would be to undefine SOCK_DEBUGGING. Something like: --- include/net/sock.h | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/include/net/sock.h b/include/net/sock.h index 328cb7cb7b0b..7e39bdfa342a 100644 --- a/include/net/sock.h +++ b/include/net/sock.h @@ -81,14 +81,17 @@ */ /* Define this to get the SOCK_DBG debugging facility. */ -#define SOCK_DEBUGGING +/* #define SOCK_DEBUGGING */ #ifdef SOCK_DEBUGGING -#define SOCK_DEBUG(sk, msg...) do { if ((sk) && sock_flag((sk), SOCK_DBG)) \ - printk(KERN_DEBUG msg); } while (0) +#define SOCK_DEBUG(sk, fmt, ...) \ +do { \ + if ((sk) && sock_flag((sk), SOCK_DBG)) \ + printk(KERN_DEBUG fmt, ##__VA_ARGS__); \ +} while (0) #else /* Validate arguments and do nothing */ -static inline __printf(2, 3) -void SOCK_DEBUG(const struct sock *sk, const char *msg, ...) +__printf(2, 3) +static inline void SOCK_DEBUG(const struct sock *sk, const char *fmt, ...) { } #endif