From mboxrd@z Thu Jan 1 00:00:00 1970 From: Oliver Neukum Subject: Re: [PATCH 4/7] usbnet: remove EVENT_DEV_OPEN flag Date: Wed, 13 Jun 2012 09:40:54 +0200 Message-ID: <201206130940.54817.oliver@neukum.org> References: <1339463985-9006-1-git-send-email-tom.leiming@gmail.com> Mime-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Cc: "David S. Miller" , "Greg Kroah-Hartman" , netdev@vger.kernel.org, linux-usb@vger.kernel.org To: Ming Lei Return-path: Received: from smtp-out003.kontent.com ([81.88.40.217]:38667 "EHLO smtp-out003.kontent.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750727Ab2FMHoF (ORCPT ); Wed, 13 Jun 2012 03:44:05 -0400 In-Reply-To: Sender: netdev-owner@vger.kernel.org List-ID: Am Mittwoch, 13. Juni 2012, 06:47:18 schrieb Ming Lei: > On Wed, Jun 13, 2012 at 10:12 AM, Ming Lei wrote: > > On Wed, Jun 13, 2012 at 2:14 AM, Oliver Neukum wrote: > >> Am Dienstag, 12. Juni 2012, 03:19:42 schrieb Ming Lei: > >>> EVENT_DEV_OPEN is introduced to mark if the interface is opened or > >>> not, but we already have IFF_UP to handle it, so just > >>> remove the flag and use IFF_UP. > >> > >> When is IFF_UP cleared? The flag is tested in usbnet_resume(), > > > > The flag is cleared just after usbnet_stop completes. > > Looks we can use the below to replace EVENT_DEV_OPEN: > > (netif_running((dev)->net) && ((dev)->net->flags & IFF_UP)) That goes down a bit into the interna of the network code. If we do this, please encapsulated and with a big fat comment. Regards Oliver