From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752607AbdLKRGf (ORCPT ); Mon, 11 Dec 2017 12:06:35 -0500 Received: from mx2.suse.de ([195.135.220.15]:52077 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750759AbdLKRGb (ORCPT ); Mon, 11 Dec 2017 12:06:31 -0500 Date: Mon, 11 Dec 2017 18:06:30 +0100 Message-ID: From: Takashi Iwai To: Vinod Koul Cc: Greg Kroah-Hartman , LKML , ALSA , Mark , Pierre , patches.audio@intel.com, alan@linux.intel.com, Charles Keepax , Sagar Dharia , srinivas.kandagatla@linaro.org, plai@codeaurora.org, Sudheer Papothi Subject: Re: [PATCH v5 04/15] soundwire: Add MIPI DisCo property helpers In-Reply-To: <20171211170022.GT18649@localhost> References: <1512575231-4154-1-git-send-email-vinod.koul@intel.com> <1512575231-4154-5-git-send-email-vinod.koul@intel.com> <20171211170022.GT18649@localhost> User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI/1.14.6 (Maruoka) FLIM/1.14.9 (=?UTF-8?B?R29qxY0=?=) APEL/10.8 Emacs/25.3 (x86_64-suse-linux-gnu) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 11 Dec 2017 18:00:22 +0100, Vinod Koul wrote: > > On Mon, Dec 11, 2017 at 05:10:17PM +0100, Takashi Iwai wrote: > > On Wed, 06 Dec 2017 16:47:00 +0100, > > Vinod Koul wrote: > > > > > > + /* TODO: Read audio mode */ > > > + > > > + i++; > > > + } > > > > Don't we use count argument for a sanity check? > > Not really as that iterator runs on each bit: > > for_each_set_bit(bit, &addr, 32) { > > so it will not go on endlessly and can max out when all the bits being set > and stop. Yes, that shouldn't happen. OTOH, only looking at the callee side, one may wonder that the possible error would be dpn[] overflows the given array size (=count). Though, looking at both caller and callee, one realizes that it shouldn't happen, too. (But then again wonders why passing count argument at all :) Takashi