From patchwork Mon Aug 6 16:44:23 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eugeniy Paltsev X-Patchwork-Id: 953988 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.infradead.org (client-ip=2607:7c80:54:e::133; helo=bombadil.infradead.org; envelope-from=linux-snps-arc-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=synopsys.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="ALO804QG"; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=synopsys.com header.i=@synopsys.com header.b="OAcU0W8F"; dkim-atps=neutral Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 41kk5c0GTWz9s3q for ; Tue, 7 Aug 2018 02:44:51 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To: References:List-Owner; bh=bnk2eJAkXdoaxk0VVL1+nD6/5bBIrKZBhJ7/lluK8NE=; b=ALO 804QGeI6fVYpZCbOzKJCKUMgr8+xOOeu4GtS9/IcEpcciFpA1buNCJ8q1z70k2lqlnZTgQEjd1tvX 0rtHtQLthswcqq3qdRc5l2tItgIt3GDPNoqQu3D49q6stMv8KiWqgi1yL+i5QhK+IgICO5Q6WajuK ygJyQG+RpOlnE6Jbs7Zi/m3NjzOyUNxxD6cd7FU90jbELL8sFSt0bBqvvhfcW7fqAP7wcsKZm7J0O Cp+Ma/kQR5EQX/kOg9g6qW8mEczUcgt3tB+8C+NRBIZ4PBLzoQdH4Yns/fWidfgUzLAz2oNQdTV/x I7AcBLlPetjvCZI8+V/KCIZxR12JvlQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1fmicj-0002y9-MA; Mon, 06 Aug 2018 16:44:49 +0000 Received: from smtprelay4.synopsys.com ([198.182.47.9] helo=smtprelay.synopsys.com) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1fmicg-0002v2-5P for linux-snps-arc@lists.infradead.org; Mon, 06 Aug 2018 16:44:47 +0000 Received: from mailhost.synopsys.com (mailhost1.synopsys.com [10.12.238.239]) by smtprelay.synopsys.com (Postfix) with ESMTP id E078A24E0513; Mon, 6 Aug 2018 09:44:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=synopsys.com; s=mail; t=1533573874; bh=xusQBT7Tx5DnvNgWHCuXP4/Vag/vTHQUvbeKwVs2aCM=; h=From:To:Cc:Subject:Date:From; b=OAcU0W8FY45Tfe1jYcYp/uhGbSXEnub739xcxRjC4h1kGh0yo6HTZ9Igu7muUnx4D qTQBSdKSMmfzgB0hC0OEC1neXDJVKLunL11Bc38smUeYsBwYopf+3fZDTegFXl/ojn EJdeOyLzPyCjNnpD/O2vSF3tJ5Wj4lwRbHnGfGMTOtJjHKJoCvOzsxVQt4p9R26Cbj 7LFrnksRjObyAzwr9AlwJvhQy9nLdBo35p1EfNYwlE21w2Jwrl4q4m1efeNRlJIl7o C3b+ucEvi2yZpz9EqIgn0s8ZfefV4Xww42VKiEqHtBgMNyKZwFUDjxt/8CfmIh++r5 rVqiphymqCXyw== Received: from paltsev-e7480.internal.synopsys.com (unknown [10.121.8.86]) by mailhost.synopsys.com (Postfix) with ESMTP id DF0325155; Mon, 6 Aug 2018 09:44:31 -0700 (PDT) From: Eugeniy Paltsev To: linux-snps-arc@lists.infradead.org Subject: [PATCH 1/2] ARC: show_faulting_vma: remove unused variables Date: Mon, 6 Aug 2018 19:44:23 +0300 Message-Id: <20180806164424.32439-1-Eugeniy.Paltsev@synopsys.com> X-Mailer: git-send-email 2.14.4 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180806_094446_215507_25903DDE X-CRM114-Status: GOOD ( 10.57 ) X-Spam-Score: -0.1 (/) X-Spam-Report: SpamAssassin version 3.4.1 on bombadil.infradead.org summary: Content analysis details: (-0.1 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at http://www.dnswl.org/, no trust [198.182.47.9 listed in list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain X-BeenThere: linux-snps-arc@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Linux on Synopsys ARC Processors List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Vineet Gupta , Alexey Brodkin , Eugeniy Paltsev , linux-kernel@vger.kernel.org MIME-Version: 1.0 Sender: "linux-snps-arc" Errors-To: linux-snps-arc-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org We get 'inode', 'dev', and 'ino' in show_faulting_vma() but never use them. So get rid of this variables and corresponding code. Signed-off-by: Eugeniy Paltsev --- arch/arc/kernel/troubleshoot.c | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/arch/arc/kernel/troubleshoot.c b/arch/arc/kernel/troubleshoot.c index 783b20354f8b..f7330a3a1c4d 100644 --- a/arch/arc/kernel/troubleshoot.c +++ b/arch/arc/kernel/troubleshoot.c @@ -83,9 +83,6 @@ static void print_task_path_n_nm(struct task_struct *tsk, char *buf) static void show_faulting_vma(unsigned long address, char *buf) { struct vm_area_struct *vma; - struct inode *inode; - unsigned long ino = 0; - dev_t dev = 0; char *nm = buf; struct mm_struct *active_mm = current->active_mm; @@ -99,12 +96,8 @@ static void show_faulting_vma(unsigned long address, char *buf) * if the container VMA is not found */ if (vma && (vma->vm_start <= address)) { - struct file *file = vma->vm_file; - if (file) { - nm = file_path(file, buf, PAGE_SIZE - 1); - inode = file_inode(vma->vm_file); - dev = inode->i_sb->s_dev; - ino = inode->i_ino; + if (vma->vm_file) { + nm = file_path(vma->vm_file, buf, PAGE_SIZE - 1); } pr_info(" @off 0x%lx in [%s]\n" " VMA: 0x%08lx to 0x%08lx\n", From patchwork Mon Aug 6 16:44:24 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eugeniy Paltsev X-Patchwork-Id: 953987 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.infradead.org (client-ip=2607:7c80:54:e::133; helo=bombadil.infradead.org; envelope-from=linux-snps-arc-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=synopsys.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="WEZJrjsq"; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=synopsys.com header.i=@synopsys.com header.b="AjNi6Kpo"; dkim-atps=neutral Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 41kk5b4Dd7z9s0R for ; Tue, 7 Aug 2018 02:44:51 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=AkLOdJ9f61au/LV4bRN7CqpiQuVNAydwea142i9fUwQ=; b=WEZJrjsqRSUUc1Kl6oDYsQ+AnX l5pCROTU5mp36GSuUJlshJfgyjVbNss/ChPaSpzYYlDPUD5++cvdLA8EZ3WeF/s/VglqyOYpQOIJM LZBVf0QsyiNHSwrKnkuc0P1WdpdYTG8eI6dyn0TQF487drS90X3euQP1Gz/G6a7c+i6uehkQXa8N3 7nGeZiZTePg9zlIL1kj6IVtHa4m9DOqyyyty0w7xeBJFX8ouybCdV/qQSob4ZBNKp8sSst3pdDe+e Dqhnh+jgjCi8GcmDZ4wBjR7E/OadmYeXTIpgMDJJfoJkO9yBEcAaSTATb5xLekINSYTbzYrJvvFa+ oR/1bw+Q==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1fmicj-0002xt-H2; Mon, 06 Aug 2018 16:44:49 +0000 Received: from smtprelay4.synopsys.com ([198.182.47.9] helo=smtprelay.synopsys.com) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1fmicg-0002vq-5O for linux-snps-arc@lists.infradead.org; Mon, 06 Aug 2018 16:44:47 +0000 Received: from mailhost.synopsys.com (mailhost1.synopsys.com [10.12.238.239]) by smtprelay.synopsys.com (Postfix) with ESMTP id ED94D24E058D; Mon, 6 Aug 2018 09:44:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=synopsys.com; s=mail; t=1533573878; bh=knN/abJGsjdg7sgOehcHLn36pMRzOAIZnen4sArnVzs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=AjNi6KpogeQZzh7CNVm6D1H0yRhy5N6efm8DrcBmWS9fkD4qU4XSpcQUepvtN6Pki qshxKMkP3/GWOIqy6TqFRfpLpqBqaw+ciTKQ0GDvgrRyGWRTlsx1vRUwnd2p6ZI/qy IFgM7SzhU30tR4OXuNsvtpAXQ9tDRmNdwG43AO5dQkoXFUZKOdsuDTbZcSylqiFsB0 OzSzW0AqoS7F9612YMmDSWBEz8AjebvnaEP0lRTqcookmh6YNLtIiP5+e1x72fqm3A zI6hyNeyh3F2K3aQUKDU3LXD37DbDjwzCQzU7A9bIAW5W2yAyah1glQCN+6ZEAy7rr TJoG/XbvAPRPg== Received: from paltsev-e7480.internal.synopsys.com (unknown [10.121.8.86]) by mailhost.synopsys.com (Postfix) with ESMTP id 36E1B522D; Mon, 6 Aug 2018 09:44:36 -0700 (PDT) From: Eugeniy Paltsev To: linux-snps-arc@lists.infradead.org Subject: [PATCH 2/2] ARC: show_faulting_vma: check file_path for error Date: Mon, 6 Aug 2018 19:44:24 +0300 Message-Id: <20180806164424.32439-2-Eugeniy.Paltsev@synopsys.com> X-Mailer: git-send-email 2.14.4 In-Reply-To: <20180806164424.32439-1-Eugeniy.Paltsev@synopsys.com> References: <20180806164424.32439-1-Eugeniy.Paltsev@synopsys.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180806_094446_215507_8E6DCB37 X-CRM114-Status: UNSURE ( 8.17 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -0.1 (/) X-Spam-Report: SpamAssassin version 3.4.1 on bombadil.infradead.org summary: Content analysis details: (-0.1 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at http://www.dnswl.org/, no trust [198.182.47.9 listed in list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain X-BeenThere: linux-snps-arc@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Linux on Synopsys ARC Processors List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Vineet Gupta , Alexey Brodkin , Eugeniy Paltsev , linux-kernel@vger.kernel.org MIME-Version: 1.0 Sender: "linux-snps-arc" Errors-To: linux-snps-arc-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org Return value of file_path() should be validated with IS_ERR() macro. Generic print_vma_addr() implementation was used as an example. Signed-off-by: Eugeniy Paltsev --- arch/arc/kernel/troubleshoot.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/arch/arc/kernel/troubleshoot.c b/arch/arc/kernel/troubleshoot.c index f7330a3a1c4d..e8d9fb452346 100644 --- a/arch/arc/kernel/troubleshoot.c +++ b/arch/arc/kernel/troubleshoot.c @@ -98,6 +98,8 @@ static void show_faulting_vma(unsigned long address, char *buf) if (vma && (vma->vm_start <= address)) { if (vma->vm_file) { nm = file_path(vma->vm_file, buf, PAGE_SIZE - 1); + if (IS_ERR(nm)) + nm = "?"; } pr_info(" @off 0x%lx in [%s]\n" " VMA: 0x%08lx to 0x%08lx\n",