Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp961046pxb; Fri, 22 Jan 2021 03:49:42 -0800 (PST) X-Google-Smtp-Source: ABdhPJz3PKkS6wzzCA1ynB27VSNr7ni/DgEAwGSrkX4owjGeXYYeugN9zBJ1TIevVo+pBUQnEtAZ X-Received: by 2002:a05:6402:c9c:: with SMTP id cm28mr2963812edb.281.1611316181931; Fri, 22 Jan 2021 03:49:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1611316181; cv=none; d=google.com; s=arc-20160816; b=PhfIz2VbiByJ73mzki/ip7jXnYxxJOTAZis3ZgZ/ROhVyOn8NEhuMeYxw9LAAlqKSx JR6get1RIQOeIOqAOH1ooZA3t4c6sv3a0ypXl67Xxnob5Rsvyam8aYOFI9xosW7+XNOe FEHOdqT1HcHYciqRF6k4jtYMgU6MaJ5KguZ6D/fNZBd5gufkRCaFclSFT41GRc7Jxxwl +2XI71/BnHkfpzuK0Alz7S5/KawGMil9yDCRAoAUBfTK0gThIGZGqu+kDY/YGeabjSVS H38Kbu9qAwSA/G76ojxL9Nn+TumMls90xjqaTjpWq/VNLvWC2mOr+si2HxjsT5wUJdhJ 006g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:to:from; bh=XagIv9Z5A0HJAo/MEY1q5gbBodAm6QQ6ClpRGfYNNdw=; b=CrNYQ9Ccehztuc++URaE2GmzQOhcE4KNAtLRbk22sgk3cMPC4sih5WXzYSkIudscMH CK0oxuLcGMZKTyenw7JWpLOG/9DiHnkT6DUOOe2s5HzB2XErVe0IuKW9z5+GZHgHQRJ5 ao/KfdmBNJTXvVcZ+xh64Ye5MS/UmDQ1TB8lVBh6V79TsxuYCSF6dw4AvLh8FnsZ/R7n 6PyofGWuhVrPeJKwgRr8WQ5qqhS9thaXBQcMFs76/kuuayZSFYnRfKnOagWnrfyRyTQW 2P1iZIWErYNqIxzXSbXbzkiQUVqCCBBw96maYQR7kOl8GUBpmwUsyP1Vn7THU9pWkfVK rKQg== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id p18si2994502edx.541.2021.01.22.03.49.17; Fri, 22 Jan 2021 03:49:41 -0800 (PST) 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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727370AbhAVLqW (ORCPT + 99 others); Fri, 22 Jan 2021 06:46:22 -0500 Received: from mx2.suse.de ([195.135.220.15]:33734 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727200AbhAVLpl (ORCPT ); Fri, 22 Jan 2021 06:45:41 -0500 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id B81C4AB9F; Fri, 22 Jan 2021 11:44:52 +0000 (UTC) From: Thomas Bogendoerfer To: linux-mips@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] MIPS: vpe: Remove vpe_getcwd Date: Fri, 22 Jan 2021 12:44:49 +0100 Message-Id: <20210122114449.19423-1-tsbogend@alpha.franken.de> X-Mailer: git-send-email 2.29.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org I couldn't find any user of the dubious vpe_getcwd so far. So remove it and get rid of another set_fs(KERNEL_DS). Signed-off-by: Thomas Bogendoerfer --- arch/mips/include/asm/vpe.h | 3 --- arch/mips/kernel/vpe.c | 33 --------------------------------- 2 files changed, 36 deletions(-) diff --git a/arch/mips/include/asm/vpe.h b/arch/mips/include/asm/vpe.h index 80e70dbd1f64..baa949a744cb 100644 --- a/arch/mips/include/asm/vpe.h +++ b/arch/mips/include/asm/vpe.h @@ -26,7 +26,6 @@ #endif #define MAX_VPES 16 -#define VPE_PATH_MAX 256 static inline int aprp_cpu_index(void) { @@ -62,7 +61,6 @@ struct vpe { unsigned long len; char *pbuffer; unsigned long plen; - char cwd[VPE_PATH_MAX]; unsigned long __start; @@ -111,7 +109,6 @@ extern const struct file_operations vpe_fops; int vpe_notify(int index, struct vpe_notifications *notify); void *vpe_get_shared(int index); -char *vpe_getcwd(int index); struct vpe *get_vpe(int minor); struct tc *get_tc(int index); diff --git a/arch/mips/kernel/vpe.c b/arch/mips/kernel/vpe.c index d0d832ab3d3b..13294972707b 100644 --- a/arch/mips/kernel/vpe.c +++ b/arch/mips/kernel/vpe.c @@ -746,28 +746,12 @@ static int vpe_elfload(struct vpe *v) return 0; } -static int getcwd(char *buff, int size) -{ - mm_segment_t old_fs; - int ret; - - old_fs = get_fs(); - set_fs(KERNEL_DS); - - ret = sys_getcwd(buff, size); - - set_fs(old_fs); - - return ret; -} - /* checks VPE is unused and gets ready to load program */ static int vpe_open(struct inode *inode, struct file *filp) { enum vpe_state state; struct vpe_notifications *notifier; struct vpe *v; - int ret; if (VPE_MODULE_MINOR != iminor(inode)) { /* assume only 1 device at the moment. */ @@ -803,12 +787,6 @@ static int vpe_open(struct inode *inode, struct file *filp) v->plen = P_SIZE; v->load_addr = NULL; v->len = 0; - - v->cwd[0] = 0; - ret = getcwd(v->cwd, VPE_PATH_MAX); - if (ret < 0) - pr_warn("VPE loader: open, getcwd returned %d\n", ret); - v->shared_ptr = NULL; v->__start = 0; @@ -915,17 +893,6 @@ int vpe_notify(int index, struct vpe_notifications *notify) } EXPORT_SYMBOL(vpe_notify); -char *vpe_getcwd(int index) -{ - struct vpe *v = get_vpe(index); - - if (v == NULL) - return NULL; - - return v->cwd; -} -EXPORT_SYMBOL(vpe_getcwd); - module_init(vpe_module_init); module_exit(vpe_module_exit); MODULE_DESCRIPTION("MIPS VPE Loader"); -- 2.29.2