From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751274AbdKMAMJ (ORCPT ); Sun, 12 Nov 2017 19:12:09 -0500 Received: from mail-pg0-f65.google.com ([74.125.83.65]:50555 "EHLO mail-pg0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750985AbdKMAMI (ORCPT ); Sun, 12 Nov 2017 19:12:08 -0500 X-Google-Smtp-Source: AGs4zMbjkhXnXvxH95SEpmu4ApzTepJRY7T+iZYSS6F8JMq9+jWvTMJHHXvsG5R3qz/iA64+BrQAtw== Date: Sun, 12 Nov 2017 16:12:05 -0800 From: Stephen Hemminger To: Rasmus Villemoes Cc: "David S. Miller" , netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 0/7] net: core: devname allocation cleanups Message-ID: <20171112161205.43e0951b@xeon-e3> In-Reply-To: <20171112231511.4666-1-linux@rasmusvillemoes.dk> References: <20171112231511.4666-1-linux@rasmusvillemoes.dk> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 13 Nov 2017 00:15:03 +0100 Rasmus Villemoes wrote: > It's somewhat confusing to have both dev_alloc_name and > dev_get_valid_name. I can't see why the former is less strict than the > latter, so make them (or rather dev_alloc_name_ns and > dev_get_valid_name) equivalent, hardening dev_alloc_name() a little. > > Obvious follow-up patches would be to only export one function, and > make dev_alloc_name a static inline wrapper for that (whichever name > is chosen for the exported interface). But maybe there is a good > reason the two exported interfaces do different checking, so I'll > refrain from including the trivial but tree-wide renaming in this > series. > > Rasmus Villemoes (7): > net: core: improve sanity checking in __dev_alloc_name > net: core: move dev_alloc_name_ns a little higher > net: core: eliminate dev_alloc_name{,_ns} code duplication > net: core: drop pointless check in __dev_alloc_name > net: core: check dev_valid_name in __dev_alloc_name > net: core: maybe return -EEXIST in __dev_alloc_name > net: core: dev_get_valid_name is now the same as dev_alloc_name_ns > > net/core/dev.c | 62 +++++++++++++++++++++------------------------------------- > 1 file changed, 22 insertions(+), 40 deletions(-) > Looks good to me. Can't see anything obviously wrong with this. I think the two functions started out heading in different directions.