Received: by 2002:a25:683:0:0:0:0:0 with SMTP id 125csp3960989ybg; Sun, 7 Jun 2020 16:39:54 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyHKBZ1T8wKXS9swSELRv0vnaGhnoqIoBwbUXN8DRzxYdKhamKdi7eozlN6X+P4qxN1r3UZ X-Received: by 2002:a50:fe0d:: with SMTP id f13mr20095503edt.204.1591573194249; Sun, 07 Jun 2020 16:39:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1591573194; cv=none; d=google.com; s=arc-20160816; b=ey9ZqCfVkAlYZU8J+KA2Qb8fqnvxdjwLlGBepxBimG8nj/ME/ODkKHjLIUGjjc50qn bvTIEBdmqBmBly1zMpGSLzNqO+IV0OdbdBJZIchr+rn0zkH3nqLLtUfV+LiU5c0eH1bG bwKw0I4o/4YvPIZkPDci7eBcgD2cONPjbOPtLnnRRDtmeZMs+N03UCU1ZmRlkHfnRLDX wlmb6SrZneJqOV0dU2uLYqMjBgBQPBYRMmXy5CWnWU1jTTezFInVBJwOpyTfkdANxJZ6 tXYdruZZQrC4pHurNBUez5X+RZiuJH5EVF+1EcjsyYTMjZAcAVboD+L9ArisMf/moW+M cIXA== 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:from:subject:cc:to:message-id:date; bh=Gx1j56H7XAiXNjAifaIXoEhzntLVCNUnNvVcAW68u0U=; b=tqK+Gq6XBah4gKEvxJCcTclJO3w9CGMd2pg0XhtJQGU/Xggur/74yMi5S8D9LRXisb yIYn0fluDlfkIR0DDVb02qHgxJKiYs0TqWokTowHO902mMHW6b0r7hkzRXDLPiN+e9RW NSPhcH6YK5F2FTWSL0D+ddHcu+MKoZEkd1EHbN5HMYeTtpYhsAP2kDJ/5SKvSYn/Umoy 9BGFEZcl10l7O4hZjTbWg4B66iz4WL4WjAy5FZwVcpcIcBQO1z5OSAq+oNcg+MY/MstV wNcItF912YunRkhh3/s127/pl4HUjube3T2TPjR7PEh1srGgO6x4NJSEbemfBZxTDkkF 0fQw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id c16si7859312ejx.310.2020.06.07.16.39.31; Sun, 07 Jun 2020 16:39:54 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728032AbgFGXgz (ORCPT + 99 others); Sun, 7 Jun 2020 19:36:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45898 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727786AbgFGXgy (ORCPT ); Sun, 7 Jun 2020 19:36:54 -0400 Received: from shards.monkeyblade.net (shards.monkeyblade.net [IPv6:2620:137:e000::1:9]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 47723C061A0E; Sun, 7 Jun 2020 16:36:54 -0700 (PDT) Received: from localhost (unknown [IPv6:2601:601:9f00:477::3d5]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) (Authenticated sender: davem-davemloft) by shards.monkeyblade.net (Postfix) with ESMTPSA id 7593B127385D2; Sun, 7 Jun 2020 16:36:51 -0700 (PDT) Date: Sun, 07 Jun 2020 16:36:48 -0700 (PDT) Message-Id: <20200607.163648.1680419872557863264.davem@davemloft.net> To: xianfengting221@163.com Cc: leon@kernel.org, saeedm@mellanox.com, kuba@kernel.org, netdev@vger.kernel.org, linux-rdma@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] net/mlx5: Add a missing macro undefinition From: David Miller In-Reply-To: References: <20200607051241.5375-1-xianfengting221@163.com> <20200607063635.GD164174@unreal> X-Mailer: Mew version 6.8 on Emacs 26.3 Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.5.12 (shards.monkeyblade.net [149.20.54.216]); Sun, 07 Jun 2020 16:36:51 -0700 (PDT) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Hu Haowen Date: Sun, 7 Jun 2020 14:55:33 +0800 > > On 2020/6/7 2:36 PM, Leon Romanovsky wrote: >> On Sun, Jun 07, 2020 at 01:12:40PM +0800, Hu Haowen wrote: >>> The macro ODP_CAP_SET_MAX is only used in function >>> handle_hca_cap_odp() >>> in file main.c, so it should be undefined when there are no more uses >>> of it. >>> >>> Signed-off-by: Hu Haowen >>> --- >>> drivers/net/ethernet/mellanox/mlx5/core/main.c | 2 ++ >>> 1 file changed, 2 insertions(+) >> "should be undefined" is s little bit over statement, but overall >> the patch is good. > > > Sorry for my strong tone, but my idea is that every macro which is > defined and used just in a single function, is supposed to be > undefined > at the end of its final use, so that you won't get into trouble next > time if you define a macro with the same name as this one. The compiler would generate an error if that happened, so you would not get into "trouble". I fail to see the value in this change at all, sorry. Really, what's the point? Does it make the code harder to read? No. Does it cause problems if you accidently want to use that macro name again in the same compilation unit? No. So I have yet to hear a valid "why" to make this kind of change and I'd like to stop this set of cleanups before it gets out of control and we have these ugly #undef statements all over the tree. Thank you.