Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp35296961rwd; Mon, 10 Jul 2023 05:38:19 -0700 (PDT) X-Google-Smtp-Source: APBJJlGe/VYetIStPJkcQZba0373HeudlzwYFMtb3eSSQv0Wh6TPMXrU/5hTNu3IIjbQP9o4FFjM X-Received: by 2002:a17:906:113:b0:993:f349:c987 with SMTP id 19-20020a170906011300b00993f349c987mr6774704eje.2.1688992698745; Mon, 10 Jul 2023 05:38:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688992698; cv=none; d=google.com; s=arc-20160816; b=PDTWl8SzuPoGvhqGx4j47TuD/1qG8z/ZB8jhibSqtlNcB0zEsfXQF3V5Z7abh53PN/ aRXRS51OoeVb+KYCY9MATwU+G/z5XTlHfQm4FKP5JUxaYyzUXe8ILxMuI91N8UjkRs3a ttWAK7wJShw043rWObJFSY/KhQpL63yhsQmpn5mYEq2p918HCStIhoJ1RXJKNLmIalua HXA98osKS7HdQV+meLtC/TSTQ/gWray1bpyGIpCJKeBAhLR0obRflSRqDD2RUVGpZSRJ MCEFIyhRwcV8uwef59KFCsUSvtPptzvSoXRMHD6sWqvwD2XLROK/KrH0sOGfB5Ta8JFr 91MQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version; bh=hBe0+YoZzvHEzEksxdsL/vzkFcUEwmaCTENC3d3tbHM=; fh=w3hZDb5lel4yqpy/n697K4hpRwvXgtZih33p5YyP7Ns=; b=x+AknBikJbO5wRx0pMRG9mZwMS9F9AXK7UEJeTohfuzvHzXzc7qAmAj49+8Ac25XRw Q5y0XLkSNmbX91n2BZ5/My6UUMAWKClS76ZIq2wa/2Ova9C74YbdEw32ZvtjNF7ltrbU jlgd09YefegFGYv1E4iHEyA7yIZrFcabzoe4X2fjZpS2HXkd4Rnmm7tHtIvi69eMIPKj /rbnDDzl/W5LaN1phrZrYDg7WRzQIqwe2aPAZ+1B9MUH9q1wcfCgmuTZWlEXOaUlEIbW XNXL7ZvY5cgotdOdxsCsEau8Rak3IX5cPbIpjUfW4RLsuCU94PtCdUunx+ZTwTMbvWoN ao4w== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id k17-20020a170906055100b009885c5f1d7asi8280642eja.319.2023.07.10.05.37.53; Mon, 10 Jul 2023 05:38:18 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231625AbjGJM11 convert rfc822-to-8bit (ORCPT + 99 others); Mon, 10 Jul 2023 08:27:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34524 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229848AbjGJM10 (ORCPT ); Mon, 10 Jul 2023 08:27:26 -0400 Received: from mail-yb1-f181.google.com (mail-yb1-f181.google.com [209.85.219.181]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 33E73B1; Mon, 10 Jul 2023 05:27:25 -0700 (PDT) Received: by mail-yb1-f181.google.com with SMTP id 3f1490d57ef6-c15a5ed884dso5189995276.2; Mon, 10 Jul 2023 05:27:25 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1688992044; x=1691584044; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=3C5/GxdOTSlGprN5fpWAYyQzVkP9RkeiGRt79KEKJV0=; b=DxbA6SuYGMgWLuYHx95pmcwlkZbqbaRP7MARpwj7evY+FvPMvXXHMwEFtjAHPG1QJJ uw/NUTfMquBhJG0YOOz5Nk538V3L+grqawIWLquLTY1yMoNRGfWXn4hbWRf3hR2hnRRT tfjGCWXke9jrnTLlnwDIce3M8G2hfotA6bMwB8t+aacIwyW1sCwoUzu7+FiRzwpujNvw YCQD630frD4SHmIvdW2xBNzpKFEmlbDXcS4f6o/Vl8AaQtYiAa2pP1LdtyXlshG3KOdd +PcVYGkQmFNuARYSzma/OhC5cMobCcOxXidPMUgT2J9dpK+/0HE6JTlhI9NoXb4j99Rw jFsg== X-Gm-Message-State: ABy/qLbLNIdbf4l5T4+9bhD2kEu56CXdNmDrOconWqSqhHUJVhzHJLbg KjAklp6tj3SR/qHMFkNd+xynj/pPcoVzdA== X-Received: by 2002:a25:1657:0:b0:bad:125f:9156 with SMTP id 84-20020a251657000000b00bad125f9156mr9983466ybw.35.1688992044203; Mon, 10 Jul 2023 05:27:24 -0700 (PDT) Received: from mail-yb1-f175.google.com (mail-yb1-f175.google.com. [209.85.219.175]) by smtp.gmail.com with ESMTPSA id x63-20020a25ce42000000b00c5f99a71eaasm2605732ybe.57.2023.07.10.05.27.23 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 10 Jul 2023 05:27:23 -0700 (PDT) Received: by mail-yb1-f175.google.com with SMTP id 3f1490d57ef6-c5ce57836b8so5202300276.1; Mon, 10 Jul 2023 05:27:23 -0700 (PDT) X-Received: by 2002:a25:d895:0:b0:bac:fecf:43d0 with SMTP id p143-20020a25d895000000b00bacfecf43d0mr10694122ybg.10.1688992042808; Mon, 10 Jul 2023 05:27:22 -0700 (PDT) MIME-Version: 1.0 References: <20230710095926.15614-1-frank.li@vivo.com> <20230710095926.15614-7-frank.li@vivo.com> In-Reply-To: <20230710095926.15614-7-frank.li@vivo.com> From: Geert Uytterhoeven Date: Mon, 10 Jul 2023 14:27:10 +0200 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v4 07/21] thermal/drivers/rcar: convert to use devm_request*_irq_probe() To: Yangtao Li Cc: =?UTF-8?Q?Niklas_S=C3=B6derlund?= , "Rafael J. Wysocki" , Daniel Lezcano , Amit Kucheria , Zhang Rui , Thomas Gleixner , Krzysztof Kozlowski , =?UTF-8?Q?Uwe_Kleine=2DK=C3=B6nig?= , Jonathan Cameron , AngeloGioacchino Del Regno , linux-renesas-soc@vger.kernel.org, linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8BIT X-Spam-Status: No, score=-1.4 required=5.0 tests=BAYES_00, FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=no 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 Mon, Jul 10, 2023 at 12:07 PM 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 Reviewed-by: Geert Uytterhoeven Gr{oetje,eeting}s, Geert -- Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that. -- Linus Torvalds