From patchwork Sun Feb 5 00:14:51 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Weinberger X-Patchwork-Id: 139605 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.180.67]) by ozlabs.org (Postfix) with ESMTP id D9245B724C for ; Sun, 5 Feb 2012 11:17:53 +1100 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754749Ab2BEAQF (ORCPT ); Sat, 4 Feb 2012 19:16:05 -0500 Received: from a.ns.miles-group.at ([95.130.255.143]:47850 "EHLO radon.swed.at" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754659Ab2BEAPI (ORCPT ); Sat, 4 Feb 2012 19:15:08 -0500 Received: (qmail 5951 invoked by uid 89); 5 Feb 2012 00:15:07 -0000 Received: by simscan 1.3.1 ppid: 5873, pid: 5948, t: 0.1277s scanners: attach: 1.3.1 clamav: 0.96.5/m:53 Received: from unknown (HELO raccoon.haslach.nod.at) (richard@nod.at@212.183.99.246) by radon.swed.at with ESMTPA; 5 Feb 2012 00:15:06 -0000 From: Richard Weinberger To: netfilter-devel@vger.kernel.org Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org, eric.dumazet@gmail.com, jengelh@medozas.de, rostedt@goodmis.org, Richard Weinberger Subject: [PATCH 3/4] xt_log: Make printk() in sb_close() optional Date: Sun, 5 Feb 2012 01:14:51 +0100 Message-Id: <1328400892-22409-6-git-send-email-richard@nod.at> X-Mailer: git-send-email 1.7.7.3 In-Reply-To: <1328400892-22409-1-git-send-email-richard@nod.at> References: <1328400892-22409-1-git-send-email-richard@nod.at> Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Make printk() in sb_close() optional such that other modules can build a log string without printing it using printk(). Signed-off-by: Richard Weinberger --- include/net/netfilter/xt_log.h | 9 ++++++--- 1 files changed, 6 insertions(+), 3 deletions(-) diff --git a/include/net/netfilter/xt_log.h b/include/net/netfilter/xt_log.h index 0dfb34a..767e08d 100644 --- a/include/net/netfilter/xt_log.h +++ b/include/net/netfilter/xt_log.h @@ -39,10 +39,12 @@ static struct sbuff *sb_open(void) return m; } -static void sb_close(struct sbuff *m) +static void __sb_close(struct sbuff *m, int print) { - m->buf[m->count] = 0; - printk("%s\n", m->buf); + if (print) { + m->buf[m->count] = 0; + printk("%s\n", m->buf); + } if (likely(m != &emergency)) kfree(m); @@ -52,3 +54,4 @@ static void sb_close(struct sbuff *m) } } +#define sb_close(m) __sb_close(m, 1)