From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755234AbbHFJ1R (ORCPT ); Thu, 6 Aug 2015 05:27:17 -0400 Received: from mga03.intel.com ([134.134.136.65]:3019 "EHLO mga03.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754615AbbHFJ1O (ORCPT ); Thu, 6 Aug 2015 05:27:14 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.15,622,1432623600"; d="scan'208";a="743321800" Message-ID: <1438853219.29746.184.camel@linux.intel.com> Subject: Re: [PATCH 2/5] net: rfkill: add rfkill_find_type function From: Andy Shevchenko To: Heikki Krogerus Cc: Johannes Berg , "Rafael J. Wysocki" , Mika Westerberg , linux-wireless@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, linux-tegra@vger.kernel.org Date: Thu, 06 Aug 2015 12:26:59 +0300 In-Reply-To: <20150806083004.GI7675@kuha.fi.intel.com> References: <1438781947-7952-1-git-send-email-heikki.krogerus@linux.intel.com> <1438781947-7952-3-git-send-email-heikki.krogerus@linux.intel.com> <1438783649.29746.175.camel@linux.intel.com> <20150806083004.GI7675@kuha.fi.intel.com> Organization: Intel Finland Oy Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.16.3-1 Mime-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 2015-08-06 at 11:30 +0300, Heikki Krogerus wrote: > > > > On Wed, Aug 05, 2015 at 05:07:29PM +0300, Andy Shevchenko wrote: > > On Wed, 2015-08-05 at 16:39 +0300, Heikki Krogerus wrote: > > > +static inline enum rfkill_type rfkill_find_type(const char > > > *name) > > > +{ > > > + return 0; > > > > Hmm… Besides 0 is implicitly casted to enum type the issue with > > enums > > that you rather have to supply existing enum entry. I would suggest > > to > > add RFKILL_TYPE_UNKNOWN if _ALL is reserved for some use cases. > > Why would you add a new type just for this? You do realize it would > require adding specific handling all over the place? RFKILL_TYPE_ALL > (0) is already handled as an invalid type. It was my thought as well (see *if* in my previous comment). > Confused? A bit, yes. > > I'll change this and return RFKILL_TYPE_ALL instead of 0. Excellent! -- Andy Shevchenko Intel Finland Oy