linux-security-module.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: elfring@users.sourceforge.net (SF Markus Elfring)
To: linux-security-module@vger.kernel.org
Subject: [PATCH 2/3] ima: Combine two function calls into one in ima_policy_show()
Date: Sun, 7 May 2017 15:42:18 +0200	[thread overview]
Message-ID: <cd8a009f-c61b-4a7d-596a-1e2e64edeea6@users.sourceforge.net> (raw)
In-Reply-To: <416e6b01-7abb-d894-3bd6-d8bda05ed6b2@users.sourceforge.net>

From: Markus Elfring <elfring@users.sourceforge.net>
Date: Sun, 7 May 2017 14:58:55 +0200

A bit of data was put into a sequence by two separate function calls.
Print the same data by a single function call instead.

This issue was detected by using the Coccinelle software.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
 security/integrity/ima/ima_policy.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/security/integrity/ima/ima_policy.c b/security/integrity/ima/ima_policy.c
index 3ab1067db624..83446a383ace 100644
--- a/security/integrity/ima/ima_policy.c
+++ b/security/integrity/ima/ima_policy.c
@@ -1086,10 +1086,8 @@ int ima_policy_show(struct seq_file *m, void *v)
 		seq_puts(m, " ");
 	}
 
-	if (entry->flags & IMA_FSUUID) {
-		seq_printf(m, "fsuuid=%pU", entry->fsuuid);
-		seq_puts(m, " ");
-	}
+	if (entry->flags & IMA_FSUUID)
+		seq_printf(m, "fsuuid=%pU ", entry->fsuuid);
 
 	if (entry->flags & IMA_UID) {
 		snprintf(tbuf, sizeof(tbuf), "%d", __kuid_val(entry->uid));
-- 
2.12.2

--
To unsubscribe from this list: send the line "unsubscribe linux-security-module" in
the body of a message to majordomo at vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

  parent reply	other threads:[~2017-05-07 13:42 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-05-07 13:40 [PATCH 0/3] IMA: Fine-tuning for three function implementations SF Markus Elfring
2017-05-07 13:41 ` [PATCH 1/3] ima: Use seq_putc() in ima_ascii_measurements_show() SF Markus Elfring
2017-05-07 13:42 ` SF Markus Elfring [this message]
2017-05-07 13:43 ` [PATCH 3/3] ima: Replace nine seq_puts() calls by seq_putc() SF Markus Elfring
2017-05-08 14:26 ` [PATCH 0/3] IMA: Fine-tuning for three function implementations Mimi Zohar
2017-05-08 15:26   ` SF Markus Elfring

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=cd8a009f-c61b-4a7d-596a-1e2e64edeea6@users.sourceforge.net \
    --to=elfring@users.sourceforge.net \
    --cc=linux-security-module@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).