Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp4672944ybi; Sat, 6 Jul 2019 10:23:44 -0700 (PDT) X-Google-Smtp-Source: APXvYqwRuCvCANaTiDFf5rszKA2QvWsRkJbX/a1Plqjh+ROVr9srWyoakb6QJfkwSgj6YUgv8IfC X-Received: by 2002:a63:b346:: with SMTP id x6mr12066465pgt.218.1562433824002; Sat, 06 Jul 2019 10:23:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1562433823; cv=none; d=google.com; s=arc-20160816; b=P1MK4LSL2MxrtfAzBi2NDjNCSyd55VJvEa2FK5kBK77QftqGaWxY6qoWy1l/5iDVBE eIxdgA4Pnvf8UVOvKwz76i9M3cysjfAQT/7a88dh8WwfKBhBDSmhBLPkl80asFC/JRQf LggAUhOpjUCIbrHqxWqVy9kHfWwy72tPPJDiGv7O8EZvB0tFVFc8cLJv2jpTKqUnZKIj fLQtqcpXwG9sEeYOAqKErvoftbKN5+PcjiSeNmClKIdm66Oz6HXJPVRewcYbkLkx3F3T lCqLF8JZ2xYu6tsaD2cgnT0l19D25HG+NA6SYFBDe9/u1r0lLpxDJQz2/n7XFuv0+i9F /PUg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:user-agent:in-reply-to :content-disposition:mime-version:references:reply-to:subject:cc:to :from:date; bh=MNgtBSCRusM/1Az36Pz/lRsdNeCRW3R76ag28q4YKts=; b=br6VWxXl6eMyl3httBEnB5S7+uOciVvhD/K4yM5UsJqQACnbwwtbj35VH6Lybf5IBk /K0VDHFPDo1ig0DlUvcgeP9LZeAE7bBh1JH8PZtQ07e/Fd8iwfgi1GzMd7dfUs7o6s3C fKPyC5zuf+Xc0L6ikaPlp4qFVqM3LMROaae8ohbX1hh2OMunDcTSLItZCpm0uYKn7Wpa 8dyzy0+Sg+xE8AA9SJTVh/NF++9n2VFp0sQ3lOJeDhGBlBhpyeVrlQx5faBYqiNNKODP +lHtLgmGb3qUpvsP5eAv9Oce1n30DA9Ig2e371r9iNsZz4tvt2/hSuzjKis62dtr0RHZ +RiQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s123si11966736pgs.124.2019.07.06.10.23.28; Sat, 06 Jul 2019 10:23:43 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727063AbfGFRWb (ORCPT + 99 others); Sat, 6 Jul 2019 13:22:31 -0400 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:9680 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726698AbfGFRWb (ORCPT ); Sat, 6 Jul 2019 13:22:31 -0400 Received: from pps.filterd (m0098417.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id x66HLV6d049493 for ; Sat, 6 Jul 2019 13:22:29 -0400 Received: from e06smtp07.uk.ibm.com (e06smtp07.uk.ibm.com [195.75.94.103]) by mx0a-001b2d01.pphosted.com with ESMTP id 2tjqh33hhn-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Sat, 06 Jul 2019 13:22:29 -0400 Received: from localhost by e06smtp07.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Sat, 6 Jul 2019 18:22:28 +0100 Received: from b06cxnps4076.portsmouth.uk.ibm.com (9.149.109.198) by e06smtp07.uk.ibm.com (192.168.101.137) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256/256) Sat, 6 Jul 2019 18:22:26 +0100 Received: from b06wcsmtp001.portsmouth.uk.ibm.com (b06wcsmtp001.portsmouth.uk.ibm.com [9.149.105.160]) by b06cxnps4076.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id x66HMPsC22610094 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sat, 6 Jul 2019 17:22:25 GMT Received: from b06wcsmtp001.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 82336A405B; Sat, 6 Jul 2019 17:22:25 +0000 (GMT) Received: from b06wcsmtp001.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 4B7F9A405C; Sat, 6 Jul 2019 17:22:24 +0000 (GMT) Received: from linux.vnet.ibm.com (unknown [9.126.150.29]) by b06wcsmtp001.portsmouth.uk.ibm.com (Postfix) with SMTP; Sat, 6 Jul 2019 17:22:24 +0000 (GMT) Date: Sat, 6 Jul 2019 22:52:23 +0530 From: Srikar Dronamraju To: Markus Elfring Cc: kernel-janitors@vger.kernel.org, Ingo Molnar , Peter Zijlstra , LKML Subject: Re: [PATCH] sched/topology: One function call less in build_group_from_child_sched_domain() Reply-To: Srikar Dronamraju References: MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) X-TM-AS-GCONF: 00 x-cbid: 19070617-0028-0000-0000-000003817380 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 19070617-0029-0000-0000-00002441780D Message-Id: <20190706172223.GA12680@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2019-07-06_05:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=872 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1810050000 definitions=main-1907060230 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org * Markus Elfring [2019-07-06 16:05:17]: > From: Markus Elfring > Date: Sat, 6 Jul 2019 16:00:13 +0200 > > Avoid an extra function call by using a ternary operator instead of > a conditional statement. > > This issue was detected by using the Coccinelle software. > > Signed-off-by: Markus Elfring > --- > kernel/sched/topology.c | 6 +----- > 1 file changed, 1 insertion(+), 5 deletions(-) > > diff --git a/kernel/sched/topology.c b/kernel/sched/topology.c > index f751ce0b783e..6190eb52c30a 100644 > --- a/kernel/sched/topology.c > +++ b/kernel/sched/topology.c > @@ -886,11 +886,7 @@ build_group_from_child_sched_domain(struct sched_domain *sd, int cpu) > return NULL; > > sg_span = sched_group_span(sg); > - if (sd->child) > - cpumask_copy(sg_span, sched_domain_span(sd->child)); > - else > - cpumask_copy(sg_span, sched_domain_span(sd)); > - > + cpumask_copy(sg_span, sched_domain_span(sd->child ? sd->child : sd)); At runtime, Are we avoiding a function call? However I think we are avoiding a branch instead of a conditional, which may be beneficial. > atomic_inc(&sg->ref); > return sg; > } > -- > 2.22.0 > -- Thanks and Regards Srikar Dronamraju