From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1761918AbXGDN6I (ORCPT ); Wed, 4 Jul 2007 09:58:08 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1759122AbXGDN5x (ORCPT ); Wed, 4 Jul 2007 09:57:53 -0400 Received: from waste.org ([66.93.16.53]:49038 "EHLO waste.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758188AbXGDN5w (ORCPT ); Wed, 4 Jul 2007 09:57:52 -0400 Date: Wed, 4 Jul 2007 08:56:42 -0500 From: Matt Mackall To: Satyam Sharma Cc: Linux Kernel Mailing List , Keiichi Kii , Netdev , Joel Becker , Andrew Morton , David Miller Subject: Re: [PATCH -mm 5/9] netconsole: Introduce dev_status member Message-ID: <20070704135642.GB11115@waste.org> References: <20070704110739.28520.5036.sendpatchset@cselinux1.cse.iitk.ac.in> <20070704110804.28520.25792.sendpatchset@cselinux1.cse.iitk.ac.in> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20070704110804.28520.25792.sendpatchset@cselinux1.cse.iitk.ac.in> User-Agent: Mutt/1.5.13 (2006-08-11) Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jul 04, 2007 at 04:38:04PM +0530, Satyam Sharma wrote: > From: Satyam Sharma > > [5/9] netconsole: Introduce dev_status member > > Introduce a new member in netconsole_target that tracks the status (up or > down) of the underlying interface network device that the specific logging > target netpoll is attached to. > > We then join this up with the just-introduced net_device notifier, and > introduce NETDEV_UP and NETDEV_DOWN notifications. By disabling the target > when the corresponding local interface is down, we save the overhead of > unnecessarily disabling interrupts and calling into the netpoll stack in > console->write(). Yuck. > +/* > + * Why no net_dev_is_up() in netdevice.h? The kernel could lose a lot of > + * weight if only netdevice.h had the good sense to export such a function. > + * Oh well ... > + */ > +static inline int net_dev_is_up(struct net_device *net_dev) > +{ > + return ((net_dev->flags & IFF_UP) == IFF_UP); > +} Why editorialize? Why not just add this to netdevice.h? > + if (nt->dev_status) { Why not simply call net_dev_is_up? -- Mathematics is the supreme nostalgia of our time.