From mboxrd@z Thu Jan 1 00:00:00 1970 From: David Ahern Subject: Re: [PATCH iproute2-next v2 1/4] utils: Introduce and use inet_prefix_reset_flags() Date: Sun, 11 Feb 2018 18:15:20 -0700 Message-ID: <01307571-e5dd-6756-897e-0b107b4d4271@gmail.com> References: <1518379353-31995-1-git-send-email-serhe.popovych@gmail.com> <1518379353-31995-2-git-send-email-serhe.popovych@gmail.com> <20180211154850.0f3d43b7@xeon-e3> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Cc: netdev@vger.kernel.org To: Stephen Hemminger , Serhey Popovych Return-path: Received: from mail-pl0-f42.google.com ([209.85.160.42]:33156 "EHLO mail-pl0-f42.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932311AbeBLBPX (ORCPT ); Sun, 11 Feb 2018 20:15:23 -0500 Received: by mail-pl0-f42.google.com with SMTP id t4so4299130plo.0 for ; Sun, 11 Feb 2018 17:15:23 -0800 (PST) In-Reply-To: <20180211154850.0f3d43b7@xeon-e3> Content-Language: en-US Sender: netdev-owner@vger.kernel.org List-ID: On 2/11/18 4:48 PM, Stephen Hemminger wrote: > On Sun, 11 Feb 2018 22:02:30 +0200 > Serhey Popovych wrote: > >> +static inline void inet_prefix_reset_flags(inet_prefix *p) >> +{ >> + p->flags = 0; >> +} > > Just do it. > > Wrapper adds nothing here. > I asked for a wrapper to flags b/c embedding 'p->flags = 0' into code hides what it is doing - which is resetting the address type in inet_prefix. If inet_prefix is hiding address family and address type details from the main ip code, details of how it works should be opaque to that code.