From patchwork Mon Feb 20 23:28:54 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= X-Patchwork-Id: 655283 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 78390C64ED9 for ; Mon, 20 Feb 2023 23:29:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230215AbjBTX3A (ORCPT ); Mon, 20 Feb 2023 18:29:00 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45376 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229560AbjBTX27 (ORCPT ); Mon, 20 Feb 2023 18:28:59 -0500 Received: from todd.t-8ch.de (todd.t-8ch.de [IPv6:2a01:4f8:c010:41de::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 66ECC1ADD6; Mon, 20 Feb 2023 15:28:58 -0800 (PST) From: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=weissschuh.net; s=mail; t=1676935736; bh=StkVh8EYn2M8lSWQkOZpzSnkaM6UG2ix3NA2mU1ujSY=; h=From:Date:Subject:To:Cc:From; b=iAJ6zGNs8mV19KPRE+LcbkGoLi/C3uTrb5mwgwn1mE2ss9N96hiHYx/pQuWHVNiuP xea0JougjV9GDyPqGyYpme8ENRZDkr4mUmvk0hlBUbOfulvlXanoSaSuKjUKf6vgoo TNxwEnXVwfe53qZgTfg92VQMDBZbrPUon15wLjMI= Date: Mon, 20 Feb 2023 23:28:54 +0000 Subject: [PATCH] cpufreq: schedutil: make kobj_type structure constant MIME-Version: 1.0 Message-Id: <20230220-kobj_type-cpufreq-schedutil-v1-1-7d1c92293457@weissschuh.net> X-B4-Tracking: v=1; b=H4sIADUC9GMC/x2NQQ7CIBAAv9Ls2U0oNdX4FWMM0EVWCaVLMZqmf 5d4nDnMbFBImApcug2E3lx4Tg36QwcumPQg5KkxaKUHpbXC12yf9/WbCV2uXmjB4gJNdeWIp/P gRkuj9/0RWsGaQmjFJBdaI9UYm8xCnj//5fW27z+kgusTggAAAA== To: "Rafael J. Wysocki" , Viresh Kumar , Ingo Molnar , Peter Zijlstra , Juri Lelli , Vincent Guittot , Dietmar Eggemann , Steven Rostedt , Ben Segall , Mel Gorman , Daniel Bristot de Oliveira , Valentin Schneider Cc: linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, =?utf-8?q?Thomas?= =?utf-8?q?_Wei=C3=9Fschuh?= X-Mailer: b4 0.12.1 X-Developer-Signature: v=1; a=ed25519-sha256; t=1676935734; l=1114; i=linux@weissschuh.net; s=20221212; h=from:subject:message-id; bh=StkVh8EYn2M8lSWQkOZpzSnkaM6UG2ix3NA2mU1ujSY=; b=kckNIChEMWfa+1fhtlh3HkKTqDhrOfjAkr8fg1Naezsig+rJQP5STOBUTzSsi5m0NxS8oS79P u3bTu15MMNeCvItOKt9O0EAlsBFlmSvr5XsryJnXGd6h4ya0NIEuS2l X-Developer-Key: i=linux@weissschuh.net; a=ed25519; pk=KcycQgFPX2wGR5azS7RhpBqedglOZVgRPfdFSPB1LNw= Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org Since commit ee6d3dd4ed48 ("driver core: make kobj_type constant.") the driver core allows the usage of const struct kobj_type. Take advantage of this to constify the structure definition to prevent modification at runtime. Signed-off-by: Thomas Weißschuh --- kernel/sched/cpufreq_schedutil.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- base-commit: 5b0ed5964928b0aaf0d644c17c886c7f5ea4bb3f change-id: 20230220-kobj_type-cpufreq-schedutil-783c6be6ff14 Best regards, diff --git a/kernel/sched/cpufreq_schedutil.c b/kernel/sched/cpufreq_schedutil.c index 1207c78f85c1..4c073bd9b001 100644 --- a/kernel/sched/cpufreq_schedutil.c +++ b/kernel/sched/cpufreq_schedutil.c @@ -543,7 +543,7 @@ static void sugov_tunables_free(struct kobject *kobj) kfree(to_sugov_tunables(attr_set)); } -static struct kobj_type sugov_tunables_ktype = { +static const struct kobj_type sugov_tunables_ktype = { .default_groups = sugov_groups, .sysfs_ops = &governor_sysfs_ops, .release = &sugov_tunables_free,