All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 3/3] libsepol: remove unneeded int
@ 2019-06-13 16:00 Jokke Hämäläinen
  2019-06-17  4:35 ` William Roberts
  0 siblings, 1 reply; 3+ messages in thread
From: Jokke Hämäläinen @ 2019-06-13 16:00 UTC (permalink / raw)
  To: selinux


Replace int ret with a constant 1 because it is
only used when returning from function and is
never modified.

Signed-off-by: Unto Sten <sten.unto@gmail.com>
---
 libsepol/src/context.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/libsepol/src/context.c b/libsepol/src/context.c
index a88937fc..e81b28c6 100644
--- a/libsepol/src/context.c
+++ b/libsepol/src/context.c
@@ -38,7 +38,6 @@ int context_is_valid(const policydb_t * p, const context_struct_t * c)
 	role_datum_t *role;
 	user_datum_t *usrdatum;
 	ebitmap_t types, roles;
-	int ret = 1;
 
 	ebitmap_init(&types);
 	ebitmap_init(&roles);
@@ -75,7 +74,7 @@ int context_is_valid(const policydb_t * p, const context_struct_t * c)
 	if (!mls_context_isvalid(p, c))
 		return 0;
 
-	return ret;
+	return 1;
 }
 
 /*
-- 
2.21.0


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

* Re: [PATCH 3/3] libsepol: remove unneeded int
  2019-06-13 16:00 [PATCH 3/3] libsepol: remove unneeded int Jokke Hämäläinen
@ 2019-06-17  4:35 ` William Roberts
  2019-06-19 16:04   ` William Roberts
  0 siblings, 1 reply; 3+ messages in thread
From: William Roberts @ 2019-06-17  4:35 UTC (permalink / raw)
  To: Jokke Hämäläinen; +Cc: selinux

ack on the series

I see these are the three staged here:
3/3 uneeded int: https://github.com/SELinuxProject/selinux/pull/154
2/3 remove redundant if clause:
https://github.com/SELinuxProject/selinux/pull/155
1/3 more accurate error message:
https://github.com/SELinuxProject/selinux/pull/156

I will pull them in on Wednesday June 19 if no one objects.

On Thu, Jun 13, 2019 at 9:01 AM Jokke Hämäläinen
<jokke.hamalainen@kolttonen.fi> wrote:
>
>
> Replace int ret with a constant 1 because it is
> only used when returning from function and is
> never modified.
>
> Signed-off-by: Unto Sten <sten.unto@gmail.com>
> ---
>  libsepol/src/context.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/libsepol/src/context.c b/libsepol/src/context.c
> index a88937fc..e81b28c6 100644
> --- a/libsepol/src/context.c
> +++ b/libsepol/src/context.c
> @@ -38,7 +38,6 @@ int context_is_valid(const policydb_t * p, const context_struct_t * c)
>         role_datum_t *role;
>         user_datum_t *usrdatum;
>         ebitmap_t types, roles;
> -       int ret = 1;
>
>         ebitmap_init(&types);
>         ebitmap_init(&roles);
> @@ -75,7 +74,7 @@ int context_is_valid(const policydb_t * p, const context_struct_t * c)
>         if (!mls_context_isvalid(p, c))
>                 return 0;
>
> -       return ret;
> +       return 1;
>  }
>
>  /*
> --
> 2.21.0
>

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

* Re: [PATCH 3/3] libsepol: remove unneeded int
  2019-06-17  4:35 ` William Roberts
@ 2019-06-19 16:04   ` William Roberts
  0 siblings, 0 replies; 3+ messages in thread
From: William Roberts @ 2019-06-19 16:04 UTC (permalink / raw)
  To: Jokke Hämäläinen; +Cc: selinux

merged

On Sun, Jun 16, 2019 at 9:35 PM William Roberts
<bill.c.roberts@gmail.com> wrote:
>
> ack on the series
>
> I see these are the three staged here:
> 3/3 uneeded int: https://github.com/SELinuxProject/selinux/pull/154
> 2/3 remove redundant if clause:
> https://github.com/SELinuxProject/selinux/pull/155
> 1/3 more accurate error message:
> https://github.com/SELinuxProject/selinux/pull/156
>
> I will pull them in on Wednesday June 19 if no one objects.
>
> On Thu, Jun 13, 2019 at 9:01 AM Jokke Hämäläinen
> <jokke.hamalainen@kolttonen.fi> wrote:
> >
> >
> > Replace int ret with a constant 1 because it is
> > only used when returning from function and is
> > never modified.
> >
> > Signed-off-by: Unto Sten <sten.unto@gmail.com>
> > ---
> >  libsepol/src/context.c | 3 +--
> >  1 file changed, 1 insertion(+), 2 deletions(-)
> >
> > diff --git a/libsepol/src/context.c b/libsepol/src/context.c
> > index a88937fc..e81b28c6 100644
> > --- a/libsepol/src/context.c
> > +++ b/libsepol/src/context.c
> > @@ -38,7 +38,6 @@ int context_is_valid(const policydb_t * p, const context_struct_t * c)
> >         role_datum_t *role;
> >         user_datum_t *usrdatum;
> >         ebitmap_t types, roles;
> > -       int ret = 1;
> >
> >         ebitmap_init(&types);
> >         ebitmap_init(&roles);
> > @@ -75,7 +74,7 @@ int context_is_valid(const policydb_t * p, const context_struct_t * c)
> >         if (!mls_context_isvalid(p, c))
> >                 return 0;
> >
> > -       return ret;
> > +       return 1;
> >  }
> >
> >  /*
> > --
> > 2.21.0
> >

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

end of thread, other threads:[~2019-06-19 16:03 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-06-13 16:00 [PATCH 3/3] libsepol: remove unneeded int Jokke Hämäläinen
2019-06-17  4:35 ` William Roberts
2019-06-19 16:04   ` William Roberts

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.