Received: by 2002:a25:e74b:0:0:0:0:0 with SMTP id e72csp2016014ybh; Tue, 14 Jul 2020 13:14:52 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwxnplh1+bFhYJRJny094Ai8KW9hF0NSuCJSj7f5AiysOVULTHO0Js9Wg5yukIGTjaohmEj X-Received: by 2002:aa7:c545:: with SMTP id s5mr6119601edr.19.1594757692138; Tue, 14 Jul 2020 13:14:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1594757692; cv=none; d=google.com; s=arc-20160816; b=SkvcXLg1LCdAX5dl6Nt0iNoMtfJyl8mUGho+vW91Gr0nWOGFQjwSFblcMLNXr60Crn IGF0iOwp0M8IZVo85LgqLXjDheFJZQ0pZluylVekxnayLiXcBwuZAyeQroUl80I6lYK3 CRqJkPLFjqAHM365TNxUjgJhlHiXjD0TgHZpFcW+Yw26sRvbFuyr4txjFvS0M1GxRnTZ ycFyw1ZIBQJxqGHBbNrPK+DXCKEQ+rUfZWuAOvvkXCjd9UYvXSpx84zeJ2ch6AHBAlPk RcK0fwWsfK8MMTZjopbDc5rglInUNppUPKRsvBpVmDfbyt5jnBcenxMuYX5eeJMukTZk B0CA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=ySUbA5rzTLj3gy7j3X7tOY1gfV7BfEaidIIJe3idLBY=; b=hv8RdtrG4GzQTMjsS+hqBov0MEGmi2EvjM3vBA9eDMEZEQnlsnC10lkTYdlLaly3FY 3TvfwMZLgfrSRpphY0XDFzXjrwhD4DbHBrizIRwZ83N6wsHhSMYTSqp8lw2k4U5Y266V x17Sk7BjpKZ1z1W6Gsn/3fxWvxxmTrPMVh4fm+ef7CAsV7Pr87XxaIqCIG/aj7jNakfZ brUxcFb6Eli7iWAqUoN4pZhmvv2o3Q8bXE34wj549BuH0h9PTfLS/cGIp1GyRwD9QBWU 3TlOQzy9LdHc6GwTdgpv+lR4sWr8vjwI97fPS2BGfnagdZOvRFLDyetUoCe5vLcspNJ7 qk5g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2020-01-29 header.b=j7kSLWyr; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id s23si15005380edi.7.2020.07.14.13.14.28; Tue, 14 Jul 2020 13:14:52 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2020-01-29 header.b=j7kSLWyr; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729952AbgGNUOL (ORCPT + 99 others); Tue, 14 Jul 2020 16:14:11 -0400 Received: from userp2120.oracle.com ([156.151.31.85]:57720 "EHLO userp2120.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728777AbgGNUOJ (ORCPT ); Tue, 14 Jul 2020 16:14:09 -0400 Received: from pps.filterd (userp2120.oracle.com [127.0.0.1]) by userp2120.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 06EKCvQO124230; Tue, 14 Jul 2020 20:14:03 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding; s=corp-2020-01-29; bh=ySUbA5rzTLj3gy7j3X7tOY1gfV7BfEaidIIJe3idLBY=; b=j7kSLWyrEPk1ulvnKWoAYLlwAIU63uyY9e8796K2fUQJ+KLigyboCUV1DGYYTs5r7BTj kY4HIhtkL2vAtxPIPRE5nj1EYd64UNpMJTft13lRDC1z1wQ4jTSYuIjOjK9gneLos1gq 6cWXmX8qZfvQlOOz/kz2+r8I6Z/mMs8O0Mlqg3LNGW/pa0f4ephHcEF4FukeNNYDmFL5 pC4q6XyAKx+Bhqlo+B0qL5iV5XwemHl5yYUvgCJKpQLry66VGU0FVausRP4dVw76Cize DF9FAtga5Q7pxaSv81FIgB3Tr8PNxATgLBPk4W5ryPAgbPLDF9ulc/o/Szct6u82CQ0w Yw== Received: from aserp3020.oracle.com (aserp3020.oracle.com [141.146.126.70]) by userp2120.oracle.com with ESMTP id 32762nfgc2-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Tue, 14 Jul 2020 20:14:03 +0000 Received: from pps.filterd (aserp3020.oracle.com [127.0.0.1]) by aserp3020.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 06EKDZ2R129793; Tue, 14 Jul 2020 20:14:02 GMT Received: from aserv0122.oracle.com (aserv0122.oracle.com [141.146.126.236]) by aserp3020.oracle.com with ESMTP id 327qb54aa4-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 14 Jul 2020 20:14:02 +0000 Received: from abhmp0003.oracle.com (abhmp0003.oracle.com [141.146.116.9]) by aserv0122.oracle.com (8.14.4/8.14.4) with ESMTP id 06EKE1Hg003954; Tue, 14 Jul 2020 20:14:01 GMT Received: from localhost.localdomain (/98.229.125.203) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Tue, 14 Jul 2020 13:14:01 -0700 From: Daniel Jordan To: Herbert Xu , Steffen Klassert Cc: linux-crypto@vger.kernel.org, linux-kernel@vger.kernel.org, Daniel Jordan Subject: [PATCH 3/6] padata: inline single call of pd_setup_cpumasks() Date: Tue, 14 Jul 2020 16:13:53 -0400 Message-Id: <20200714201356.889176-4-daniel.m.jordan@oracle.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200714201356.889176-1-daniel.m.jordan@oracle.com> References: <20200714201356.889176-1-daniel.m.jordan@oracle.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9682 signatures=668680 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxlogscore=999 malwarescore=0 mlxscore=0 spamscore=0 phishscore=0 suspectscore=2 bulkscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2006250000 definitions=main-2007140141 X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9682 signatures=668680 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxscore=0 malwarescore=0 spamscore=0 clxscore=1015 priorityscore=1501 mlxlogscore=999 lowpriorityscore=0 bulkscore=0 suspectscore=2 phishscore=0 adultscore=0 impostorscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2006250000 definitions=main-2007140141 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org pd_setup_cpumasks() has only one caller. Move its contents inline to prepare for the next cleanup. Signed-off-by: Daniel Jordan Cc: Herbert Xu Cc: Steffen Klassert Cc: linux-crypto@vger.kernel.org Cc: linux-kernel@vger.kernel.org --- kernel/padata.c | 32 +++++++++----------------------- 1 file changed, 9 insertions(+), 23 deletions(-) diff --git a/kernel/padata.c b/kernel/padata.c index 8f55e717ba50b..27f90a3c4dc6b 100644 --- a/kernel/padata.c +++ b/kernel/padata.c @@ -441,28 +441,6 @@ static int padata_setup_cpumasks(struct padata_instance *pinst) return err; } -static int pd_setup_cpumasks(struct parallel_data *pd, - const struct cpumask *pcpumask, - const struct cpumask *cbcpumask) -{ - int err = -ENOMEM; - - if (!alloc_cpumask_var(&pd->cpumask.pcpu, GFP_KERNEL)) - goto out; - if (!alloc_cpumask_var(&pd->cpumask.cbcpu, GFP_KERNEL)) - goto free_pcpu_mask; - - cpumask_copy(pd->cpumask.pcpu, pcpumask); - cpumask_copy(pd->cpumask.cbcpu, cbcpumask); - - return 0; - -free_pcpu_mask: - free_cpumask_var(pd->cpumask.pcpu); -out: - return err; -} - static void __init padata_mt_helper(struct work_struct *w) { struct padata_work *pw = container_of(w, struct padata_work, pw_work); @@ -613,8 +591,14 @@ static struct parallel_data *padata_alloc_pd(struct padata_shell *ps) goto err_free_pqueue; pd->ps = ps; - if (pd_setup_cpumasks(pd, pcpumask, cbcpumask)) + + if (!alloc_cpumask_var(&pd->cpumask.pcpu, GFP_KERNEL)) goto err_free_squeue; + if (!alloc_cpumask_var(&pd->cpumask.cbcpu, GFP_KERNEL)) + goto err_free_pcpu; + + cpumask_copy(pd->cpumask.pcpu, pcpumask); + cpumask_copy(pd->cpumask.cbcpu, cbcpumask); padata_init_pqueues(pd); padata_init_squeues(pd); @@ -626,6 +610,8 @@ static struct parallel_data *padata_alloc_pd(struct padata_shell *ps) return pd; +err_free_pcpu: + free_cpumask_var(pd->cpumask.pcpu); err_free_squeue: free_percpu(pd->squeue); err_free_pqueue: -- 2.27.0