Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

MIPS: vpe: Remove vpe_getcwd

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 <tsbogend@alpha.franken.de>

-36
-3
arch/mips/include/asm/vpe.h
··· 26 26 #endif 27 27 28 28 #define MAX_VPES 16 29 - #define VPE_PATH_MAX 256 30 29 31 30 static inline int aprp_cpu_index(void) 32 31 { ··· 61 62 unsigned long len; 62 63 char *pbuffer; 63 64 unsigned long plen; 64 - char cwd[VPE_PATH_MAX]; 65 65 66 66 unsigned long __start; 67 67 ··· 109 111 int vpe_notify(int index, struct vpe_notifications *notify); 110 112 111 113 void *vpe_get_shared(int index); 112 - char *vpe_getcwd(int index); 113 114 114 115 struct vpe *get_vpe(int minor); 115 116 struct tc *get_tc(int index);
-33
arch/mips/kernel/vpe.c
··· 746 746 return 0; 747 747 } 748 748 749 - static int getcwd(char *buff, int size) 750 - { 751 - mm_segment_t old_fs; 752 - int ret; 753 - 754 - old_fs = get_fs(); 755 - set_fs(KERNEL_DS); 756 - 757 - ret = sys_getcwd(buff, size); 758 - 759 - set_fs(old_fs); 760 - 761 - return ret; 762 - } 763 - 764 749 /* checks VPE is unused and gets ready to load program */ 765 750 static int vpe_open(struct inode *inode, struct file *filp) 766 751 { 767 752 enum vpe_state state; 768 753 struct vpe_notifications *notifier; 769 754 struct vpe *v; 770 - int ret; 771 755 772 756 if (VPE_MODULE_MINOR != iminor(inode)) { 773 757 /* assume only 1 device at the moment. */ ··· 787 803 v->plen = P_SIZE; 788 804 v->load_addr = NULL; 789 805 v->len = 0; 790 - 791 - v->cwd[0] = 0; 792 - ret = getcwd(v->cwd, VPE_PATH_MAX); 793 - if (ret < 0) 794 - pr_warn("VPE loader: open, getcwd returned %d\n", ret); 795 - 796 806 v->shared_ptr = NULL; 797 807 v->__start = 0; 798 808 ··· 892 914 return 0; 893 915 } 894 916 EXPORT_SYMBOL(vpe_notify); 895 - 896 - char *vpe_getcwd(int index) 897 - { 898 - struct vpe *v = get_vpe(index); 899 - 900 - if (v == NULL) 901 - return NULL; 902 - 903 - return v->cwd; 904 - } 905 - EXPORT_SYMBOL(vpe_getcwd); 906 917 907 918 module_init(vpe_module_init); 908 919 module_exit(vpe_module_exit);