Received: by 2002:a05:7412:b10a:b0:f3:1519:9f41 with SMTP id az10csp2703249rdb; Mon, 4 Dec 2023 05:26:46 -0800 (PST) X-Google-Smtp-Source: AGHT+IHCUFVjh9ieOu0sAmsgIe4ptrJ3JqZD0a1eccJE3pQq9chTqdDZCOxQFoPtWFj2kPkFaqVn X-Received: by 2002:a05:6358:3a1c:b0:170:17eb:203b with SMTP id g28-20020a0563583a1c00b0017017eb203bmr4181477rwe.36.1701696405987; Mon, 04 Dec 2023 05:26:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701696405; cv=none; d=google.com; s=arc-20160816; b=TRZA5cSHIrzfHVEyrZ0cbdh2SSbRH6xl8z8yDM07QyYWzK8Pr3Q0YWpJP8E3oMXYhG rJhmRoslSw5AGSv+9KnATZArUaEBbVuhshCCCt1s97gsObKofISkMiDaKrlZoieDjK8I UXJUEOFqL/NoQahpvYNd5HttTlKqV59nL1Ah1vE6yR3AZBI/8Hp0r3Wggd33HsHOcpnV sgPYBW4JHc5r26n7Ror4ADGarjkenJDM3/Olk3MfymBfKdNCnNphu/YPVcUN5QRvK/Tc cYkSwJdyCcKAL4399f8G8p2Ah04ltPvpeUmoqRyEb4FpdEB4FZttktVeAEW2AXMMqxpS T2Fw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:organization:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=b2Q9rkGTPi4LObnRJdzlwfujh+QdwaMFrJsnjdoWjDg=; fh=oR8ZQ0z+ZlZlaV2+jyZwpaPNan+XZoJkFqKcBuPZX9o=; b=DXOZbIpdEE13C5dFil/GhR0J6o851HO5TsPVEtUBdfAj0DZr0YWZBLp0W6y9xMOShV 4ZG7iM+Qxjjid6GNw3hTj6/CB0dXAWI0kOIICVLXNyMFGw+eScxEMgVRd4MfPsofjPQQ k+NE5oDIrd6ieIcYXdhxRAbJUholpD1CB2Yl5kbjygxL3I7i8PDryRf1s4eCiqa2vf1f 6HfqqhfQGlt8q1H31KqBA/dvYkEPopC4EMzjOc56E38TIMglanQxHDr9L73GvJju1Ma4 d6v2Ml/MSc+c38v73XlLZfC4AgIa1a1/yMOEPqUCAK7UdMqpghLRY+BfOpk46/hf1PTs q1Pw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=eCPAlddx; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from agentk.vger.email (agentk.vger.email. [23.128.96.32]) by mx.google.com with ESMTPS id y16-20020a656c10000000b005c24fb6927csi8457149pgu.656.2023.12.04.05.26.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 04 Dec 2023 05:26:45 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) client-ip=23.128.96.32; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=eCPAlddx; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id AA68A807F16F; Mon, 4 Dec 2023 05:26:43 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344306AbjLDN0W (ORCPT + 99 others); Mon, 4 Dec 2023 08:26:22 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38028 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344721AbjLDNZx (ORCPT ); Mon, 4 Dec 2023 08:25:53 -0500 Received: from mgamail.intel.com (mgamail.intel.com [134.134.136.126]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 61F2710C2; Mon, 4 Dec 2023 05:24:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1701696279; x=1733232279; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=VXxTq0Pwhb4MhOFBAy4e98giPRfKzaM6kTgk9BDeYq0=; b=eCPAlddx68oTNLHJNpU3BL6DWy6VRetVXethiHKu9gC+EFKkNN5stQ/H U2hDHssmcEFkrpgOCP21kRgBnbbyklifnT2UbXzO0DncoaDjPvElJrPST YxXIJgtVDbKM8aLqh4jkgMKmoBYuePemlHx5RuzqaoLyWcgKOo/zwGg/Z 0m2S1tPhVp/s13UevhoHtivkjR6HGVV1pNzr/OcQCnDvutB1XYSD1RX+4 UfmbyqvCTK0EInjih45zjiJ6NOp9BGhif7Rd4kBKN3/HGjS4rz+WowRdH KMxup1uL8S2gxQ0/pbB+DoQuLd1Mq8BsgMWfdUugIxAeJ9YrihCPj4wVp w==; X-IronPort-AV: E=McAfee;i="6600,9927,10913"; a="378764990" X-IronPort-AV: E=Sophos;i="6.04,249,1695711600"; d="scan'208";a="378764990" Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 04 Dec 2023 05:24:38 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10913"; a="888524755" X-IronPort-AV: E=Sophos;i="6.04,249,1695711600"; d="scan'208";a="888524755" Received: from smile.fi.intel.com ([10.237.72.54]) by fmsmga002.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 04 Dec 2023 05:24:36 -0800 Received: from andy by smile.fi.intel.com with local (Exim 4.97) (envelope-from ) id 1rA8w5-00000001l5x-3Jn8; Mon, 04 Dec 2023 15:24:33 +0200 Date: Mon, 4 Dec 2023 15:24:33 +0200 From: Andy Shevchenko To: Bartosz Golaszewski Cc: Linus Walleij , linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org, Bartosz Golaszewski Subject: Re: [PATCH v3 09/10] gpiolib: use gpiochip_dup_line_label() in for_each helpers Message-ID: References: <20231204093509.19225-1-brgl@bgdev.pl> <20231204093509.19225-10-brgl@bgdev.pl> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20231204093509.19225-10-brgl@bgdev.pl> Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on agentk.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (agentk.vger.email [0.0.0.0]); Mon, 04 Dec 2023 05:26:43 -0800 (PST) On Mon, Dec 04, 2023 at 10:35:08AM +0100, Bartosz Golaszewski wrote: > From: Bartosz Golaszewski > > Rework for_each_requested_gpio_in_range() to use the new helper to > retrieve a dynamically allocated copy of the descriptor label and free > it at the end of each iteration. We need to leverage the CLASS()' > destructor to make sure that the label is freed even when breaking out > of the loop. ... > - if ((label = gpiochip_is_requested(chip, base + i)) == NULL) {} else I see, but... > + if ((*_data.label = \ > + gpiochip_dup_line_label(_chip, _base + *_data.i)) == NULL) {} \ ...can we drop this NULL check by using !(...) notation? -- With Best Regards, Andy Shevchenko