Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp7479229imu; Tue, 22 Jan 2019 06:44:12 -0800 (PST) X-Google-Smtp-Source: ALg8bN4JFLa6QDA9I9hcm71YkfcR4OdxcyCy+VQQX7utNu2Uw8D4PWn5YYDQoc0YFU2FY9N2zAuz X-Received: by 2002:a63:a452:: with SMTP id c18mr32470705pgp.204.1548168252462; Tue, 22 Jan 2019 06:44:12 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1548168252; cv=none; d=google.com; s=arc-20160816; b=cSO6wadjdologCuXAn7CIaI/IKaBN1mjfp/ODPiLh1y3Uxe6MafM2oswTpNh6gLt/h 8PVI5woQOxRlqC79fiYt7RcTs8wD9uIellZP8u47AITXgr/411RasYHRxLfXNBbHORo1 24uUQZSt36ECyRSCCVlCMxhRw9YV5IPovUiO5plJx/z+jItgoUoRxvEASwXf/ScUT7LC 3eETThRNZaMKJaTzQv+1XfC9woAnqNCMnJ2zXp7e/ZUDQkV89xGFpxNNRpIno+o77XZ3 m7OP/yna4q2c+BAyESbAWEOXt7cRlKJFpijqH3s/XXfdxbPeIbN5Ka3ge1VsPHHodhAI Cj5Q== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=wqITACXuw6uztEWkMRgjRb4twWM9PRpK6CtUBTgxG54=; b=PGKGjFikqRPzw0TMXG65ZVoq9FcedMgPP3mIL8I9UJ//nYAAw3xYnEM7dE1tXRv5Nb yaks12xpC2H+YMJ/6IWyNYx50yqUIZufIpJeb8rE7Zi/RToMatGz0l0i6B37XHQh1vQH DCWRQX1HAQajYmJq6dMehUWGTdc5edceNQPgFEMBU+uzutTj5RLDEOqY6uS8Jm1SqKGW wRM0UixegcAAEtYR4xomcTGrnOaFcmuF7RpPkUXZGhJe+rlZcRivF67PTM+s8vi5VoJE O/z3rQbyshRJZ/OJtRns8wRENL2F11fT6zUks6xf4X8ZdielG4BcDTeKipO6F1mHJa44 HTeg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=bRhhNgsR; 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 e4si14931097pgl.570.2019.01.22.06.43.56; Tue, 22 Jan 2019 06:44:12 -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; dkim=pass header.i=@kernel.org header.s=default header.b=bRhhNgsR; 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 S1728830AbfAVOl3 (ORCPT + 99 others); Tue, 22 Jan 2019 09:41:29 -0500 Received: from mail.kernel.org ([198.145.29.99]:53302 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728318AbfAVOl2 (ORCPT ); Tue, 22 Jan 2019 09:41:28 -0500 Received: from localhost (5356596B.cm-6-7b.dynamic.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 799EB20855; Tue, 22 Jan 2019 14:41:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1548168088; bh=+rMan51RaYrsGd1clsL6raIWizTKaNVX/cWyBz3I4IQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=bRhhNgsRJ4bBuopJ2XMvhNcv1Yv8fMrIb2/iM+yLQE76etYZrzqQj1/2dO0lNYcQd Z0fXSeWxf2dPklZ7x3HJPAqDBiG4mNLWzFDFLdt1u1jenTxzrlQxfPIXqHBafwNOOW ZENY9Q1Z6bAuUYFN6UVkb0/HGcG+F6GkD2vU2iRc= From: Greg Kroah-Hartman To: Catalin Marinas , Kevin Hilman , Russell King , Will Deacon Cc: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Greg Kroah-Hartman , Marc Zyngier , Peng Donglin Subject: [PATCH 1/4] arm64: dump: no need to check return value of debugfs_create functions Date: Tue, 22 Jan 2019 15:41:11 +0100 Message-Id: <20190122144114.9816-2-gregkh@linuxfoundation.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190122144114.9816-1-gregkh@linuxfoundation.org> References: <20190122144114.9816-1-gregkh@linuxfoundation.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org When calling debugfs functions, there is no need to ever check the return value. The function can work or not, but the code logic should never do something different based on this. Cc: Catalin Marinas Cc: Will Deacon Cc: Marc Zyngier Cc: Peng Donglin Cc: Signed-off-by: Greg Kroah-Hartman --- arch/arm64/include/asm/ptdump.h | 9 +++------ arch/arm64/mm/dump.c | 4 ++-- arch/arm64/mm/ptdump_debugfs.c | 7 ++----- 3 files changed, 7 insertions(+), 13 deletions(-) diff --git a/arch/arm64/include/asm/ptdump.h b/arch/arm64/include/asm/ptdump.h index 6afd8476c60c..9e948a93d26c 100644 --- a/arch/arm64/include/asm/ptdump.h +++ b/arch/arm64/include/asm/ptdump.h @@ -34,13 +34,10 @@ struct ptdump_info { void ptdump_walk_pgd(struct seq_file *s, struct ptdump_info *info); #ifdef CONFIG_ARM64_PTDUMP_DEBUGFS -int ptdump_debugfs_register(struct ptdump_info *info, const char *name); +void ptdump_debugfs_register(struct ptdump_info *info, const char *name); #else -static inline int ptdump_debugfs_register(struct ptdump_info *info, - const char *name) -{ - return 0; -} +static inline void ptdump_debugfs_register(struct ptdump_info *info, + const char *name) { } #endif void ptdump_check_wx(void); #endif /* CONFIG_ARM64_PTDUMP_CORE */ diff --git a/arch/arm64/mm/dump.c b/arch/arm64/mm/dump.c index fcb1f2a6d7c6..08c250350b8a 100644 --- a/arch/arm64/mm/dump.c +++ b/arch/arm64/mm/dump.c @@ -407,7 +407,7 @@ void ptdump_check_wx(void) static int ptdump_init(void) { ptdump_initialize(); - return ptdump_debugfs_register(&kernel_ptdump_info, - "kernel_page_tables"); + ptdump_debugfs_register(&kernel_ptdump_info, "kernel_page_tables"); + return 0; } device_initcall(ptdump_init); diff --git a/arch/arm64/mm/ptdump_debugfs.c b/arch/arm64/mm/ptdump_debugfs.c index 24d786fc3a4c..064163f25592 100644 --- a/arch/arm64/mm/ptdump_debugfs.c +++ b/arch/arm64/mm/ptdump_debugfs.c @@ -12,10 +12,7 @@ static int ptdump_show(struct seq_file *m, void *v) } DEFINE_SHOW_ATTRIBUTE(ptdump); -int ptdump_debugfs_register(struct ptdump_info *info, const char *name) +void ptdump_debugfs_register(struct ptdump_info *info, const char *name) { - struct dentry *pe; - pe = debugfs_create_file(name, 0400, NULL, info, &ptdump_fops); - return pe ? 0 : -ENOMEM; - + debugfs_create_file(name, 0400, NULL, info, &ptdump_fops); } -- 2.20.1