Received: by 2002:a05:7412:7c14:b0:fa:6e18:a558 with SMTP id ii20csp307281rdb; Mon, 22 Jan 2024 05:03:40 -0800 (PST) X-Google-Smtp-Source: AGHT+IErYqS1b3VzdiDORma101zvr8Uo+Rkv4GMoN3UkZL8rF/xrasNN/ulee6Tl/TJx+SGVFWjh X-Received: by 2002:a17:906:b0c6:b0:a2c:cf35:e5a0 with SMTP id bk6-20020a170906b0c600b00a2ccf35e5a0mr2217668ejb.153.1705928620200; Mon, 22 Jan 2024 05:03:40 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1705928620; cv=pass; d=google.com; s=arc-20160816; b=BoTfhkpRUbaJfjTbF9luK2qNzqFfr8ec/w5UGT0+O1JKF+J6YNLgfsKEi9FIO41efR +9IRFdwyp274DrLn9vIBzqG7gKLZB3iu2bz4vtSvZYwufLBwxFk6Z0PLnpr/I25n6x1j po2Dl994lAn6x0YG8QhAN2S/BmwJ6jEDp858PugRtf9fwKkoMCuXobhMWoew+arE3nVA fXqsjtCbHbslc+yzQ0XByi8wziZeZCDBQBVBihlDpm1vEBWQqx+dvGW3n5h3NGcxlM+1 VBLlPQx/X4uTXkOVbiOx/+Lt9Z2lhgqtZ0Alj+HmqvDpL4ddS4lSLz2LI0WbgNKY5RNI 2fDQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:autocrypt:from:references:cc :to:content-language:subject:user-agent:mime-version :list-unsubscribe:list-subscribe:list-id:precedence:date:message-id :dkim-signature; bh=ETHK121tTwhB53jLp6JK8rotxF5sZ3uZp3Qk/Z/yNDc=; fh=2rgKT7gZS5GSWXJ/J9JNmn5EyoTQn2xKZojekZPA8i4=; b=lO6SXpnyr2GcR5IGuWVjSF0vVF1SlFnhJfTXDqfWlXBky3oqiCH8dpGz8e8gU73vR5 PfFgkjCVN7FtY9MGD04fP2Pe6JwFDTtoWw/THvzpcH3GFEB1OHLMVyvfHoUjMznuTWjV a59uJS5iD9SRORDMKwipxSThGBzrTKyXQUYaTzez0E6iS/nCLBc0eA85aTmgR13Owcho oPN79T8Q7fQSwUCWduWFigHgAWvVD81Cfxyc/ZB8a2yumZ7jrkwh+ZSzAC0DQpQBN40H QYZKIWf8za0kOWEnJyZU9JHFXgoTlDwDjRkj2ZFpKmiJAhxhqyHtYPzPe/4sXD4rFFzu DKKQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="meeMVr/C"; arc=pass (i=1 spf=pass spfdomain=linaro.org dkim=pass dkdomain=linaro.org dmarc=pass fromdomain=linaro.org); spf=pass (google.com: domain of linux-kernel+bounces-33067-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-33067-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id a1-20020a170906368100b00a2f4a501c3dsi3914187ejc.823.2024.01.22.05.03.40 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 Jan 2024 05:03:40 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-33067-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="meeMVr/C"; arc=pass (i=1 spf=pass spfdomain=linaro.org dkim=pass dkdomain=linaro.org dmarc=pass fromdomain=linaro.org); spf=pass (google.com: domain of linux-kernel+bounces-33067-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-33067-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 056751F21C38 for ; Mon, 22 Jan 2024 13:03:36 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 2CB123CF73; Mon, 22 Jan 2024 13:03:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="meeMVr/C" Received: from mail-wm1-f42.google.com (mail-wm1-f42.google.com [209.85.128.42]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8A60A3C6A4 for ; Mon, 22 Jan 2024 13:02:58 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.42 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705928580; cv=none; b=SmW3e55r0CKm31WN98/uRhhwlsMF1TeKPF7XJZXlzC+DsbJ/1lXFfVuayfdn7eC1TH0kx4WWAuJnUJaJlhlmoaiE5j8en1+DyCAbQM72lR7MMev/7qVE+o1Un9ol2viSgd6/Gnk+IqqWu3C9Q7kOn0Q4LYLd5coWbIQz/Pf9gIQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705928580; c=relaxed/simple; bh=xmAzmwtsz1HRk80aYsft+aaG6rAVmlDuN9frR0Y4G4s=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=q1gAycUIuDvr+RAxWtoAUlnydArCeKOVWbJsxyzLNn3XHGEchhBJYz/Y5bLDOWK+euXJTcq5TDUg0LxpgcJG0OuWpUwlLd982AIkAfpbreoKYO4f/rH76RPqsZ+apg7G4CBciSH/YqZwkoP0xweC+nBYMdLcwbpdnHxmSkM+JsM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=meeMVr/C; arc=none smtp.client-ip=209.85.128.42 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Received: by mail-wm1-f42.google.com with SMTP id 5b1f17b1804b1-40e86a9fbd9so34793125e9.1 for ; Mon, 22 Jan 2024 05:02:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1705928577; x=1706533377; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:autocrypt:from:references:cc :to:content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=ETHK121tTwhB53jLp6JK8rotxF5sZ3uZp3Qk/Z/yNDc=; b=meeMVr/CrjHTJX38QFsL/TYvwvBKGLY+044rAyCT4Ypy5S8Pz2sAvuozRYP9/x17PM L7IzwexOtF69yt3tZ9hookyDlNOk+enb3yi+D4C3Z8W/8GjwOfUk3DaqiAWFP18zQetO Na8neLOXqf8byVnWEQ+qOHUukJShGMWIr5Nh7tfAzwiq3NHNUXRL4gJmZOH1Y3lbWWVL knbeJo+JTaEF2h55sqbV9lzk21ShMqELjC8Qjc0REry0HBSK1zkOoCstXqXIcfHx7PG+ c4C7+2VC37eLxdmO3BlrKszO9rzT9u4br8zUIFTkcpp7Qd4LvPXnsq1H/pYBGTfksg1b oVNg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1705928577; x=1706533377; h=content-transfer-encoding:in-reply-to:autocrypt:from:references:cc :to:content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=ETHK121tTwhB53jLp6JK8rotxF5sZ3uZp3Qk/Z/yNDc=; b=ICgzlf2cml5Bi0k0FrvBjWnUYo4yVqt7OnNqgytODmSInhYUyRKwrTRembzneLyLxf oaiYpmcfuvpo2AxJprr2rh4WrqQQzA+PsFoy0bkmqOU7ThtJha96FTpXZndmWnVGzzwq ayD2PqKDz0mceNn6wBYggH8VQrL8NOPYQO9RWcm9bCe64uZjOU1OY4A/Sjqkp+6aPZ5U O1uEMUpsP0z7dq959O5qLQDvuhdnVuBjw99xI726Y1IL7eRyT4XsgPCxsYaR0S+a9BZF QvwpJ8rFaVVGU3DC2xPf3BBrRmSm7nAwiwCIVfuD0NtVdomLY2+blGFdL5dF1KDSC0xq BP4g== X-Gm-Message-State: AOJu0YxwBNQ7U3vCOLk/CHtf49Jfjp7YevPAhl/KPF4eagiqrOBnIk7B e0Twpyuu+3IAUraqcJcjQjpkWhUt8uqrYC1WYXErGQKkNhlUerxhDgkjp9LwSnY= X-Received: by 2002:a7b:c41a:0:b0:40e:83a0:63a0 with SMTP id k26-20020a7bc41a000000b0040e83a063a0mr2328940wmi.58.1705928576507; Mon, 22 Jan 2024 05:02:56 -0800 (PST) Received: from [192.168.1.20] ([178.197.215.66]) by smtp.gmail.com with ESMTPSA id fl21-20020a05600c0b9500b0040e9d507424sm12698275wmb.5.2024.01.22.05.02.55 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 22 Jan 2024 05:02:56 -0800 (PST) Message-ID: <64f125e8-53c9-4a2d-9629-cb2011443d58@linaro.org> Date: Mon, 22 Jan 2024 14:02:54 +0100 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v3 2/5] reset: Instantiate reset GPIO controller for shared reset-gpios Content-Language: en-US To: Philipp Zabel , Bartosz Golaszewski Cc: Bjorn Andersson , Konrad Dybcio , Srinivas Kandagatla , Banajit Goswami , Liam Girdwood , Mark Brown , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Peter Rosin , Jaroslav Kysela , Takashi Iwai , linux-arm-msm@vger.kernel.org, alsa-devel@alsa-project.org, linux-sound@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-i2c@vger.kernel.org, Chris Packham , Sean Anderson References: <20240112163608.528453-1-krzysztof.kozlowski@linaro.org> <20240112163608.528453-3-krzysztof.kozlowski@linaro.org> <7f311659-9f49-44dc-ad40-977d34066d98@linaro.org> <289c4af00bcc46e83555dacbc76f56477126d645.camel@pengutronix.de> From: Krzysztof Kozlowski Autocrypt: addr=krzysztof.kozlowski@linaro.org; keydata= xsFNBFVDQq4BEAC6KeLOfFsAvFMBsrCrJ2bCalhPv5+KQF2PS2+iwZI8BpRZoV+Bd5kWvN79 cFgcqTTuNHjAvxtUG8pQgGTHAObYs6xeYJtjUH0ZX6ndJ33FJYf5V3yXqqjcZ30FgHzJCFUu JMp7PSyMPzpUXfU12yfcRYVEMQrmplNZssmYhiTeVicuOOypWugZKVLGNm0IweVCaZ/DJDIH gNbpvVwjcKYrx85m9cBVEBUGaQP6AT7qlVCkrf50v8bofSIyVa2xmubbAwwFA1oxoOusjPIE J3iadrwpFvsZjF5uHAKS+7wHLoW9hVzOnLbX6ajk5Hf8Pb1m+VH/E8bPBNNYKkfTtypTDUCj NYcd27tjnXfG+SDs/EXNUAIRefCyvaRG7oRYF3Ec+2RgQDRnmmjCjoQNbFrJvJkFHlPeHaeS BosGY+XWKydnmsfY7SSnjAzLUGAFhLd/XDVpb1Een2XucPpKvt9ORF+48gy12FA5GduRLhQU vK4tU7ojoem/G23PcowM1CwPurC8sAVsQb9KmwTGh7rVz3ks3w/zfGBy3+WmLg++C2Wct6nM Pd8/6CBVjEWqD06/RjI2AnjIq5fSEH/BIfXXfC68nMp9BZoy3So4ZsbOlBmtAPvMYX6U8VwD TNeBxJu5Ex0Izf1NV9CzC3nNaFUYOY8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O5nAkIvKSNp3jmGxZw4aTc5xoAZBLo0OV+Ezo71pg3AYvq0a3/oGRG KQ06ztUMRrj8eVtpImjsWCd0bDWRaaR4vqhCHvAG9iWXZu4qh3ipie2Y0oSJygcZT7H3UZxq fyYKiqEmRuqsvv6dcbblD8ZLkz1EVZL6djImH5zc5x8qpVxlA0A0i23v5QvN00m6G9NFF0Le D2GYIS41Kv4Isx2dEFh+/Q== In-Reply-To: <289c4af00bcc46e83555dacbc76f56477126d645.camel@pengutronix.de> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit On 15/01/2024 18:32, Philipp Zabel wrote: > On Mo, 2024-01-15 at 17:13 +0100, Krzysztof Kozlowski wrote: >> On 15/01/2024 17:06, Bartosz Golaszewski wrote: >>>> + >>>> +static int __reset_add_reset_gpio_lookup(int id, struct device_node *np, >>>> + unsigned int gpio, >>>> + unsigned int of_flags) >>>> +{ >>>> + struct gpiod_lookup_table *lookup __free(kfree) = NULL; >>>> + struct gpio_device *gdev __free(gpio_device_put) = NULL; >>>> + char *label __free(kfree) = NULL; >>> >>> I got yelled at by Linus Torvalds personally for doing it like this. I >>> know this is a common pattern in code using GLib but Linus wants auto >>> variables to be initialized where they're declared... >> >> Declaration is here. Initialization is here. Therefore this is >> initialized where it is declared. What's more it is initialized to a >> valid value, because __free() accepts NULLs. > [...] >>> ... so this should become: >>> >>> struct gpio_device *gdev __free(gpio_device_put) = gpio_device_find(...) >>> >>> and same for the rest. >>> >>> Don't get me wrong, I love cleanup.h but there's a (unofficial for >>> now) coding style. >> >> So you just want to declare it not in top-part of the function but just >> before first use? > > IIUC, Linus wants exactly this: > > https://lore.kernel.org/all/CAHk-=wgRHiV5VSxtfXA4S6aLUmcQYEuB67u3BJPJPtuESs1JyA@mail.gmail.com/ Sure. Best regards, Krzysztof