From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.16]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 65E842C190; Mon, 5 Feb 2024 14:06:56 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.16 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707142018; cv=none; b=Qm/SRADGPM0NqPn0OnkKSUi6R5YuXt8TZBmJCoe2xUf8BX9V6bdPPdox18sz/HoNqmlz0MzOKdFNV0JDr/mf2sV3BNfRsAxyM82JS3rb9OvZExXkO1EIGBFyLoOcrzQ5BPaDYPkawX3K+t5VriZnI2TPreh1bG7cxGJ0DvKHQHA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707142018; c=relaxed/simple; bh=guYmxHTAy29VwFF6fYRyWkTFNPqWsV5pzBzH20n1Tx8=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=Tf5Xt+J2I6kE4Dfq2SASOELGfemyowwkqy9fdXOTar/TvwtqITw6AgGzObGVGUMXsuHnOpTIJMrpEq/SdJARWY/hjkWRGuBI4NpJy5KML/4poomSOhxZ/Ljz9QynnqQChJ4TpnyeilJx3o2GyWXBTrdPVtvdSTHezttuWjhC9Eo= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com; spf=none smtp.mailfrom=linux.intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=Uqc9Xjlh; arc=none smtp.client-ip=192.198.163.16 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="Uqc9Xjlh" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1707142017; x=1738678017; h=date:from:to:cc:subject:message-id:references: mime-version:content-transfer-encoding:in-reply-to; bh=guYmxHTAy29VwFF6fYRyWkTFNPqWsV5pzBzH20n1Tx8=; b=Uqc9XjlhglYpMwE2QPqC8+v1eqWMkM8Z5N0LvIssaMBzQh6DEM1x3v6g gZDWOQ1ZSghs0YK1Qh62AcnUcneox7KSfjyIEY3PRz8hPppergPdeCYDC YjyGapRSsT3BuV9VmP5mBXIghRnK9XpqCgDo+6L/bzpaVasx8RcDIpGmQ yXbfRZ1WgNPTOLnzy3/abr4dWU7ztWLDUz6rzWuyKv7WtvH4Waogb9jnh YGI9Cj+108p2X434RhbGoQjEwmYmlQIhbuXZg0X858yp7UZscWaaGqyhL ihb26dfzckCO9fPCHiDapOzWzH3I2QCWVFToEn73BCrUPZFKO9ayIISPY g==; X-IronPort-AV: E=McAfee;i="6600,9927,10974"; a="784185" X-IronPort-AV: E=Sophos;i="6.05,245,1701158400"; d="scan'208";a="784185" Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmvoesa110.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 05 Feb 2024 06:06:56 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10974"; a="909303702" X-IronPort-AV: E=Sophos;i="6.05,245,1701158400"; d="scan'208";a="909303702" Received: from smile.fi.intel.com ([10.237.72.54]) by fmsmga002.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 05 Feb 2024 06:06:53 -0800 Received: from andy by smile.fi.intel.com with local (Exim 4.97) (envelope-from ) id 1rWzcY-0000000265b-1abU; Mon, 05 Feb 2024 16:06:50 +0200 Date: Mon, 5 Feb 2024 16:06:50 +0200 From: Andy Shevchenko To: Bartosz Golaszewski Cc: Linus Walleij , Kent Gibson , Alex Elder , Geert Uytterhoeven , "Paul E . McKenney" , Wolfram Sang , linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org, Bartosz Golaszewski Subject: Re: [PATCH v2 06/23] gpio: add SRCU infrastructure to struct gpio_desc Message-ID: References: <20240205093418.39755-1-brgl@bgdev.pl> <20240205093418.39755-7-brgl@bgdev.pl> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo On Mon, Feb 05, 2024 at 06:04:23AM -0800, Bartosz Golaszewski wrote: > On Mon, 5 Feb 2024 14:57:45 +0100, Andy Shevchenko > said: > > On Mon, Feb 05, 2024 at 02:54:08PM +0100, Bartosz Golaszewski wrote: > >> On Mon, Feb 5, 2024 at 2:48 PM Andy Shevchenko > >> wrote: > >> > On Mon, Feb 05, 2024 at 10:34:01AM +0100, Bartosz Golaszewski wrote: ... > >> > > + for (j = 0; j < i; j++) > >> > > + cleanup_srcu_struct(&desc->srcu); > >> > > >> > What does this loop mean? > >> > >> I open-coded it because I want to store the value of i to go back and > >> destroy the SRCU structs on failure. > > > > Where/how is j being used? > > > > In this bit: I am sorry, but I don't see how... > for (i = 0; i < gc->ngpio; i++) { > struct gpio_desc *desc = &gdev->descs[i]; > > ret = init_srcu_struct(&desc->srcu); > if (ret) { > for (j = 0; j < i; j++) > cleanup_srcu_struct(&desc->srcu); So, you call the same several times, why? > goto err_remove_of_chip; > } > >> > > + goto err_remove_of_chip; > >> > > + } -- With Best Regards, Andy Shevchenko