Skip to content

Commit 1e3bece

Browse files
Eugeniy Paltsevvineetgarc
authored andcommitted
ARC: cleanup show_faulting_vma()
- Remove unused variables - check return value of file_path Signed-off-by: Eugeniy Paltsev <Eugeniy.Paltsev@synopsys.com> Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
1 parent c83532f commit 1e3bece

File tree

1 file changed

+4
-9
lines changed

1 file changed

+4
-9
lines changed

arch/arc/kernel/troubleshoot.c

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -83,9 +83,6 @@ static void print_task_path_n_nm(struct task_struct *tsk, char *buf)
8383
static void show_faulting_vma(unsigned long address, char *buf)
8484
{
8585
struct vm_area_struct *vma;
86-
struct inode *inode;
87-
unsigned long ino = 0;
88-
dev_t dev = 0;
8986
char *nm = buf;
9087
struct mm_struct *active_mm = current->active_mm;
9188

@@ -99,12 +96,10 @@ static void show_faulting_vma(unsigned long address, char *buf)
9996
* if the container VMA is not found
10097
*/
10198
if (vma && (vma->vm_start <= address)) {
102-
struct file *file = vma->vm_file;
103-
if (file) {
104-
nm = file_path(file, buf, PAGE_SIZE - 1);
105-
inode = file_inode(vma->vm_file);
106-
dev = inode->i_sb->s_dev;
107-
ino = inode->i_ino;
99+
if (vma->vm_file) {
100+
nm = file_path(vma->vm_file, buf, PAGE_SIZE - 1);
101+
if (IS_ERR(nm))
102+
nm = "?";
108103
}
109104
pr_info(" @off 0x%lx in [%s]\n"
110105
" VMA: 0x%08lx to 0x%08lx\n",

0 commit comments

Comments
 (0)