From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id B9F81EB64DA for ; Mon, 10 Jul 2023 11:26:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232323AbjGJL0q (ORCPT ); Mon, 10 Jul 2023 07:26:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40616 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232317AbjGJL0p (ORCPT ); Mon, 10 Jul 2023 07:26:45 -0400 Received: from mail-lf1-x132.google.com (mail-lf1-x132.google.com [IPv6:2a00:1450:4864:20::132]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 90BB4E3 for ; Mon, 10 Jul 2023 04:26:44 -0700 (PDT) Received: by mail-lf1-x132.google.com with SMTP id 2adb3069b0e04-4fafe87c6fbso6651731e87.3 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=SRoYgBqmMFXmjbTBLAng415UTieq/5+C+PX1QxqjO05Nly0Hk7SQ/G7yrdQnB0fiie yf5P6pkWncz/73kwYnpVe23ARnHXyBhpu4mcjLgrjAR+dsM16YoaOb0ZHnILSvn1Mg/k pe1dtqNC7E76KX4oIKw/IN8R3iFu9dS1UoxrMY/Z5XljGQuvCAvKgHlbeBhgzUH/y2+G qh3NmXSrig+KBiI6bCWa68zFhZ026qku4JtsdrNpYeFxQkFL4FX26ZKeY+EK2xoAFzIm lgTSteLQG5yrzfjbxfG3QRZELYOU5Dc1wUUqSTIBgp1VHBKYzttSZC4wW1ILxghOD3Up t+AQ== X-Gm-Message-State: ABy/qLa7wn0s5d0An97eDe29nJSUHz7zILpM3bR1cCZDJPpCDgQ9WF26 GM0uQ4LNt64n9lDMDK0EALdWog== X-Google-Smtp-Source: APBJJlEeYNvW984z8M7COsLRHwgjawoIMPhEQJdaoXLE5Yd3J+Ss9uQOMnJyZyA+INIs9PHMTMcukA== 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 Precedence: bulk List-ID: X-Mailing-List: linux-pm@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