From patchwork Thu May 10 15:45:41 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joe Perches X-Patchwork-Id: 10392017 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id A3D6360353 for ; Thu, 10 May 2018 15:53:47 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9370428844 for ; Thu, 10 May 2018 15:53:47 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 87F3D28B74; Thu, 10 May 2018 15:53:47 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0DDBF28844 for ; Thu, 10 May 2018 15:53:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S966263AbeEJPxq (ORCPT ); Thu, 10 May 2018 11:53:46 -0400 Received: from smtprelay0236.hostedemail.com ([216.40.44.236]:58201 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S965033AbeEJPxq (ORCPT ); Thu, 10 May 2018 11:53:46 -0400 Received: from smtprelay.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by smtpgrave03.hostedemail.com (Postfix) with ESMTP id 315E718046C6B for ; Thu, 10 May 2018 15:46:37 +0000 (UTC) Received: from filter.hostedemail.com (clb03-v110.bra.tucows.net [216.40.38.60]) by smtprelay02.hostedemail.com (Postfix) with ESMTP id E056A6D83; Thu, 10 May 2018 15:46:35 +0000 (UTC) X-Session-Marker: 6A6F6540706572636865732E636F6D X-HE-Tag: roof93_1c46e0fd4fa3a X-Filterd-Recvd-Size: 4483 Received: from joe-laptop.perches.com (unknown [47.151.150.235]) (Authenticated sender: joe@perches.com) by omf04.hostedemail.com (Postfix) with ESMTPA; Thu, 10 May 2018 15:46:34 +0000 (UTC) From: Joe Perches To: Paul Moore , Stephen Smalley , Eric Paris Cc: James Morris , "Serge E. Hallyn" , selinux@tycho.nsa.gov, linux-security-module@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 15/18] security: Remove pr_fmt duplicate logging prefixes Date: Thu, 10 May 2018 08:45:41 -0700 Message-Id: <799f2558f37c5480d42c03e3465754aa8bb30e70.1525964385.git.joe@perches.com> X-Mailer: git-send-email 2.15.0 In-Reply-To: References: Sender: owner-linux-security-module@vger.kernel.org Precedence: bulk List-ID: X-Virus-Scanned: ClamAV using ClamSMTP Converting pr_fmt from a simple define to use KBUILD_MODNAME added some duplicate logging prefixes to existing uses. Remove them. Signed-off-by: Joe Perches Acked-by: Paul Moore --- security/selinux/selinuxfs.c | 29 ++++++++++++++--------------- 1 file changed, 14 insertions(+), 15 deletions(-) diff --git a/security/selinux/selinuxfs.c b/security/selinux/selinuxfs.c index c0cadbc5f85c..be8f186a6256 100644 --- a/security/selinux/selinuxfs.c +++ b/security/selinux/selinuxfs.c @@ -515,19 +515,19 @@ static int sel_make_policy_nodes(struct selinux_fs_info *fsi) ret = sel_make_bools(fsi); if (ret) { - pr_err("SELinux: failed to load policy booleans\n"); + pr_err("failed to load policy booleans\n"); return ret; } ret = sel_make_classes(fsi); if (ret) { - pr_err("SELinux: failed to load policy classes\n"); + pr_err("failed to load policy classes\n"); return ret; } ret = sel_make_policycap(fsi); if (ret) { - pr_err("SELinux: failed to load policy capabilities\n"); + pr_err("failed to load policy capabilities\n"); return ret; } @@ -570,7 +570,7 @@ static ssize_t sel_write_load(struct file *file, const char __user *buf, length = security_load_policy(fsi->state, data, count); if (length) { - pr_warn_ratelimited("SELinux: failed to load policy\n"); + pr_warn_ratelimited("failed to load policy\n"); goto out; } @@ -620,8 +620,8 @@ static ssize_t sel_write_context(struct file *file, char *buf, size_t size) length = -ERANGE; if (len > SIMPLE_TRANSACTION_LIMIT) { - printk(KERN_ERR "SELinux: %s: context size (%u) exceeds " - "payload max\n", __func__, len); + pr_err("%s: context size (%u) exceeds payload max\n", + __func__, len); goto out; } @@ -956,8 +956,8 @@ static ssize_t sel_write_create(struct file *file, char *buf, size_t size) length = -ERANGE; if (len > SIMPLE_TRANSACTION_LIMIT) { - printk(KERN_ERR "SELinux: %s: context size (%u) exceeds " - "payload max\n", __func__, len); + pr_err("%s: context size (%u) exceeds payload max\n", + __func__, len); goto out; } @@ -1147,8 +1147,8 @@ static ssize_t sel_write_member(struct file *file, char *buf, size_t size) length = -ERANGE; if (len > SIMPLE_TRANSACTION_LIMIT) { - printk(KERN_ERR "SELinux: %s: context size (%u) exceeds " - "payload max\n", __func__, len); + pr_err("%s: context size (%u) exceeds payload max\n", + __func__, len); goto out; } @@ -1389,8 +1389,8 @@ static int sel_make_bools(struct selinux_fs_info *fsi) ret = security_genfs_sid(fsi->state, "selinuxfs", page, SECCLASS_FILE, &sid); if (ret) { - pr_warn_ratelimited("SELinux: no sid found, defaulting to security isid for %s\n", - page); + pr_warn_ratelimited("no sid found, defaulting to security isid for %s\n", + page); sid = SECINITSID_SECURITY; } @@ -1996,8 +1996,7 @@ static int sel_fill_super(struct super_block *sb, void *data, int silent) goto err; return 0; err: - printk(KERN_ERR "SELinux: %s: failed while creating inodes\n", - __func__); + pr_err("%s: failed while creating inodes\n", __func__); selinux_fs_info_free(sb); @@ -2046,7 +2045,7 @@ static int __init init_sel_fs(void) selinux_null.mnt = selinuxfs_mount = kern_mount(&sel_fs_type); if (IS_ERR(selinuxfs_mount)) { - printk(KERN_ERR "selinuxfs: could not mount!\n"); + pr_err("selinuxfs: could not mount!\n"); err = PTR_ERR(selinuxfs_mount); selinuxfs_mount = NULL; }