All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/2] apparmorfs: Fine-tuning for three function implementations
@ 2017-05-07 12:01 ` SF Markus Elfring
  0 siblings, 0 replies; 15+ messages in thread
From: SF Markus Elfring @ 2017-05-07 12:01 UTC (permalink / raw)
  To: linux-security-module, James Morris, John Johansen, Serge E. Hallyn
  Cc: LKML, kernel-janitors

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

Two update suggestions were taken into account
from static source code analysis.

Markus Elfring (2):
  Combine two function calls into one in aa_fs_seq_raw_abi_show()
  Use seq_putc() in two functions

 security/apparmor/apparmorfs.c | 11 +++++------
 1 file changed, 5 insertions(+), 6 deletions(-)

-- 
2.12.2

^ permalink raw reply	[flat|nested] 15+ messages in thread

* [PATCH 0/2] apparmorfs: Fine-tuning for three function implementations
@ 2017-05-07 12:01 ` SF Markus Elfring
  0 siblings, 0 replies; 15+ messages in thread
From: SF Markus Elfring @ 2017-05-07 12:01 UTC (permalink / raw)
  To: linux-security-module

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

Two update suggestions were taken into account
from static source code analysis.

Markus Elfring (2):
  Combine two function calls into one in aa_fs_seq_raw_abi_show()
  Use seq_putc() in two functions

 security/apparmor/apparmorfs.c | 11 +++++------
 1 file changed, 5 insertions(+), 6 deletions(-)

-- 
2.12.2


^ permalink raw reply	[flat|nested] 15+ messages in thread

* [PATCH 0/2] apparmorfs: Fine-tuning for three function implementations
@ 2017-05-07 12:01 ` SF Markus Elfring
  0 siblings, 0 replies; 15+ messages in thread
From: SF Markus Elfring @ 2017-05-07 12:01 UTC (permalink / raw)
  To: linux-security-module

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

Two update suggestions were taken into account
from static source code analysis.

Markus Elfring (2):
  Combine two function calls into one in aa_fs_seq_raw_abi_show()
  Use seq_putc() in two functions

 security/apparmor/apparmorfs.c | 11 +++++------
 1 file changed, 5 insertions(+), 6 deletions(-)

-- 
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

^ permalink raw reply	[flat|nested] 15+ messages in thread

* [PATCH 1/2] apparmorfs: Combine two function calls into one in aa_fs_seq_raw_abi_show()
  2017-05-07 12:01 ` SF Markus Elfring
  (?)
@ 2017-05-07 12:02   ` SF Markus Elfring
  -1 siblings, 0 replies; 15+ messages in thread
From: SF Markus Elfring @ 2017-05-07 12:02 UTC (permalink / raw)
  To: linux-security-module, James Morris, John Johansen, Serge E. Hallyn
  Cc: LKML, kernel-janitors

From: Markus Elfring <elfring@users.sourceforge.net>
Date: Sun, 7 May 2017 13:43:50 +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.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
 security/apparmor/apparmorfs.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/security/apparmor/apparmorfs.c b/security/apparmor/apparmorfs.c
index 4f6ac9dbc65d..b4d83e0bc651 100644
--- a/security/apparmor/apparmorfs.c
+++ b/security/apparmor/apparmorfs.c
@@ -572,10 +572,9 @@ static int aa_fs_seq_raw_abi_show(struct seq_file *seq, void *v)
 	struct aa_proxy *proxy = seq->private;
 	struct aa_profile *profile = aa_get_profile_rcu(&proxy->profile);
 
-	if (profile->rawdata->abi) {
-		seq_printf(seq, "v%d", profile->rawdata->abi);
-		seq_puts(seq, "\n");
-	}
+	if (profile->rawdata->abi)
+		seq_printf(seq, "v%d\n", profile->rawdata->abi);
+
 	aa_put_profile(profile);
 
 	return 0;
-- 
2.12.2

^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [PATCH 1/2] apparmorfs: Combine two function calls into one in aa_fs_seq_raw_abi_show()
@ 2017-05-07 12:02   ` SF Markus Elfring
  0 siblings, 0 replies; 15+ messages in thread
From: SF Markus Elfring @ 2017-05-07 12:02 UTC (permalink / raw)
  To: linux-security-module

From: Markus Elfring <elfring@users.sourceforge.net>
Date: Sun, 7 May 2017 13:43:50 +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.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
 security/apparmor/apparmorfs.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/security/apparmor/apparmorfs.c b/security/apparmor/apparmorfs.c
index 4f6ac9dbc65d..b4d83e0bc651 100644
--- a/security/apparmor/apparmorfs.c
+++ b/security/apparmor/apparmorfs.c
@@ -572,10 +572,9 @@ static int aa_fs_seq_raw_abi_show(struct seq_file *seq, void *v)
 	struct aa_proxy *proxy = seq->private;
 	struct aa_profile *profile = aa_get_profile_rcu(&proxy->profile);
 
-	if (profile->rawdata->abi) {
-		seq_printf(seq, "v%d", profile->rawdata->abi);
-		seq_puts(seq, "\n");
-	}
+	if (profile->rawdata->abi)
+		seq_printf(seq, "v%d\n", profile->rawdata->abi);
+
 	aa_put_profile(profile);
 
 	return 0;
-- 
2.12.2


^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [PATCH 1/2] apparmorfs: Combine two function calls into one in aa_fs_seq_raw_abi_show()
@ 2017-05-07 12:02   ` SF Markus Elfring
  0 siblings, 0 replies; 15+ messages in thread
From: SF Markus Elfring @ 2017-05-07 12:02 UTC (permalink / raw)
  To: linux-security-module

From: Markus Elfring <elfring@users.sourceforge.net>
Date: Sun, 7 May 2017 13:43:50 +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.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
 security/apparmor/apparmorfs.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/security/apparmor/apparmorfs.c b/security/apparmor/apparmorfs.c
index 4f6ac9dbc65d..b4d83e0bc651 100644
--- a/security/apparmor/apparmorfs.c
+++ b/security/apparmor/apparmorfs.c
@@ -572,10 +572,9 @@ static int aa_fs_seq_raw_abi_show(struct seq_file *seq, void *v)
 	struct aa_proxy *proxy = seq->private;
 	struct aa_profile *profile = aa_get_profile_rcu(&proxy->profile);
 
-	if (profile->rawdata->abi) {
-		seq_printf(seq, "v%d", profile->rawdata->abi);
-		seq_puts(seq, "\n");
-	}
+	if (profile->rawdata->abi)
+		seq_printf(seq, "v%d\n", profile->rawdata->abi);
+
 	aa_put_profile(profile);
 
 	return 0;
-- 
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

^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [PATCH 2/2] apparmorfs: Use seq_putc() in two functions
  2017-05-07 12:01 ` SF Markus Elfring
  (?)
@ 2017-05-07 12:03   ` SF Markus Elfring
  -1 siblings, 0 replies; 15+ messages in thread
From: SF Markus Elfring @ 2017-05-07 12:03 UTC (permalink / raw)
  To: linux-security-module, James Morris, John Johansen, Serge E. Hallyn
  Cc: LKML, kernel-janitors

From: Markus Elfring <elfring@users.sourceforge.net>
Date: Sun, 7 May 2017 13:50:28 +0200

Two single characters (line breaks) should be put into a sequence.
Thus use the corresponding function "seq_putc".

This issue was detected by using the Coccinelle software.

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

diff --git a/security/apparmor/apparmorfs.c b/security/apparmor/apparmorfs.c
index b4d83e0bc651..41e427a4f051 100644
--- a/security/apparmor/apparmorfs.c
+++ b/security/apparmor/apparmorfs.c
@@ -494,7 +494,7 @@ static int aa_fs_seq_hash_show(struct seq_file *seq, void *v)
 	if (profile->hash) {
 		for (i = 0; i < size; i++)
 			seq_printf(seq, "%.2x", profile->hash[i]);
-		seq_puts(seq, "\n");
+		seq_putc(seq, '\n');
 	}
 	aa_put_profile(profile);
 
@@ -602,7 +602,7 @@ static int aa_fs_seq_raw_hash_show(struct seq_file *seq, void *v)
 	if (profile->rawdata->hash) {
 		for (i = 0; i < size; i++)
 			seq_printf(seq, "%.2x", profile->rawdata->hash[i]);
-		seq_puts(seq, "\n");
+		seq_putc(seq, '\n');
 	}
 	aa_put_profile(profile);
 
-- 
2.12.2

^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [PATCH 2/2] apparmorfs: Use seq_putc() in two functions
@ 2017-05-07 12:03   ` SF Markus Elfring
  0 siblings, 0 replies; 15+ messages in thread
From: SF Markus Elfring @ 2017-05-07 12:03 UTC (permalink / raw)
  To: linux-security-module

From: Markus Elfring <elfring@users.sourceforge.net>
Date: Sun, 7 May 2017 13:50:28 +0200

Two single characters (line breaks) should be put into a sequence.
Thus use the corresponding function "seq_putc".

This issue was detected by using the Coccinelle software.

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

diff --git a/security/apparmor/apparmorfs.c b/security/apparmor/apparmorfs.c
index b4d83e0bc651..41e427a4f051 100644
--- a/security/apparmor/apparmorfs.c
+++ b/security/apparmor/apparmorfs.c
@@ -494,7 +494,7 @@ static int aa_fs_seq_hash_show(struct seq_file *seq, void *v)
 	if (profile->hash) {
 		for (i = 0; i < size; i++)
 			seq_printf(seq, "%.2x", profile->hash[i]);
-		seq_puts(seq, "\n");
+		seq_putc(seq, '\n');
 	}
 	aa_put_profile(profile);
 
@@ -602,7 +602,7 @@ static int aa_fs_seq_raw_hash_show(struct seq_file *seq, void *v)
 	if (profile->rawdata->hash) {
 		for (i = 0; i < size; i++)
 			seq_printf(seq, "%.2x", profile->rawdata->hash[i]);
-		seq_puts(seq, "\n");
+		seq_putc(seq, '\n');
 	}
 	aa_put_profile(profile);
 
-- 
2.12.2


^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [PATCH 2/2] apparmorfs: Use seq_putc() in two functions
@ 2017-05-07 12:03   ` SF Markus Elfring
  0 siblings, 0 replies; 15+ messages in thread
From: SF Markus Elfring @ 2017-05-07 12:03 UTC (permalink / raw)
  To: linux-security-module

From: Markus Elfring <elfring@users.sourceforge.net>
Date: Sun, 7 May 2017 13:50:28 +0200

Two single characters (line breaks) should be put into a sequence.
Thus use the corresponding function "seq_putc".

This issue was detected by using the Coccinelle software.

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

diff --git a/security/apparmor/apparmorfs.c b/security/apparmor/apparmorfs.c
index b4d83e0bc651..41e427a4f051 100644
--- a/security/apparmor/apparmorfs.c
+++ b/security/apparmor/apparmorfs.c
@@ -494,7 +494,7 @@ static int aa_fs_seq_hash_show(struct seq_file *seq, void *v)
 	if (profile->hash) {
 		for (i = 0; i < size; i++)
 			seq_printf(seq, "%.2x", profile->hash[i]);
-		seq_puts(seq, "\n");
+		seq_putc(seq, '\n');
 	}
 	aa_put_profile(profile);
 
@@ -602,7 +602,7 @@ static int aa_fs_seq_raw_hash_show(struct seq_file *seq, void *v)
 	if (profile->rawdata->hash) {
 		for (i = 0; i < size; i++)
 			seq_printf(seq, "%.2x", profile->rawdata->hash[i]);
-		seq_puts(seq, "\n");
+		seq_putc(seq, '\n');
 	}
 	aa_put_profile(profile);
 
-- 
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

^ permalink raw reply related	[flat|nested] 15+ messages in thread

* Re: [PATCH 1/2] apparmorfs: Combine two function calls into one in aa_fs_seq_raw_abi_show()
  2017-05-07 12:02   ` SF Markus Elfring
  (?)
@ 2017-05-07 12:31     ` John Johansen
  -1 siblings, 0 replies; 15+ messages in thread
From: John Johansen @ 2017-05-07 12:31 UTC (permalink / raw)
  To: SF Markus Elfring, linux-security-module, James Morris, Serge E. Hallyn
  Cc: LKML, kernel-janitors

On 05/07/2017 05:02 AM, SF Markus Elfring wrote:
> From: Markus Elfring <elfring@users.sourceforge.net>
> Date: Sun, 7 May 2017 13:43:50 +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.
> 
> Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>

Acked-by: John Johansen <john.johansen@canonical.com>

I'll pull it into my tree for my next push

> ---
>  security/apparmor/apparmorfs.c | 7 +++----
>  1 file changed, 3 insertions(+), 4 deletions(-)
> 
> diff --git a/security/apparmor/apparmorfs.c b/security/apparmor/apparmorfs.c
> index 4f6ac9dbc65d..b4d83e0bc651 100644
> --- a/security/apparmor/apparmorfs.c
> +++ b/security/apparmor/apparmorfs.c
> @@ -572,10 +572,9 @@ static int aa_fs_seq_raw_abi_show(struct seq_file *seq, void *v)
>  	struct aa_proxy *proxy = seq->private;
>  	struct aa_profile *profile = aa_get_profile_rcu(&proxy->profile);
>  
> -	if (profile->rawdata->abi) {
> -		seq_printf(seq, "v%d", profile->rawdata->abi);
> -		seq_puts(seq, "\n");
> -	}
> +	if (profile->rawdata->abi)
> +		seq_printf(seq, "v%d\n", profile->rawdata->abi);
> +
>  	aa_put_profile(profile);
>  
>  	return 0;
> 

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH 1/2] apparmorfs: Combine two function calls into one in aa_fs_seq_raw_abi_show()
@ 2017-05-07 12:31     ` John Johansen
  0 siblings, 0 replies; 15+ messages in thread
From: John Johansen @ 2017-05-07 12:31 UTC (permalink / raw)
  To: linux-security-module

On 05/07/2017 05:02 AM, SF Markus Elfring wrote:
> From: Markus Elfring <elfring@users.sourceforge.net>
> Date: Sun, 7 May 2017 13:43:50 +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.
> 
> Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>

Acked-by: John Johansen <john.johansen@canonical.com>

I'll pull it into my tree for my next push

> ---
>  security/apparmor/apparmorfs.c | 7 +++----
>  1 file changed, 3 insertions(+), 4 deletions(-)
> 
> diff --git a/security/apparmor/apparmorfs.c b/security/apparmor/apparmorfs.c
> index 4f6ac9dbc65d..b4d83e0bc651 100644
> --- a/security/apparmor/apparmorfs.c
> +++ b/security/apparmor/apparmorfs.c
> @@ -572,10 +572,9 @@ static int aa_fs_seq_raw_abi_show(struct seq_file *seq, void *v)
>  	struct aa_proxy *proxy = seq->private;
>  	struct aa_profile *profile = aa_get_profile_rcu(&proxy->profile);
>  
> -	if (profile->rawdata->abi) {
> -		seq_printf(seq, "v%d", profile->rawdata->abi);
> -		seq_puts(seq, "\n");
> -	}
> +	if (profile->rawdata->abi)
> +		seq_printf(seq, "v%d\n", profile->rawdata->abi);
> +
>  	aa_put_profile(profile);
>  
>  	return 0;
> 


^ permalink raw reply	[flat|nested] 15+ messages in thread

* [PATCH 1/2] apparmorfs: Combine two function calls into one in aa_fs_seq_raw_abi_show()
@ 2017-05-07 12:31     ` John Johansen
  0 siblings, 0 replies; 15+ messages in thread
From: John Johansen @ 2017-05-07 12:31 UTC (permalink / raw)
  To: linux-security-module

On 05/07/2017 05:02 AM, SF Markus Elfring wrote:
> From: Markus Elfring <elfring@users.sourceforge.net>
> Date: Sun, 7 May 2017 13:43:50 +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.
> 
> Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>

Acked-by: John Johansen <john.johansen@canonical.com>

I'll pull it into my tree for my next push

> ---
>  security/apparmor/apparmorfs.c | 7 +++----
>  1 file changed, 3 insertions(+), 4 deletions(-)
> 
> diff --git a/security/apparmor/apparmorfs.c b/security/apparmor/apparmorfs.c
> index 4f6ac9dbc65d..b4d83e0bc651 100644
> --- a/security/apparmor/apparmorfs.c
> +++ b/security/apparmor/apparmorfs.c
> @@ -572,10 +572,9 @@ static int aa_fs_seq_raw_abi_show(struct seq_file *seq, void *v)
>  	struct aa_proxy *proxy = seq->private;
>  	struct aa_profile *profile = aa_get_profile_rcu(&proxy->profile);
>  
> -	if (profile->rawdata->abi) {
> -		seq_printf(seq, "v%d", profile->rawdata->abi);
> -		seq_puts(seq, "\n");
> -	}
> +	if (profile->rawdata->abi)
> +		seq_printf(seq, "v%d\n", profile->rawdata->abi);
> +
>  	aa_put_profile(profile);
>  
>  	return 0;
> 

--
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

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH 2/2] apparmorfs: Use seq_putc() in two functions
  2017-05-07 12:03   ` SF Markus Elfring
  (?)
@ 2017-05-07 12:31     ` John Johansen
  -1 siblings, 0 replies; 15+ messages in thread
From: John Johansen @ 2017-05-07 12:31 UTC (permalink / raw)
  To: SF Markus Elfring, linux-security-module, James Morris, Serge E. Hallyn
  Cc: LKML, kernel-janitors

On 05/07/2017 05:03 AM, SF Markus Elfring wrote:
> From: Markus Elfring <elfring@users.sourceforge.net>
> Date: Sun, 7 May 2017 13:50:28 +0200
> 
> Two single characters (line breaks) should be put into a sequence.
> Thus use the corresponding function "seq_putc".
> 
> This issue was detected by using the Coccinelle software.
> 
> Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>

Acked-by: John Johansen <john.johansen@canonical.com>

I'll pull it into my tree for my next push


> ---
>  security/apparmor/apparmorfs.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/security/apparmor/apparmorfs.c b/security/apparmor/apparmorfs.c
> index b4d83e0bc651..41e427a4f051 100644
> --- a/security/apparmor/apparmorfs.c
> +++ b/security/apparmor/apparmorfs.c
> @@ -494,7 +494,7 @@ static int aa_fs_seq_hash_show(struct seq_file *seq, void *v)
>  	if (profile->hash) {
>  		for (i = 0; i < size; i++)
>  			seq_printf(seq, "%.2x", profile->hash[i]);
> -		seq_puts(seq, "\n");
> +		seq_putc(seq, '\n');
>  	}
>  	aa_put_profile(profile);
>  
> @@ -602,7 +602,7 @@ static int aa_fs_seq_raw_hash_show(struct seq_file *seq, void *v)
>  	if (profile->rawdata->hash) {
>  		for (i = 0; i < size; i++)
>  			seq_printf(seq, "%.2x", profile->rawdata->hash[i]);
> -		seq_puts(seq, "\n");
> +		seq_putc(seq, '\n');
>  	}
>  	aa_put_profile(profile);
>  
> 

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH 2/2] apparmorfs: Use seq_putc() in two functions
@ 2017-05-07 12:31     ` John Johansen
  0 siblings, 0 replies; 15+ messages in thread
From: John Johansen @ 2017-05-07 12:31 UTC (permalink / raw)
  To: linux-security-module

On 05/07/2017 05:03 AM, SF Markus Elfring wrote:
> From: Markus Elfring <elfring@users.sourceforge.net>
> Date: Sun, 7 May 2017 13:50:28 +0200
> 
> Two single characters (line breaks) should be put into a sequence.
> Thus use the corresponding function "seq_putc".
> 
> This issue was detected by using the Coccinelle software.
> 
> Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>

Acked-by: John Johansen <john.johansen@canonical.com>

I'll pull it into my tree for my next push


> ---
>  security/apparmor/apparmorfs.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/security/apparmor/apparmorfs.c b/security/apparmor/apparmorfs.c
> index b4d83e0bc651..41e427a4f051 100644
> --- a/security/apparmor/apparmorfs.c
> +++ b/security/apparmor/apparmorfs.c
> @@ -494,7 +494,7 @@ static int aa_fs_seq_hash_show(struct seq_file *seq, void *v)
>  	if (profile->hash) {
>  		for (i = 0; i < size; i++)
>  			seq_printf(seq, "%.2x", profile->hash[i]);
> -		seq_puts(seq, "\n");
> +		seq_putc(seq, '\n');
>  	}
>  	aa_put_profile(profile);
>  
> @@ -602,7 +602,7 @@ static int aa_fs_seq_raw_hash_show(struct seq_file *seq, void *v)
>  	if (profile->rawdata->hash) {
>  		for (i = 0; i < size; i++)
>  			seq_printf(seq, "%.2x", profile->rawdata->hash[i]);
> -		seq_puts(seq, "\n");
> +		seq_putc(seq, '\n');
>  	}
>  	aa_put_profile(profile);
>  
> 


^ permalink raw reply	[flat|nested] 15+ messages in thread

* [PATCH 2/2] apparmorfs: Use seq_putc() in two functions
@ 2017-05-07 12:31     ` John Johansen
  0 siblings, 0 replies; 15+ messages in thread
From: John Johansen @ 2017-05-07 12:31 UTC (permalink / raw)
  To: linux-security-module

On 05/07/2017 05:03 AM, SF Markus Elfring wrote:
> From: Markus Elfring <elfring@users.sourceforge.net>
> Date: Sun, 7 May 2017 13:50:28 +0200
> 
> Two single characters (line breaks) should be put into a sequence.
> Thus use the corresponding function "seq_putc".
> 
> This issue was detected by using the Coccinelle software.
> 
> Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>

Acked-by: John Johansen <john.johansen@canonical.com>

I'll pull it into my tree for my next push


> ---
>  security/apparmor/apparmorfs.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/security/apparmor/apparmorfs.c b/security/apparmor/apparmorfs.c
> index b4d83e0bc651..41e427a4f051 100644
> --- a/security/apparmor/apparmorfs.c
> +++ b/security/apparmor/apparmorfs.c
> @@ -494,7 +494,7 @@ static int aa_fs_seq_hash_show(struct seq_file *seq, void *v)
>  	if (profile->hash) {
>  		for (i = 0; i < size; i++)
>  			seq_printf(seq, "%.2x", profile->hash[i]);
> -		seq_puts(seq, "\n");
> +		seq_putc(seq, '\n');
>  	}
>  	aa_put_profile(profile);
>  
> @@ -602,7 +602,7 @@ static int aa_fs_seq_raw_hash_show(struct seq_file *seq, void *v)
>  	if (profile->rawdata->hash) {
>  		for (i = 0; i < size; i++)
>  			seq_printf(seq, "%.2x", profile->rawdata->hash[i]);
> -		seq_puts(seq, "\n");
> +		seq_putc(seq, '\n');
>  	}
>  	aa_put_profile(profile);
>  
> 

--
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

^ permalink raw reply	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2017-05-08  1:34 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-05-07 12:01 [PATCH 0/2] apparmorfs: Fine-tuning for three function implementations SF Markus Elfring
2017-05-07 12:01 ` SF Markus Elfring
2017-05-07 12:01 ` SF Markus Elfring
2017-05-07 12:02 ` [PATCH 1/2] apparmorfs: Combine two function calls into one in aa_fs_seq_raw_abi_show() SF Markus Elfring
2017-05-07 12:02   ` SF Markus Elfring
2017-05-07 12:02   ` SF Markus Elfring
2017-05-07 12:31   ` John Johansen
2017-05-07 12:31     ` John Johansen
2017-05-07 12:31     ` John Johansen
2017-05-07 12:03 ` [PATCH 2/2] apparmorfs: Use seq_putc() in two functions SF Markus Elfring
2017-05-07 12:03   ` SF Markus Elfring
2017-05-07 12:03   ` SF Markus Elfring
2017-05-07 12:31   ` John Johansen
2017-05-07 12:31     ` John Johansen
2017-05-07 12:31     ` John Johansen

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.