Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751466AbdISNxy (ORCPT ); Tue, 19 Sep 2017 09:53:54 -0400 Received: from mail-pg0-f67.google.com ([74.125.83.67]:35377 "EHLO mail-pg0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750972AbdISNxw (ORCPT ); Tue, 19 Sep 2017 09:53:52 -0400 X-Google-Smtp-Source: AOwi7QB9VyqFxzsSy6jfbyk4RRKUUN3IBotQVsR1B3shHyfDl8hlhd1hvzrDYKNsgEYx4ddjxBjjFA== From: Bhumika Goyal To: julia.lawall@lip6.fr, john.johansen@canonical.com, james.l.morris@oracle.com, serge@hallyn.com, linux-security-module@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Bhumika Goyal Subject: [PATCH] apparmor: make allperms structure const Date: Tue, 19 Sep 2017 19:23:19 +0530 Message-Id: <1505829199-6657-1-git-send-email-bhumirks@gmail.com> X-Mailer: git-send-email 1.9.1 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1236 Lines: 39 Make this structure const as it is only used as a copy operations in the files referencing it. Add const to the declaration in the header too. Structure found using a Coccinelle script and changes done by hand. Signed-off-by: Bhumika Goyal --- security/apparmor/include/perms.h | 2 +- security/apparmor/lib.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/security/apparmor/include/perms.h b/security/apparmor/include/perms.h index af04d5a..95ac9b6 100644 --- a/security/apparmor/include/perms.h +++ b/security/apparmor/include/perms.h @@ -90,7 +90,7 @@ struct aa_perms { #define ALL_PERMS_MASK 0xffffffff extern struct aa_perms nullperms; -extern struct aa_perms allperms; +extern const struct aa_perms allperms; #define xcheck(FN1, FN2) \ diff --git a/security/apparmor/lib.c b/security/apparmor/lib.c index 8818621..5b2c245 100644 --- a/security/apparmor/lib.c +++ b/security/apparmor/lib.c @@ -25,7 +25,7 @@ #include "include/policy.h" struct aa_perms nullperms; -struct aa_perms allperms = { .allow = ALL_PERMS_MASK, +const struct aa_perms allperms = { .allow = ALL_PERMS_MASK, .quiet = ALL_PERMS_MASK, .hide = ALL_PERMS_MASK }; -- 1.9.1