From patchwork Mon Jan 16 23:58:03 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fengguang Wu X-Patchwork-Id: 9519679 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 8370160210 for ; Mon, 16 Jan 2017 23:58:53 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 74B9B2846C for ; Mon, 16 Jan 2017 23:58:53 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 690E328491; Mon, 16 Jan 2017 23:58:53 +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=-6.9 required=2.0 tests=BAYES_00,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 0FF7A2846C for ; Mon, 16 Jan 2017 23:58:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751179AbdAPX6w (ORCPT ); Mon, 16 Jan 2017 18:58:52 -0500 Received: from mga06.intel.com ([134.134.136.31]:46994 "EHLO mga06.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751012AbdAPX6v (ORCPT ); Mon, 16 Jan 2017 18:58:51 -0500 Received: from orsmga004.jf.intel.com ([10.7.209.38]) by orsmga104.jf.intel.com with ESMTP; 16 Jan 2017 15:58:51 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.33,241,1477983600"; d="scan'208";a="49464989" Received: from bee.sh.intel.com (HELO bee) ([10.239.97.14]) by orsmga004.jf.intel.com with ESMTP; 16 Jan 2017 15:58:50 -0800 Received: from kbuild by bee with local (Exim 4.84_2) (envelope-from ) id 1cTHCv-0002E9-Mw; Tue, 17 Jan 2017 08:01:01 +0800 Date: Tue, 17 Jan 2017 07:58:03 +0800 From: kbuild test robot To: John Johansen Cc: kbuild-all@01.org, linux-security-module@vger.kernel.org Subject: [PATCH] apparmor: fix boolreturn.cocci warnings Message-ID: <20170116235757.GA82084@cairo.lkp.intel.com> References: <201701170745.0pb8o4vq%fengguang.wu@intel.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <201701170745.0pb8o4vq%fengguang.wu@intel.com> User-Agent: Mutt/1.5.23 (2014-03-12) X-SA-Exim-Connect-IP: X-SA-Exim-Mail-From: fengguang.wu@intel.com X-SA-Exim-Scanned: No (on bee); SAEximRunCond expanded to false Sender: owner-linux-security-module@vger.kernel.org Precedence: bulk List-ID: X-Virus-Scanned: ClamAV using ClamSMTP security/apparmor/lib.c:132:9-10: WARNING: return of 0/1 in function 'aa_policy_init' with return type bool Return statements in functions returning bool should use true/false instead of 1/0. Generated by: scripts/coccinelle/misc/boolreturn.cocci Signed-off-by: Fengguang Wu --- lib.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) -- To unsubscribe from this list: send the line "unsubscribe linux-security-module" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html --- a/security/apparmor/lib.c +++ b/security/apparmor/lib.c @@ -129,13 +129,13 @@ bool aa_policy_init(struct aa_policy *po } else policy->hname = kstrdup(name, GFP_KERNEL); if (!policy->hname) - return 0; + return false; /* base.name is a substring of fqname */ policy->name = (char *)hname_tail(policy->hname); INIT_LIST_HEAD(&policy->list); INIT_LIST_HEAD(&policy->profiles); - return 1; + return true; } /**