From nobody Thu Apr 2 15:03:43 2026 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 A7623C54EE9 for ; Thu, 22 Sep 2022 13:50:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231557AbiIVNut (ORCPT ); Thu, 22 Sep 2022 09:50:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35342 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231908AbiIVNuW (ORCPT ); Thu, 22 Sep 2022 09:50:22 -0400 Received: from szxga01-in.huawei.com (szxga01-in.huawei.com [45.249.212.187]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A5A40AD9AD for ; Thu, 22 Sep 2022 06:50:06 -0700 (PDT) Received: from dggpemm500024.china.huawei.com (unknown [172.30.72.57]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4MYGl76tzSzlXMm; Thu, 22 Sep 2022 21:45:55 +0800 (CST) Received: from dggpemm100009.china.huawei.com (7.185.36.113) by dggpemm500024.china.huawei.com (7.185.36.203) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31; Thu, 22 Sep 2022 21:50:04 +0800 Received: from huawei.com (10.175.113.32) by dggpemm100009.china.huawei.com (7.185.36.113) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31; Thu, 22 Sep 2022 21:50:04 +0800 From: Liu Shixin To: Ingo Molnar , Peter Zijlstra , Juri Lelli , Vincent Guittot , Dietmar Eggemann , Steven Rostedt , Ben Segall , "Mel Gorman" , Daniel Bristot de Oliveira , Valentin Schneider CC: , Liu Shixin Subject: [PATCH] sched/debug: use DEFINE_SHOW_ATTRIBUTE to simplify sd_flags Date: Thu, 22 Sep 2022 22:23:47 +0800 Message-ID: <20220922142347.3247609-1-liushixin2@huawei.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Originating-IP: [10.175.113.32] X-ClientProxiedBy: dggems703-chm.china.huawei.com (10.3.19.180) To dggpemm100009.china.huawei.com (7.185.36.113) X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" Use DEFINE_SHOW_ATTRIBUTE helper macro to simplify the code. No functional change. Signed-off-by: Liu Shixin --- kernel/sched/debug.c | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/kernel/sched/debug.c b/kernel/sched/debug.c index 1637b65ba07a..45bc496c116e 100644 --- a/kernel/sched/debug.c +++ b/kernel/sched/debug.c @@ -360,18 +360,7 @@ static int sd_flags_show(struct seq_file *m, void *v) =20 return 0; } - -static int sd_flags_open(struct inode *inode, struct file *file) -{ - return single_open(file, sd_flags_show, inode->i_private); -} - -static const struct file_operations sd_flags_fops =3D { - .open =3D sd_flags_open, - .read =3D seq_read, - .llseek =3D seq_lseek, - .release =3D single_release, -}; +DEFINE_SHOW_ATTRIBUTE(sd_flags); =20 static void register_sd(struct sched_domain *sd, struct dentry *parent) { --=20 2.25.1