Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp35233346rwd; Mon, 10 Jul 2023 04:45:07 -0700 (PDT) X-Google-Smtp-Source: APBJJlGgn6pSBVkYE1+8S0DS8FkKzZranl6CYENLhbrxtytIW8g+hcvQ2Nzr/dd8e7nk85aNFQ3R X-Received: by 2002:a17:906:5a50:b0:978:928:3b99 with SMTP id my16-20020a1709065a5000b0097809283b99mr12432974ejc.46.1688989506989; Mon, 10 Jul 2023 04:45:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688989506; cv=none; d=google.com; s=arc-20160816; b=MSbbQbXFCqXMP9bYXKGdIDFFvkAcy+y89V6NEaSl1DW+NUeyoVp2Rlp2KsfhWrOYY+ 8krZwI4q4pqQWnRtTiGCXdK3a4jnN6T7NRTVq5eUmuUyNKH8XVxeblVTnYomWE1yKKKf 1YU9itd7EoNDFWL5K1EjDrxX5AE+1UVoooWrdAKZHrhd5lPU7BVsTH65v9572kgeJnTR bAGaMdSLzR+yfT7n0XAQoa0fP6wcEcD9mkzcVJJJIRT46eaMjknJ4wSn3lDDKf0y13kC Xj7jDyccg62v3o2FEe6CD3YuIvtuuPH5rziLiOACntYkduR7v64kSRfvet1FXyws8Aoi DwFA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=9PHH/ZnQn9XiQzAx5OrNn25+/t6ajKjbIjxfreb9ZlQ=; fh=18Dn3Y5d8PJC8nep2FvYbdh0I51UAEv7qyWqmP1rRpE=; b=rW484ouTExZzAMI+GH8zxjliksRvGN6iWIrPh4cCDwtmwQzc1GDE5ZRSmvIs3H2Sum yJJTN6i9pdlioAdfM6eFKEcihSW8PkUmsLnLEIktsO4zvHFwe4P/XUHSUO0B7x7G+FHU nF/wuWpH5JhJVM+Ndu82ObCP750GWJojwEO5zYjpPmjZGXdk/tEk3IJUeCv4JowT2Y41 ifvGLuEWJs2faSzSa8QV6pib92+xST0N04KmBC/CHgdIUuWuFYszXn/YB1XZ961QlU4n 2OsAp0A3YEah2cuT+pqB8rKXiaMEgKRbc0zAsKLyWkaplBvMGfMi/hnx7/fGWAHQY7kw haow== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=hjWRHqAe; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id g24-20020a170906349800b00992e26642ddsi8998893ejb.251.2023.07.10.04.44.42; Mon, 10 Jul 2023 04:45:06 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=hjWRHqAe; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232317AbjGJL0r (ORCPT + 99 others); Mon, 10 Jul 2023 07:26:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40614 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232201AbjGJL0p (ORCPT ); Mon, 10 Jul 2023 07:26:45 -0400 Received: from mail-lf1-x12d.google.com (mail-lf1-x12d.google.com [IPv6:2a00:1450:4864:20::12d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8EA34E1 for ; Mon, 10 Jul 2023 04:26:44 -0700 (PDT) Received: by mail-lf1-x12d.google.com with SMTP id 2adb3069b0e04-4fb77f21c63so6647299e87.2 for ; Mon, 10 Jul 2023 04:26:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1688988403; x=1691580403; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=9PHH/ZnQn9XiQzAx5OrNn25+/t6ajKjbIjxfreb9ZlQ=; b=hjWRHqAegFnwe5jHxSz5I4oDy5cF8JoVVof72FZ6EzvV7MlLrUyXugv6wSn5ZbiHvu E2pYgHCue9Se2rhpDPb2Cic7yXmIPaRdc18UwzY6yDfOaykbVbyXkxGlc2GR5VFIpU32 FMJYiQtcNIlLLFTC1pZcuAHQDsagbfjQ64vjTBuK+wxN3OIuJtgt6p+dPXQPmFNRcAkA puyqHMLWOXfjAd9uiDEZHz/+BSabhwsBlMw/rFB09qFMmvOgA0QE9Yf8yWKu0mSp5uuR ZCtYXCKNOPrv9AcBIBoHlHYcuqDz+KIiy6uHjEKAleumJxTUDIR7nT4Z+XRICo3p4F6s Y7sQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1688988403; x=1691580403; h=content-transfer-encoding:in-reply-to: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=9PHH/ZnQn9XiQzAx5OrNn25+/t6ajKjbIjxfreb9ZlQ=; b=MjfxzSuz8LtkLIuyi0jaEJltSO2FSbxBzlOatN09S4CY09+C7/nao6B0WV62JJc20X gPa7zAg++e77/qeh278c0CWjBDokgGejzuImZX5ToVDuXGjB7vEQVSmxU+gglj3HEVlU I1yjbjIl5PdMNaEAGbsj2tv/2ZnkwRI9I8yDbyYcMNHKRQJrLhi3JbM+0kUM+SnA1I2r I2ZftGIeBOckXlFsZ3N/JUmukAd8jDbjXB+7iPCkeKSTXcSnOB8RxvCPr0LRzFv+SFfE fd8yXKjv85F84GRBPuGB5CiDyI3oRPU0yxHEM9buy2qyfY0HxmAJyEFMDkim7Jj6PlcN daBg== X-Gm-Message-State: ABy/qLZnM8UjMD9CZMgZp5gXzpHoPk2f0eNGkWfMKckhIDbfp4zbUxsK Kv4Z3IR/KvJzxC/wXhsvjArOVA== X-Received: by 2002:a19:e059:0:b0:4fb:8bad:1cdf with SMTP id g25-20020a19e059000000b004fb8bad1cdfmr9651035lfj.42.1688988402841; Mon, 10 Jul 2023 04:26:42 -0700 (PDT) Received: from ?IPV6:2001:14ba:a0db:1f00::8a5? (dzdqv0yyyyyyyyyyybcwt-3.rev.dnainternet.fi. [2001:14ba:a0db:1f00::8a5]) by smtp.gmail.com with ESMTPSA id w23-20020a19c517000000b004fbb1f70ceesm1647218lfe.227.2023.07.10.04.26.42 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 10 Jul 2023 04:26:42 -0700 (PDT) Message-ID: <25677836-9b06-b18e-ca91-87d87264355d@linaro.org> Date: Mon, 10 Jul 2023 14:26:41 +0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.12.0 Subject: Re: [PATCH v4 08/21] thermal/drivers/qcom/temp-alarm: convert to use devm_request*_irq_probe() Content-Language: en-GB To: Yangtao Li , Amit Kucheria , Thara Gopinath , Andy Gross , Bjorn Andersson , Konrad Dybcio , "Rafael J. Wysocki" , Daniel Lezcano , Zhang Rui Cc: Thomas Gleixner , Krzysztof Kozlowski , =?UTF-8?Q?Uwe_Kleine-K=c3=b6nig?= , Jonathan Cameron , AngeloGioacchino Del Regno , linux-arm-msm@vger.kernel.org, linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org References: <20230710095926.15614-1-frank.li@vivo.com> <20230710095926.15614-8-frank.li@vivo.com> From: Dmitry Baryshkov In-Reply-To: <20230710095926.15614-8-frank.li@vivo.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.2 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 10/07/2023 12:59, Yangtao Li wrote: > There are more than 700 calls to devm_request_threaded_irq method and > more than 1000 calls to devm_request_irq method. Most drivers only > request one interrupt resource, and these error messages are basically > the same. If error messages are printed everywhere, more than 2000 lines > of code can be saved by removing the msg in the driver. > > And tglx point out that: > > If we actually look at the call sites of > devm_request_threaded_irq() then the vast majority of them print more or > less lousy error messages. A quick grep/sed/awk/sort/uniq revealed > > 519 messages total (there are probably more) > > 352 unique messages > > 323 unique messages after lower casing > > Those 323 are mostly just variants of the same patterns with > slight modifications in formatting and information provided. > > 186 of these messages do not deliver any useful information, > e.g. "no irq", " > > The most useful one of all is: "could request wakeup irq: %d" > > So there is certainly an argument to be made that this particular > function should print a well formatted and informative error message. > > It's not a general allocator like kmalloc(). It's specialized and in the > vast majority of cases failing to request the interrupt causes the > device probe to fail. So having proper and consistent information why > the device cannot be used _is_ useful. > > So convert to use devm_request*_irq_probe() API, which ensure that all > error handling branches print error information. > > In this way, when this function fails, the upper-layer functions can > directly return an error code without missing debugging information. > Otherwise, the error message will be printed redundantly or missing. > > Cc: Thomas Gleixner > Cc: Krzysztof Kozlowski > Cc: "Uwe Kleine-König" > Cc: Jonathan Cameron > Cc: AngeloGioacchino Del Regno > Signed-off-by: Yangtao Li > --- > drivers/thermal/qcom/qcom-spmi-temp-alarm.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) Reviewed-by: Dmitry Baryshkov -- With best wishes Dmitry