Received: by 2002:a25:7ec1:0:0:0:0:0 with SMTP id z184csp4102093ybc; Tue, 26 Nov 2019 03:55:59 -0800 (PST) X-Google-Smtp-Source: APXvYqyKEgkCbyFUylbJ3ePy7txuSQkBVo8CNKM6apgjnC2p6Q3cT+WhDi04xsqHzc0LhrpG2aFB X-Received: by 2002:a50:85cb:: with SMTP id q11mr24467658edh.141.1574769359647; Tue, 26 Nov 2019 03:55:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1574769359; cv=none; d=google.com; s=arc-20160816; b=r1O8RzI0h8Oq54tvM+Thfq0YOqPbTmsVMxINY88JG07hSf6zAABLcQXCmiZjuJtSEm AWdZdgWcCzAcZjB7USBa2KvS+OHW95zL9Y3GByNNIBdAP4lZfNnyeULHsJvIC1s7HLyj fMV6q0OGj+UmM9guG5fxyIiw9VCdWdEW0peGkEWK5PmKenwyzHprTsVLtncLrc0K0rY6 HwCX1oEWKS9uPz1Bm1C7JUFmpyXYW51Dww+b9MNPdLqjBXZ02gK0Pbp24IK4wqXMOMxg L33KkFgbFZmmRG+HnhP83fdqe9E2aBKHDD1iJJpf8KuBVVvfYcL+bUXcEicFH90JJdgr S7XQ== 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 :message-id:date:subject:to:from; bh=sKax72pG/HegmIGbL8SpfrDOFu/vgse1rGa2Vrpispo=; b=Xb2c5dVmMLfa6HmEm0OXwLbDe/nRZspA77r+STENVywewuBvyd4yxy5GJyX1syzLyK NmVjjRJECfqBhO+LQYhUlp5YOGkS0iavAAjP05F4X9mD9k0qGWwkR/f0bcCtiQcbSIns vnLuyVUvLIpxqnBBSF8jmoTKvpBslqxAl53yiguJPrYNkOiB7DUDWN7KtxELYiCebkLP 0uyjWzxPh1rf3fTnnBc/52HOITOzvjGCZ6ttB8LRwg3OAsA9G2oXao8Y0xzw5ZGmEytI rMgBBk3tUHdeN542IfJ5BjXd0aE7UjEeFRFkfDgRnxVpKZBEJghorYttyiEYUIpKMsyS SwyA== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z16si7887108edd.314.2019.11.26.03.55.35; Tue, 26 Nov 2019 03:55:59 -0800 (PST) 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727586AbfKZJmt (ORCPT + 99 others); Tue, 26 Nov 2019 04:42:49 -0500 Received: from szxga07-in.huawei.com ([45.249.212.35]:39798 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727275AbfKZJmt (ORCPT ); Tue, 26 Nov 2019 04:42:49 -0500 Received: from DGGEMS414-HUB.china.huawei.com (unknown [172.30.72.58]) by Forcepoint Email with ESMTP id 208C286972AA68386C43; Tue, 26 Nov 2019 17:42:46 +0800 (CST) Received: from huawei.com (10.175.113.25) by DGGEMS414-HUB.china.huawei.com (10.3.19.214) with Microsoft SMTP Server id 14.3.439.0; Tue, 26 Nov 2019 17:42:38 +0800 From: Wang ShaoBo To: , , , , , , , , , Subject: [PATCH] sys_personality: Streamline code in sys_personality() Date: Tue, 26 Nov 2019 17:40:45 +0800 Message-ID: <20191126094045.134654-1-bobo.shaobowang@huawei.com> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Content-Transfer-Encoding: 7BIT Content-Type: text/plain; charset=US-ASCII X-Originating-IP: [10.175.113.25] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org SYSCALL_DEFINE1 in kernel/exec_domain.c looks like verbose, ksys_personality() can make it more concise. Signed-off-by: Wang ShaoBo --- kernel/exec_domain.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/kernel/exec_domain.c b/kernel/exec_domain.c index 33f07c5f2515..f7a0512ddc23 100644 --- a/kernel/exec_domain.c +++ b/kernel/exec_domain.c @@ -37,10 +37,5 @@ module_init(proc_execdomains_init); SYSCALL_DEFINE1(personality, unsigned int, personality) { - unsigned int old = current->personality; - - if (personality != 0xffffffff) - set_personality(personality); - - return old; + return ksys_personality(personality); } -- 2.20.1