Received: by 2002:a05:7412:5112:b0:fa:6e18:a558 with SMTP id fm18csp15433rdb; Mon, 22 Jan 2024 10:21:27 -0800 (PST) X-Google-Smtp-Source: AGHT+IEzWMqqmWs+38c6cNTiOyWKJnAzxG2yz7ggeuk6hrpnezED0WyiCcrXP85B7i8napEHInSL X-Received: by 2002:a05:620a:f0c:b0:783:6904:dadc with SMTP id v12-20020a05620a0f0c00b007836904dadcmr5361703qkl.32.1705947687747; Mon, 22 Jan 2024 10:21:27 -0800 (PST) Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id bq38-20020a05620a46a600b007832c2e3b86si6569944qkb.672.2024.01.22.10.21.27 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 Jan 2024 10:21:27 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-33861-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@ibm.com header.s=pp1 header.b=DSnNcmsu; arc=fail (body hash mismatch); spf=pass (google.com: domain of linux-kernel+bounces-33861-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-33861-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=REJECT sp=NONE dis=NONE) header.from=ibm.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 6AACC1C29152 for ; Mon, 22 Jan 2024 18:20:45 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 9521F4A9A5; Mon, 22 Jan 2024 17:49:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=ibm.com header.i=@ibm.com header.b="DSnNcmsu" Received: from mx0b-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 54701495E3; Mon, 22 Jan 2024 17:49:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=148.163.158.5 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705945786; cv=none; b=RknEbh66KpHsEZKWWJBuNhLFFNukUo7fODeCMJHX2eA2YIdmx/TGz5KL823S+86OsmlWOG1bFaTp3u6I03tZjv84H9NREF9OWBT0Absk1CNpgRkg1S2nxg5G1XnDfNH1dcwctusmSj+uGUnD5ceFS8MtjXaKHBkZd09dvtkp1Pc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705945786; c=relaxed/simple; bh=nG0h0njV4VGRWsaIcjavmyFKkbPGR/fu35HnLKGJ070=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=EgJYbX1NTqWnYiR7rHbzlmXwWWrspZQjLpWv/SfpJiFJ8xIHuaUeD+S8EKOG+YfH/Bm7YDiwXnnUP1aWcnn8YutUdagpvGSpxyLM9SFfiA2oBx9pSRhgtvEqUdRi5WKs/bVW5sUzaIFaEKifPC/WSv/kGUjyL3cKzjS8MuKZ4QI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.ibm.com; spf=pass smtp.mailfrom=linux.ibm.com; dkim=pass (2048-bit key) header.d=ibm.com header.i=@ibm.com header.b=DSnNcmsu; arc=none smtp.client-ip=148.163.158.5 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.ibm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.ibm.com Received: from pps.filterd (m0353724.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 40MH2nti026019; Mon, 22 Jan 2024 17:49:17 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding; s=pp1; bh=1Ne24bSBSJimCOaeoAcIy2ONO23VE6PdmOvupNyNzoE=; b=DSnNcmsuy4ri755K69TtpDVmc5Q/VgIGbQ+T309nlqzRmcrv824xhMzmYKfiYVTRy2UW vgPkjIUc/hRAit9rECo7AJbGajZpv8xTV6iL+7h0gag8fI1gXP2olQJy7etDeDoDAyrx QA+ggy/64/kqxgBX+x0OazvUx//ocdpHl9NddcTGaNFHpdJqGTk8RtsDBgmvAbZ9BayB brprUttO32CAbq9xz+yhUEeHWWvd5bmlWQph1mk6arDNvV94sxSpOmEW+zzn+Ts+4nIW LNAVXP2h0QcTPR1fJnuvPWFmvdFZDBN9BxEqKveEW3jis+L4vbNe6X0co1N+djl3anjA mw== Received: from ppma12.dal12v.mail.ibm.com (dc.9e.1632.ip4.static.sl-reverse.com [50.22.158.220]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3vsvdu13w0-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 22 Jan 2024 17:49:17 +0000 Received: from pps.filterd (ppma12.dal12v.mail.ibm.com [127.0.0.1]) by ppma12.dal12v.mail.ibm.com (8.17.1.19/8.17.1.19) with ESMTP id 40MFq3Gg026507; Mon, 22 Jan 2024 17:49:16 GMT Received: from smtprelay04.fra02v.mail.ibm.com ([9.218.2.228]) by ppma12.dal12v.mail.ibm.com (PPS) with ESMTPS id 3vrrgt2ef4-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 22 Jan 2024 17:49:16 +0000 Received: from smtpav03.fra02v.mail.ibm.com (smtpav03.fra02v.mail.ibm.com [10.20.54.102]) by smtprelay04.fra02v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 40MHnEoJ24183512 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 22 Jan 2024 17:49:14 GMT Received: from smtpav03.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 69D832004B; Mon, 22 Jan 2024 17:49:14 +0000 (GMT) Received: from smtpav03.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id D49462004F; Mon, 22 Jan 2024 17:49:11 +0000 (GMT) Received: from li-c1fdab4c-355a-11b2-a85c-ef242fe9efb4.ibm.com.com (unknown [9.43.53.45]) by smtpav03.fra02v.mail.ibm.com (Postfix) with ESMTP; Mon, 22 Jan 2024 17:49:11 +0000 (GMT) From: Shrikanth Hegde To: linux-kernel@vger.kernel.org, linux-ntfs-dev@lists.sourceforge.net, linux-xfs@vger.kernel.org, linuxppc-dev@lists.ozlabs.org Cc: sshegde@linux.ibm.com, mpe@ellerman.id.au, mingo@kernel.org, peterz@infradead.org, chandan.babu@oracle.com, anton@tuxera.com, djwong@kernel.org Subject: [RFC PATCH v2 1/4] sched: remove duplicate ifdefs Date: Mon, 22 Jan 2024 23:19:01 +0530 Message-Id: <20240122174904.178594-2-sshegde@linux.ibm.com> X-Mailer: git-send-email 2.39.3 In-Reply-To: <20240122174904.178594-1-sshegde@linux.ibm.com> References: <20240122174904.178594-1-sshegde@linux.ibm.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-TM-AS-GCONF: 00 X-Proofpoint-GUID: 5b_zMLwzIuZ0dHzeKhc2UWiPZIzjQUK1 X-Proofpoint-ORIG-GUID: 5b_zMLwzIuZ0dHzeKhc2UWiPZIzjQUK1 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.1011,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2024-01-22_07,2024-01-22_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 bulkscore=0 adultscore=0 phishscore=0 spamscore=0 mlxscore=0 priorityscore=1501 impostorscore=0 mlxlogscore=935 suspectscore=0 clxscore=1015 malwarescore=0 lowpriorityscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2311290000 definitions=main-2401220124 when a ifdef is used in the below manner, second one could be considered as duplicate. ifdef DEFINE_A ..code block... ifdef DEFINE_A ..code block... endif ..code block... endif In the scheduler code, there are two places where above pattern can be observed. Hence second ifdef is a duplicate and not needed. Plus a minor comment update to reflect the else case. No functional change is intended here. It only aims to improve code readability. Signed-off-by: Shrikanth Hegde --- kernel/sched/core.c | 4 +--- kernel/sched/fair.c | 2 -- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/kernel/sched/core.c b/kernel/sched/core.c index 9116bcc90346..a76c7095f736 100644 --- a/kernel/sched/core.c +++ b/kernel/sched/core.c @@ -1792,7 +1792,6 @@ static void cpu_util_update_eff(struct cgroup_subsys_state *css); #endif #ifdef CONFIG_SYSCTL -#ifdef CONFIG_UCLAMP_TASK #ifdef CONFIG_UCLAMP_TASK_GROUP static void uclamp_update_root_tg(void) { @@ -1898,7 +1897,6 @@ static int sysctl_sched_uclamp_handler(struct ctl_table *table, int write, return result; } #endif -#endif static int uclamp_validate(struct task_struct *p, const struct sched_attr *attr) @@ -2065,7 +2063,7 @@ static void __init init_uclamp(void) } } -#else /* CONFIG_UCLAMP_TASK */ +#else /* !CONFIG_UCLAMP_TASK */ static inline void uclamp_rq_inc(struct rq *rq, struct task_struct *p) { } static inline void uclamp_rq_dec(struct rq *rq, struct task_struct *p) { } static inline int uclamp_validate(struct task_struct *p, diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index 533547e3c90a..8e30e2bb77a0 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c @@ -10182,10 +10182,8 @@ static int idle_cpu_without(int cpu, struct task_struct *p) * be computed and tested before calling idle_cpu_without(). */ -#ifdef CONFIG_SMP if (rq->ttwu_pending) return 0; -#endif return 1; } -- 2.39.3