Received: by 2002:a05:6a10:144:0:0:0:0 with SMTP id 4csp874113pxw; Sat, 9 Apr 2022 03:37:10 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxLynBlW+iwoBIoSHuJHZpqJFR8apRD/4ymJDkRwYMylTVhq9gpLrRaNZCCxrrENVNx3LxA X-Received: by 2002:a17:907:7255:b0:6e8:5b68:fbd5 with SMTP id ds21-20020a170907725500b006e85b68fbd5mr5416900ejc.465.1649500629579; Sat, 09 Apr 2022 03:37:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649500629; cv=none; d=google.com; s=arc-20160816; b=v4T7AArLN6hQtCA9u2xPtdqdgavRYofv+leB1SppqArf25ApQUwN6sX4IFQtZ0O2L0 ks5grN66pudQEzOky6gqcQlQ75H3DF3sk/puUyLGhzprvI7mhX3wnsIB6SUs2wOybol4 UhrPz+laBxmKyOv/2I8wC0rXLzMX4/S/mHPLrQo3EsyV9zGFaUOs4/a2r+LgXIYPtf5R rmyVOLXg7p8zh7FmhlgnH1DvKFYaOcrvqG5i4KaYuy7OrJ6I0nvfwV+IIvI9SPbLH3wE et9meqAWZ8kR8gFJrQFvCFVryr1NU7tlcHPr4OuXpN7tU6FfAa1dQMsXZi2X/tSGfPrp Eo6Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-disposition:mime-version:message-id :subject:cc:to:from:date:dkim-signature; bh=wNWEcSrKlxJuH4GZJyDl7c4LCfxhxQo771KnU/vvIE4=; b=M1wKr/FcxWXc/dMEphW6aDa4yNcGbPYdL8aCz9mWmg1K145faR4t1JPpNDCX17IYH+ ioas96EMSo0bykdNIIzbd8MDO/CY0Ov4hy1270DtrMcvRF5a3Y5S6ZS+iNTEN+zmnZps guK37JanfnsgrF6PvkYBgNNQTYn47MdCES6TXZQSFx1Yit1743aTRkYJiP1vO9oEdBN4 7CeNp3RPnFc1YF3MYn4ZYnK3GzSpQd+0MFCj0Vy84lFowRZYmeEY0se4n4XT/7ylqtaV lH1VGyrhkOTOwwq5qdlcLS3auRTuAy/A8THMJlNkcr30y2ImR8F04RPVPeiK9klZjPqE diHA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=mJx4btV8; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id n16-20020a05640205d000b0041d70a78d71si269325edx.105.2022.04.09.03.36.12; Sat, 09 Apr 2022 03:37:09 -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=@gmail.com header.s=20210112 header.b=mJx4btV8; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234979AbiDHLn7 (ORCPT + 99 others); Fri, 8 Apr 2022 07:43:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36926 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231938AbiDHLn6 (ORCPT ); Fri, 8 Apr 2022 07:43:58 -0400 Received: from mail-pl1-x62d.google.com (mail-pl1-x62d.google.com [IPv6:2607:f8b0:4864:20::62d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 46664185031 for ; Fri, 8 Apr 2022 04:41:55 -0700 (PDT) Received: by mail-pl1-x62d.google.com with SMTP id f10so7630914plr.6 for ; Fri, 08 Apr 2022 04:41:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=date:from:to:cc:subject:message-id:mime-version:content-disposition; bh=wNWEcSrKlxJuH4GZJyDl7c4LCfxhxQo771KnU/vvIE4=; b=mJx4btV80XGeJpkYkKhUPa+zAaEkD5oe/5qBgfaYaZ58esY9JlS4mqBWm1igbZBRvf O5ptWnbbEBMCjE5NSXWDg3yOdsRfcibc7BpN+zMLn+eed66o7kqm7sAj9HxwOEkVl5rJ GR7HKJ2JAIWNbdEG7zd1r/tw+P2utwWyCdM6d2lUqJdlCIdCxjGWgMyfWJ0Cr20d80q9 XdCpAXIfOYTdlHqpxwxxr4p/4ma9roQm4LaYD4/olmciglNduNYoSPbPfFtBvKk/5wO3 9kvLx5R+/La416VYS9EhezUzJi7msyTSbe+9AFd+ujBFp1oeHZQS4d1bo0NMMllnzDdR CE5A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:mime-version :content-disposition; bh=wNWEcSrKlxJuH4GZJyDl7c4LCfxhxQo771KnU/vvIE4=; b=U8PLYZPEeQNeNrcXlpDcTmRPjLK+K4vTEgteXZn/cin6JNc6nLfSN4TRGl37filgU6 nl3I+7wCrDHHvUjRWwvdKtAl39gxq/Bw4Oq0ZIiFwM6zdjtgqpPs5/2hKleS4n+NHKPj wQ/R3ej/nzdvfEKakOx9Zyg40svkv1cIRYRugrrsb+Q3nJXG8GSnCqJqQ3bPDiIRmiMq rGqiGNthJVoQOxLvPAnTNSeh6kGSvkK6zVs0nw4cDMjcgVOMjU8w0/vx03JVzGI/5KfA n73YrwY+IJdeCKFWNVhWERab9f1AYqukYc+CRSQQ/L74chWnjTQIz3L8TeBvyhhVONaI GGNw== X-Gm-Message-State: AOAM5300Fb9SGmzUN8HyOrgBDYX6QVtVtaPzV5IC+XyAQsYcjRRnaYb2 YuV2tU7j2lSyevhUejAGqVk= X-Received: by 2002:a17:90b:1e47:b0:1c6:d5a9:b147 with SMTP id pi7-20020a17090b1e4700b001c6d5a9b147mr21204158pjb.223.1649418114706; Fri, 08 Apr 2022 04:41:54 -0700 (PDT) Received: from localhost ([118.33.58.238]) by smtp.gmail.com with ESMTPSA id 8-20020a056a00070800b004e14ae3e8d7sm24425953pfl.164.2022.04.08.04.41.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 08 Apr 2022 04:41:54 -0700 (PDT) Date: Fri, 8 Apr 2022 20:41:53 +0900 From: Paran Lee To: Thomas Gleixner Cc: linux-kernel@vger.kernel.org, Craig Gallek , Austin Kim Subject: [PATCH] genirq: Refactor actions_show loop block using a common macro to go through the actions list Message-ID: <20220408114153.GA1955@DESKTOP-S4LJL03.localdomain> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, 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 Hello, I am Paran Lee. Since we have a macro defined in our IRQ subsystem internal functions to traverse the list of actions, how about refactoring this loop? - genirq: Use a common macro to go through the actions list (f944b5a7aff05a244a6c8cac297819af09a199e4) have a good day! Paran Lee. Signed-off-by: Paran Lee --- kernel/irq/irqdesc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/kernel/irq/irqdesc.c b/kernel/irq/irqdesc.c index 939d21cd55c3..34a0cefff712 100644 --- a/kernel/irq/irqdesc.c +++ b/kernel/irq/irqdesc.c @@ -246,12 +246,12 @@ static ssize_t actions_show(struct kobject *kobj, struct kobj_attribute *attr, char *buf) { struct irq_desc *desc = container_of(kobj, struct irq_desc, kobj); - struct irqaction *action; + struct irqaction *action = NULL; ssize_t ret = 0; char *p = ""; raw_spin_lock_irq(&desc->lock); - for (action = desc->action; action != NULL; action = action->next) { + for_each_action_of_desc(desc, action) { ret += scnprintf(buf + ret, PAGE_SIZE - ret, "%s%s", p, action->name); p = ","; -- 2.25.1