From patchwork Thu Oct 30 13:33:55 2008 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Manish Katiyar X-Patchwork-Id: 6499 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by ozlabs.org (Postfix) with ESMTP id CB0AFDDDE3 for ; Fri, 31 Oct 2008 00:34:05 +1100 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754256AbYJ3NeA (ORCPT ); Thu, 30 Oct 2008 09:34:00 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1754222AbYJ3Nd7 (ORCPT ); Thu, 30 Oct 2008 09:33:59 -0400 Received: from ti-out-0910.google.com ([209.85.142.186]:30000 "EHLO ti-out-0910.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753773AbYJ3Nd6 (ORCPT ); Thu, 30 Oct 2008 09:33:58 -0400 Received: by ti-out-0910.google.com with SMTP id b6so312373tic.23 for ; Thu, 30 Oct 2008 06:33:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to :subject:cc:in-reply-to:mime-version:content-type :content-transfer-encoding:content-disposition:references; bh=nAMvVlZjkryKIrS34LRrWbRKy/WVN6nIHPrM/bOtNvo=; b=UVlY2sCEGgQxKF5ndnjM7PWBu2s6G0pEDmKfuHibmLaXRbdPdgcA/Mouh/+k/woUuv YpPqO96TBAM7WOxYSQerNNlIeZQkzUiF2VZOId9HcR9NcoJnh1gv4eu39XRBgp0vs6cJ K9++As4qU3eu4KGaj9eMxd0jvGAq2U6RePv/U= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:cc:in-reply-to:mime-version :content-type:content-transfer-encoding:content-disposition :references; b=Er9ock4pml2OXNJiD5vC9D9NBFCqjE8X9pomrSfJHnfFMYZEJwOfY0rxqbNW/F1k/m fLtpIvXImP9dfXSt111s0gd2kUyTBqOJ4bvoX5TaGfEoM+HH66vEU1BRj1M7kqTdQoub /LAg3trWi7vwR+UWTCawwQBvUUza4a8ic679U= Received: by 10.110.2.2 with SMTP id 2mr7234816tib.31.1225373635453; Thu, 30 Oct 2008 06:33:55 -0700 (PDT) Received: by 10.110.17.11 with HTTP; Thu, 30 Oct 2008 06:33:55 -0700 (PDT) Message-ID: Date: Thu, 30 Oct 2008 19:03:55 +0530 From: "Manish Katiyar" To: "Paul Moore" Subject: Re: [PATCH] : Fix compilation warnings in net/netlabel/netlabel_addrlist.c Cc: netdev@vger.kernel.org, kernel-janitors@vger.kernel.org In-Reply-To: <200810300812.39810.paul.moore@hp.com> MIME-Version: 1.0 Content-Disposition: inline References: <200810291543.49225.paul.moore@hp.com> <200810300812.39810.paul.moore@hp.com> Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org On Thu, Oct 30, 2008 at 5:42 PM, Paul Moore wrote: > On Wednesday 29 October 2008 10:10:36 pm Manish Katiyar wrote: >> On Thu, Oct 30, 2008 at 1:13 AM, Paul Moore wrote: >> > On Wednesday 29 October 2008 2:27:44 pm you wrote: >> >> Hi Paul, >> >> >> >> Does this look better ?? Appreciate your help. Patch compile >> >> tested. >> >> >> >> Enable netlabel auditing functions only when CONFIG_AUDIT is set >> >> >> >> Signed-off-by: Manish Katiyar >> > >> > Much better, just some style nits noted below that need to be >> > addressed ... >> >> Hi Paul, >> >> Updated patch below as per your comments. >> >> Enable netlabel auditing functions only when CONFIG_AUDIT is set >> >> Signed-off-by: Manish Katiyar > > Thanks for sticking with this, I appreciate it. There is still one > small style nit (see below) but it is really my fault for not being > more specific. Unless you object I'll go ahead and fix it up when I > apply the patch. > > I'll send a git pull request out to netdev later today, including your > patch, as there are two other labeled networking patches that need to > make the next 2.6.28-rcX release. > >> --- >> net/netlabel/netlabel_addrlist.c | 2 ++ >> net/netlabel/netlabel_addrlist.h | 22 ++++++++++++++++++++++ >> 2 files changed, 24 insertions(+), 0 deletions(-) >> >> diff --git a/net/netlabel/netlabel_addrlist.c >> b/net/netlabel/netlabel_addrlist.c index b0925a3..3fe73c2 100644 >> --- a/net/netlabel/netlabel_addrlist.c >> +++ b/net/netlabel/netlabel_addrlist.c >> @@ -327,6 +327,7 @@ struct netlbl_af6list >> *netlbl_af6list_remove(const struct in6_addr *addr, >> * Write the IPv4 address and address mask, if necessary, to >> @audit_buf. * >> */ >> +#ifdef CONFIG_AUDIT >> void netlbl_af4list_audit_addr(struct audit_buffer *audit_buf, >> int src, const char *dev, >> __be32 addr, __be32 mask) > > When I said to move the #ifdef below the comment, I meant below > the "Audit Helper Functions" comment but before the function's kdoc > comment header. Hi Paul, Below is the updated patch. Enable netlabel auditing functions only when CONFIG_AUDIT is set Signed-off-by: Manish Katiyar --- net/netlabel/netlabel_addrlist.c | 2 ++ net/netlabel/netlabel_addrlist.h | 22 ++++++++++++++++++++++ 2 files changed, 24 insertions(+), 0 deletions(-) #endif diff --git a/net/netlabel/netlabel_addrlist.c b/net/netlabel/netlabel_addrlist.c index b0925a3..249f6b9 100644 --- a/net/netlabel/netlabel_addrlist.c +++ b/net/netlabel/netlabel_addrlist.c @@ -315,6 +315,7 @@ struct netlbl_af6list *netlbl_af6list_remove(const struct in6_addr *addr, * Audit Helper Functions */ +#ifdef CONFIG_AUDIT /** * netlbl_af4list_audit_addr - Audit an IPv4 address * @audit_buf: audit buffer @@ -386,3 +387,4 @@ void netlbl_af6list_audit_addr(struct audit_buffer *audit_buf, } } #endif /* IPv6 */ +#endif /* CONFIG_AUDIT */ diff --git a/net/netlabel/netlabel_addrlist.h b/net/netlabel/netlabel_addrlist.h index 0242bea..3212965 100644 --- a/net/netlabel/netlabel_addrlist.h +++ b/net/netlabel/netlabel_addrlist.h @@ -120,9 +120,19 @@ struct netlbl_af4list *netlbl_af4list_search(__be32 addr, struct netlbl_af4list *netlbl_af4list_search_exact(__be32 addr, __be32 mask, struct list_head *head); + +#ifdef CONFIG_AUDIT void netlbl_af4list_audit_addr(struct audit_buffer *audit_buf, int src, const char *dev, __be32 addr, __be32 mask); +#else +static inline void netlbl_af4list_audit_addr(struct audit_buffer *audit_buf, + int src, const char *dev, + __be32 addr, __be32 mask) +{ + return; +} +#endif #if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) @@ -179,11 +189,23 @@ struct netlbl_af6list *netlbl_af6list_search(const struct in6_addr *addr, struct netlbl_af6list *netlbl_af6list_search_exact(const struct in6_addr *addr, const struct in6_addr *mask, struct list_head *head); + +#ifdef CONFIG_AUDIT void netlbl_af6list_audit_addr(struct audit_buffer *audit_buf, int src, const char *dev, const struct in6_addr *addr, const struct in6_addr *mask); +#else +static inline void netlbl_af6list_audit_addr(struct audit_buffer *audit_buf, + int src, + const char *dev, + const struct in6_addr *addr, + const struct in6_addr *mask) +{ + return; +} +#endif #endif /* IPV6 */