topology.c (597473720f4dc69749542bfcfed4a927a43d935e) topology.c (eec4844fae7c033a0c1fc1eb3b8517aeb8b6cc49)
1// SPDX-License-Identifier: GPL-2.0
2/*
3 * Copyright IBM Corp. 2007, 2011
4 * Author(s): Heiko Carstens <heiko.carstens@de.ibm.com>
5 */
6
7#define KMSG_COMPONENT "cpu"
8#define pr_fmt(fmt) KMSG_COMPONENT ": " fmt

--- 573 unchanged lines hidden (view full) ---

582}
583early_param("topology", topology_setup);
584
585static int topology_ctl_handler(struct ctl_table *ctl, int write,
586 void __user *buffer, size_t *lenp, loff_t *ppos)
587{
588 int enabled = topology_is_enabled();
589 int new_mode;
1// SPDX-License-Identifier: GPL-2.0
2/*
3 * Copyright IBM Corp. 2007, 2011
4 * Author(s): Heiko Carstens <heiko.carstens@de.ibm.com>
5 */
6
7#define KMSG_COMPONENT "cpu"
8#define pr_fmt(fmt) KMSG_COMPONENT ": " fmt

--- 573 unchanged lines hidden (view full) ---

582}
583early_param("topology", topology_setup);
584
585static int topology_ctl_handler(struct ctl_table *ctl, int write,
586 void __user *buffer, size_t *lenp, loff_t *ppos)
587{
588 int enabled = topology_is_enabled();
589 int new_mode;
590 int zero = 0;
591 int one = 1;
592 int rc;
593 struct ctl_table ctl_entry = {
594 .procname = ctl->procname,
595 .data = &enabled,
596 .maxlen = sizeof(int),
590 int rc;
591 struct ctl_table ctl_entry = {
592 .procname = ctl->procname,
593 .data = &enabled,
594 .maxlen = sizeof(int),
597 .extra1 = &zero,
598 .extra2 = &one,
595 .extra1 = SYSCTL_ZERO,
596 .extra2 = SYSCTL_ONE,
599 };
600
601 rc = proc_douintvec_minmax(&ctl_entry, write, buffer, lenp, ppos);
602 if (rc < 0 || !write)
603 return rc;
604
605 mutex_lock(&smp_cpu_state_mutex);
606 new_mode = topology_get_mode(enabled);

--- 40 unchanged lines hidden ---
597 };
598
599 rc = proc_douintvec_minmax(&ctl_entry, write, buffer, lenp, ppos);
600 if (rc < 0 || !write)
601 return rc;
602
603 mutex_lock(&smp_cpu_state_mutex);
604 new_mode = topology_get_mode(enabled);

--- 40 unchanged lines hidden ---