[apparmor] [patch 5/5] parser - drop bogus ret variables
Steve Beattie
steve at nxnw.org
Fri Sep 6 19:12:19 UTC 2013
On Fri, Sep 06, 2013 at 12:09:54PM -0700, Tyler Hicks wrote:
> On 2013-09-05 01:18:58, Steve Beattie wrote:
> > Nothing ever sets ret after its initialization, as each of the
> > functions return on failures directly, so drop the useless variable.
> >
> > Signed-off-by: Steve Beattie <steve at nxnw.org>
>
> This looks fine, but it conflicts heavily with one of jj's C++ patches
> that I'm fixing up. His patch essentially makes this same change, along
> with a whole lot of other changes so it would be easier on me if we
> didn't merge this patch and eventually merged his patch instead.
>
> Here's a little snippet:
>
> ---
> static int process_variables_in_entries(struct cod_entry *entry_list)
> {
> - int ret = TRUE, rc;
> + int error = 0;
> struct cod_entry *entry;
>
> list_for_each(entry_list, entry) {
> - rc = expand_entry_variables(&entry->name, entry,
> - clone_and_chain_cod);
> - if (!rc)
> - return FALSE;
> + error = expand_entry_variables(&entry->name, entry,
> + clone_and_chain_cod);
> + if (error)
> + return error;
> }
>
> - return ret;
> + return 0;
> }
> ---
>
> Steve, does that sound alright?
Yeah, that works for me. Thanks!
--
Steve Beattie
<sbeattie at ubuntu.com>
http://NxNW.org/~steve/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <https://lists.ubuntu.com/archives/apparmor/attachments/20130906/acfd3dcb/attachment.pgp>
More information about the AppArmor
mailing list