From patchwork Thu Jun 13 16:00:18 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?b?Sm9ra2UgSMOkbcOkbMOkaW5lbg==?= X-Patchwork-Id: 10992619 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id CFAF013AD for ; Thu, 13 Jun 2019 16:00:22 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C0514212BE for ; Thu, 13 Jun 2019 16:00:22 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B497D206AF; Thu, 13 Jun 2019 16:00:22 +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=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham 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 64C9220881 for ; Thu, 13 Jun 2019 16:00:22 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730250AbfFMQAV (ORCPT ); Thu, 13 Jun 2019 12:00:21 -0400 Received: from 48.23.240.77.static.louhi.net ([77.240.23.48]:37868 "EHLO kolttonen.fi" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728066AbfFMQAU (ORCPT ); Thu, 13 Jun 2019 12:00:20 -0400 Received: from 34-41-5D-CA-59-C7 (82-203-159-32.bb.dnainternet.fi [82.203.159.32]) (authenticated bits=0) by vcust561.louhi.net (8.14.7/8.14.7/0) with ESMTP id x5DFxiNN030743 (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Thu, 13 Jun 2019 18:59:45 +0300 DKIM-Filter: OpenDKIM Filter v2.11.0 vcust561.louhi.net x5DFxiNN030743 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kolttonen.fi; s=mail; t=1560441585; bh=7esMgPpTrLfZWdE5aLB3vP85piPp/kAwX3li/gGK5Dw=; h=Date:From:To:Subject:From; b=gCvh3J4yd1YDscIio0TR20gmKs9iKwBA1QDIu4TBDlY1OR4edzrfj85iKpyQwCnkE vxVE9UQK5F6m2uvYEo9XIizmObVb3cAIwpsZPXRfjXpCqxtA4UossV4oEwQK5iY4t1 rtFx2EY4JcDbHcm4JCK8Epr8Ecre5Dqul6BLB896qZB36EqonXIJLkdsLJ3erTUUB/ K9+pNZO/HoCp+ocH/6D3T7Uh97Re6OdpYca6tVCtq23BXgVmztLTW9XS89U4nZYcT5 dOZrBDLTM1lPC+OmyHkBp+yGXDkPiQ2chUlz8P1nZyDZuFqXYWv/edBOnhjPRpbt1V K2PrQIS6jwaLg== Date: Thu, 13 Jun 2019 19:00:18 +0300 (EEST) From: =?iso-8859-15?q?Jokke_H=E4m=E4l=E4inen?= To: selinux@vger.kernel.org Subject: [PATCH 3/3] libsepol: remove unneeded int Message-ID: User-Agent: Alpine 2.21 (LFD 202 2017-01-01) MIME-Version: 1.0 Sender: selinux-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: selinux@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 --- 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; } /*