Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp7478311imu; Tue, 22 Jan 2019 06:43:15 -0800 (PST) X-Google-Smtp-Source: ALg8bN5B+euAJJXeJ2gN6pUSEWO0WdPIIHEUzNR6nGgcQiuE5UrTQu6cpY+txlz/MBFh5C+NZtmc X-Received: by 2002:a62:5ec5:: with SMTP id s188mr33140226pfb.145.1548168195045; Tue, 22 Jan 2019 06:43:15 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1548168195; cv=none; d=google.com; s=arc-20160816; b=O+VvXiB/QTHT1jq+SaooqOBG3x+zS0eRtddQgNPgu8fXeVEyY4c3iGe1xsslSwZK1i bj06vnDyfe/D5I2TWqTw/tL0Bs52vfAS7wjjuv42FaoddJ9KXjr/7lhhIEhSIhlP9oFH 5HwO6zqiyEYHdY6h8W8Rw+uhfguI/NdU/uf5SvEbJyEQIFoWPfxsw0k/5jvPqyaX4L58 8UVM9srSfROtFccnqnznpcuTV8/vAI6UTIHkPz3pizn4yexSPWp39rgDnIYSZuYVA4R7 yeDMp5RzUBHxRINWl+DLiFUmy8Tg/TcrDtamomoZK1EXluNI+YpOyfVIDnYZ+APglNgf +pBg== 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=jDLnmaQmPnAEq+jP7FgA6FNpktnMo3Tg0bZ+82VlpYY=; b=UrrjiuMSxBhiUL1GY8FNsXAHl9P0VRf5OD1xF4vKv8eKyFhhplJ96EPb1dydS8PTwO Pjbtq+7r815/p6xCuDrnsg9M2+VtEH6OvaakjfzjUDVDiCBej142HTjZ8m0hTufhhnDm tZ94uaBORDcQyop62HQ3KM8RAPxoBq6jXTm617CGehGYPZ7jA98UtxDqH7wdIhUSuESh G+V96AOUr/TPNpU3DPyra6n56gNyKT5fB0DpVcvvyJxpao3mcIsbWjmJUb8DzEExPowJ sLbdMAST7zNB90PVP/XmBpDvDnHHjXt42Go485EnRuClhV3udePBvYt753h0311VxZZA A1SQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=jjA1JZCX; 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 39si1942691plc.153.2019.01.22.06.42.58; Tue, 22 Jan 2019 06:43:15 -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=jjA1JZCX; 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 S1728875AbfAVOld (ORCPT + 99 others); Tue, 22 Jan 2019 09:41:33 -0500 Received: from mail.kernel.org ([198.145.29.99]:53360 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728318AbfAVOlb (ORCPT ); Tue, 22 Jan 2019 09:41:31 -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 1438621721; Tue, 22 Jan 2019 14:41:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1548168090; bh=8BjUBVZCmrAANyhj3BZe6P8VfjTGGURJDzipiOghw9Q=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=jjA1JZCXKIIzmIlK9iATEw2pkvtdWfFyrg8yAp+kgKzJvqrN7hM3ca6BwXzTDXHKI a3Mn3P2wv99+NRlMTtvqPpUL45tDwysnbj/6W/WW7PHhqKbycILLDk4f22Fs+sLtSc bDw4HkWPE4/qKXQrwfeckH4qUKmF68NxAmPC6zbM= 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 , Jinbum Park , Kees Cook , Laura Abbott Subject: [PATCH 2/4] arm: dump: no need to check return value of debugfs_create functions Date: Tue, 22 Jan 2019 15:41:12 +0100 Message-Id: <20190122144114.9816-3-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: Russell King Cc: Jinbum Park Cc: Kees Cook Cc: Laura Abbott Cc: linux-arm-kernel@lists.infradead.org Signed-off-by: Greg Kroah-Hartman --- arch/arm/include/asm/ptdump.h | 9 +++------ arch/arm/mm/dump.c | 4 ++-- arch/arm/mm/ptdump_debugfs.c | 8 ++------ 3 files changed, 7 insertions(+), 14 deletions(-) diff --git a/arch/arm/include/asm/ptdump.h b/arch/arm/include/asm/ptdump.h index 3ebf9718288d..0c2d3d0d4cc6 100644 --- a/arch/arm/include/asm/ptdump.h +++ b/arch/arm/include/asm/ptdump.h @@ -21,13 +21,10 @@ struct ptdump_info { void ptdump_walk_pgd(struct seq_file *s, struct ptdump_info *info); #ifdef CONFIG_ARM_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 /* CONFIG_ARM_PTDUMP_DEBUGFS */ void ptdump_check_wx(void); diff --git a/arch/arm/mm/dump.c b/arch/arm/mm/dump.c index 084779c5c893..eb385a500ed0 100644 --- a/arch/arm/mm/dump.c +++ b/arch/arm/mm/dump.c @@ -450,7 +450,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; } __initcall(ptdump_init); diff --git a/arch/arm/mm/ptdump_debugfs.c b/arch/arm/mm/ptdump_debugfs.c index be8d87be4b93..598b636615a2 100644 --- a/arch/arm/mm/ptdump_debugfs.c +++ b/arch/arm/mm/ptdump_debugfs.c @@ -24,11 +24,7 @@ static const struct file_operations ptdump_fops = { .release = single_release, }; -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