From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755342AbdKQCDH (ORCPT ); Thu, 16 Nov 2017 21:03:07 -0500 Received: from mga02.intel.com ([134.134.136.20]:8498 "EHLO mga02.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755304AbdKQCCq (ORCPT ); Thu, 16 Nov 2017 21:02:46 -0500 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.44,406,1505804400"; d="scan'208";a="3619442" Date: Fri, 17 Nov 2017 07:36:04 +0530 From: Vinod Koul To: Mark Brown Cc: ALSA , Charles Keepax , Sudheer Papothi , Takashi , Greg Kroah-Hartman , plai@codeaurora.org, LKML , Pierre , patches.audio@intel.com, Srinivas Kandagatla , Shreyas NC , Sanyog Kale , Sagar Dharia , alan@linux.intel.com Subject: Re: [alsa-devel] [PATCH v2 03/14] soundwire: Add Master registration Message-ID: <20171117020604.GG3187@localhost> References: <1510314556-13002-1-git-send-email-vinod.koul@intel.com> <1510314556-13002-4-git-send-email-vinod.koul@intel.com> <2ba56597-2178-6389-bc4d-153a17505981@linaro.org> <20171116164944.GC3187@localhost> <20171116173024.owiotfwriclu2won@sirena.org.uk> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20171116173024.owiotfwriclu2won@sirena.org.uk> User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Nov 16, 2017 at 05:30:24PM +0000, Mark Brown wrote: > On Thu, Nov 16, 2017 at 10:19:44PM +0530, Vinod Koul wrote: > > On Thu, Nov 16, 2017 at 04:05:22PM +0000, Srinivas Kandagatla wrote: > > > > >+ *bus->assigned = ~GENMASK(SDW_BROADCAST_DEV_NUM, SDW_ENUM_DEV_NUM); > > > > Can't we use ida for this. > > > This would also cut down code added for allocating dev_num. > > > Device numbers in SoundWire are 0 thru 15 with 0 and 15 having special > > meaning so can'r be allocated. Bitmaps give me a nice way to ensure we dont > > use those by masking these and above 15... IDR uses bitmap with stuff on top > > which maynot be helpful here as I need a number 1 to 14. For a generic, give > > me a number IDRs are very useful. > > Perhaps we need some comments or something explaining the constraints > here to stop people doing misguided cleanups? Sure, it is already explained at scattered places, will add this comment here as well. -- ~Vinod