netfilter-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jeremy Sowden <jeremy@azazel.net>
To: Netfilter Devel <netfilter-devel@vger.kernel.org>
Subject: [PATCH ulogd2 v2 v2 13/34] output: remove zero-initialized `struct ulogd_plugin` members
Date: Tue, 29 Nov 2022 21:47:28 +0000	[thread overview]
Message-ID: <20221129214749.247878-14-jeremy@azazel.net> (raw)
In-Reply-To: <20221129214749.247878-1-jeremy@azazel.net>

Struct members are zero-initialized as a matter of course.

Use consistent formatting.

Signed-off-by: Jeremy Sowden <jeremy@azazel.net>
---
 output/dbi/ulogd_output_DBI.c         | 10 ++++------
 output/ipfix/ulogd_output_IPFIX.c     | 20 ++++++++++----------
 output/mysql/ulogd_output_MYSQL.c     | 22 ++++++++++------------
 output/pcap/ulogd_output_PCAP.c       |  6 +++---
 output/pgsql/ulogd_output_PGSQL.c     | 10 ++++------
 output/sqlite3/ulogd_output_SQLITE3.c | 18 +++++++++---------
 6 files changed, 40 insertions(+), 46 deletions(-)

diff --git a/output/dbi/ulogd_output_DBI.c b/output/dbi/ulogd_output_DBI.c
index 88b530ead034..6312ac1649e2 100644
--- a/output/dbi/ulogd_output_DBI.c
+++ b/output/dbi/ulogd_output_DBI.c
@@ -287,16 +287,14 @@ static int configure_dbi(struct ulogd_pluginstance *upi,
 }
 
 static struct ulogd_plugin dbi_plugin = {
-	.name 		= "DBI",
-	.input 		= {
-		.keys	= NULL,
-		.num_keys = 0,
+	.name		= "DBI",
+	.input		= {
 		.type	= ULOGD_DTYPE_PACKET | ULOGD_DTYPE_FLOW,
 	},
-	.output 	= {
+	.output		= {
 		.type	= ULOGD_DTYPE_SINK,
 	},
-	.config_kset 	= &dbi_kset,
+	.config_kset	= &dbi_kset,
 	.priv_size	= sizeof(struct dbi_instance),
 	.configure	= &configure_dbi,
 	.start		= &ulogd_db_start,
diff --git a/output/ipfix/ulogd_output_IPFIX.c b/output/ipfix/ulogd_output_IPFIX.c
index 45fd36bc271c..f252ec72b5f6 100644
--- a/output/ipfix/ulogd_output_IPFIX.c
+++ b/output/ipfix/ulogd_output_IPFIX.c
@@ -486,22 +486,22 @@ again:
 }
 
 static struct ulogd_plugin ipfix_plugin = {
-	.name = "IPFIX",
-	.input = {
+	.name           = "IPFIX",
+	.input          = {
 		.keys = ipfix_in_keys,
 		.num_keys = ARRAY_SIZE(ipfix_in_keys),
 		.type = ULOGD_DTYPE_PACKET | ULOGD_DTYPE_FLOW | ULOGD_DTYPE_SUM
 	},
-	.output = {
+	.output         = {
 		.type = ULOGD_DTYPE_SINK
 	},
-	.config_kset = (struct config_keyset *) &ipfix_kset,
-	.priv_size = sizeof(struct ipfix_priv),
-	.configure = ipfix_configure,
-	.start = ipfix_start,
-	.stop = ipfix_stop,
-	.interp = ipfix_interp,
-	.version = VERSION,
+	.config_kset    = (struct config_keyset *) &ipfix_kset,
+	.priv_size      = sizeof(struct ipfix_priv),
+	.configure      = ipfix_configure,
+	.start          = ipfix_start,
+	.stop           = ipfix_stop,
+	.interp         = ipfix_interp,
+	.version        = VERSION,
 };
 
 static void __attribute__ ((constructor)) init(void)
diff --git a/output/mysql/ulogd_output_MYSQL.c b/output/mysql/ulogd_output_MYSQL.c
index c98b98284748..5891207d5990 100644
--- a/output/mysql/ulogd_output_MYSQL.c
+++ b/output/mysql/ulogd_output_MYSQL.c
@@ -259,23 +259,21 @@ static int configure_mysql(struct ulogd_pluginstance *upi,
 }
 
 static struct ulogd_plugin plugin_mysql = {
-	.name = "MYSQL",
-	.input = {
-		.keys = NULL,
-		.num_keys = 0,
+	.name	     = "MYSQL",
+	.input	     = {
 		.type = ULOGD_DTYPE_PACKET | ULOGD_DTYPE_FLOW,
 	},
-	.output = {
+	.output	     = {
 		.type = ULOGD_DTYPE_SINK,
 	},
 	.config_kset = &kset_mysql,
-	.priv_size = sizeof(struct mysql_instance),
-	.configure = &configure_mysql,
-	.start	   = &ulogd_db_start,
-	.stop	   = &ulogd_db_stop,
-	.signal	   = &ulogd_db_signal,
-	.interp	   = &ulogd_db_interp,
-	.version   = VERSION,
+	.priv_size   = sizeof(struct mysql_instance),
+	.configure   = &configure_mysql,
+	.start	     = &ulogd_db_start,
+	.stop	     = &ulogd_db_stop,
+	.signal	     = &ulogd_db_signal,
+	.interp	     = &ulogd_db_interp,
+	.version     = VERSION,
 };
 
 static void __attribute__ ((constructor)) init(void)
diff --git a/output/pcap/ulogd_output_PCAP.c b/output/pcap/ulogd_output_PCAP.c
index 5f9fde3c48ed..5336f88e539d 100644
--- a/output/pcap/ulogd_output_PCAP.c
+++ b/output/pcap/ulogd_output_PCAP.c
@@ -287,13 +287,13 @@ static int stop_pcap(struct ulogd_pluginstance *upi)
 }
 
 static struct ulogd_plugin pcap_plugin = {
-	.name = "PCAP",
-	.input = {
+	.name		= "PCAP",
+	.input		= {
 		.keys = pcap_keys,
 		.num_keys = ARRAY_SIZE(pcap_keys),
 		.type = ULOGD_DTYPE_PACKET,
 	},
-	.output = {
+	.output		= {
 		.type = ULOGD_DTYPE_SINK,
 	},
 	.config_kset	= &pcap_kset,
diff --git a/output/pgsql/ulogd_output_PGSQL.c b/output/pgsql/ulogd_output_PGSQL.c
index b798555b5ade..bc0eae7558b3 100644
--- a/output/pgsql/ulogd_output_PGSQL.c
+++ b/output/pgsql/ulogd_output_PGSQL.c
@@ -337,16 +337,14 @@ static int configure_pgsql(struct ulogd_pluginstance *upi,
 }
 
 static struct ulogd_plugin pgsql_plugin = {
-	.name 		= "PGSQL",
-	.input 		= {
-		.keys	= NULL,
-		.num_keys = 0,
+	.name		= "PGSQL",
+	.input		= {
 		.type	= ULOGD_DTYPE_PACKET | ULOGD_DTYPE_FLOW,
 	},
-	.output 	= {
+	.output		= {
 		.type	= ULOGD_DTYPE_SINK,
 	},
-	.config_kset 	= &pgsql_kset,
+	.config_kset	= &pgsql_kset,
 	.priv_size	= sizeof(struct pgsql_instance),
 	.configure	= &configure_pgsql,
 	.start		= &ulogd_db_start,
diff --git a/output/sqlite3/ulogd_output_SQLITE3.c b/output/sqlite3/ulogd_output_SQLITE3.c
index 40d99ca3b249..32459dd6c4c5 100644
--- a/output/sqlite3/ulogd_output_SQLITE3.c
+++ b/output/sqlite3/ulogd_output_SQLITE3.c
@@ -419,20 +419,20 @@ sqlite3_stop(struct ulogd_pluginstance *pi)
 }
 
 static struct ulogd_plugin sqlite3_plugin = {
-	.name = "SQLITE3",
-	.input = {
+	.name	     = "SQLITE3",
+	.input	     = {
 		.type = ULOGD_DTYPE_PACKET | ULOGD_DTYPE_FLOW,
 	},
-	.output = {
+	.output	     = {
 		.type = ULOGD_DTYPE_SINK,
 	},
 	.config_kset = &sqlite3_kset,
-	.priv_size = sizeof(struct sqlite3_priv),
-	.configure = sqlite3_configure,
-	.start = sqlite3_start,
-	.stop = sqlite3_stop,
-	.interp = sqlite3_interp,
-	.version = VERSION,
+	.priv_size   = sizeof(struct sqlite3_priv),
+	.configure   = sqlite3_configure,
+	.start	     = sqlite3_start,
+	.stop	     = sqlite3_stop,
+	.interp	     = sqlite3_interp,
+	.version     = VERSION,
 };
 
 static void __attribute__ ((constructor)) init(void)
-- 
2.35.1


  parent reply	other threads:[~2022-11-29 21:59 UTC|newest]

Thread overview: 40+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-29 21:47 [PATCH ulogd2 v2 v2 00/34] Refactor of the DB output plug-ins Jeremy Sowden
2022-11-29 21:47 ` [PATCH ulogd2 v2 v2 01/34] ulogd: fix parse-error check Jeremy Sowden
2022-11-29 21:47 ` [PATCH ulogd2 v2 v2 02/34] filter: fix buffer sizes in filter plug-ins Jeremy Sowden
2022-11-29 21:47 ` [PATCH ulogd2 v2 v2 03/34] output: JSON: remove incorrect config value check Jeremy Sowden
2022-11-29 21:47 ` [PATCH ulogd2 v2 v2 04/34] db: fix back-log capacity checks Jeremy Sowden
2022-11-29 21:47 ` [PATCH ulogd2 v2 v2 05/34] build: add checks to configure.ac Jeremy Sowden
2022-11-30 10:04   ` Jan Engelhardt
2022-11-29 21:47 ` [PATCH ulogd2 v2 v2 06/34] src: remove some trailing white space Jeremy Sowden
2022-11-29 21:47 ` [PATCH ulogd2 v2 v2 07/34] src: remove zero-valued config-key fields Jeremy Sowden
2022-11-30 10:21   ` Jan Engelhardt
2022-11-29 21:47 ` [PATCH ulogd2 v2 v2 08/34] src: parenthesize config-entry macro arguments Jeremy Sowden
2022-11-29 21:47 ` [PATCH ulogd2 v2 v2 09/34] src: define constructors and destructors consistently Jeremy Sowden
2022-11-29 21:47 ` [PATCH ulogd2 v2 v2 10/34] src: remove `TIME_ERR` macro Jeremy Sowden
2022-11-29 21:47 ` [PATCH ulogd2 v2 v2 11/34] src: remove superfluous casts Jeremy Sowden
2022-11-29 21:47 ` [PATCH ulogd2 v2 v2 12/34] conffile: replace malloc+strcpy with strdup Jeremy Sowden
2022-11-29 21:47 ` Jeremy Sowden [this message]
2022-11-30 10:26   ` [PATCH ulogd2 v2 v2 13/34] output: remove zero-initialized `struct ulogd_plugin` members Jan Engelhardt
2022-11-29 21:47 ` [PATCH ulogd2 v2 v2 14/34] output: de-duplicate allocation of input keys Jeremy Sowden
2022-11-29 21:47 ` [PATCH ulogd2 v2 v2 15/34] db: reorganize source Jeremy Sowden
2022-11-29 21:47 ` [PATCH ulogd2 v2 v2 16/34] db: use consistent integer return values to indicate errors Jeremy Sowden
2022-11-29 21:47 ` [PATCH ulogd2 v2 v2 17/34] db: change return type of two functions to `void` Jeremy Sowden
2022-11-29 21:47 ` [PATCH ulogd2 v2 v2 18/34] db: open-code `_loop_reconnect_db` Jeremy Sowden
2022-11-29 21:47 ` [PATCH ulogd2 v2 v2 19/34] db: improve calculation of sql statement length Jeremy Sowden
2022-11-29 21:47 ` [PATCH ulogd2 v2 v2 20/34] db: refactor configuration Jeremy Sowden
2022-11-29 21:47 ` [PATCH ulogd2 v2 v2 21/34] db: refactor ring-buffer initialization Jeremy Sowden
2022-11-29 21:47 ` [PATCH ulogd2 v2 v2 22/34] db: refactor ring-buffer Jeremy Sowden
2022-11-29 21:47 ` [PATCH ulogd2 v2 v2 23/34] db: refactor backlog Jeremy Sowden
2022-11-29 21:47 ` [PATCH ulogd2 v2 v2 24/34] db: use `struct db_stmt` objects more widely Jeremy Sowden
2022-11-29 21:47 ` [PATCH ulogd2 v2 v2 25/34] db: synchronize access to ring-buffer Jeremy Sowden
2022-11-29 21:47 ` [PATCH ulogd2 v2 v2 26/34] db: avoid cancelling ring-buffer thread Jeremy Sowden
2022-11-29 21:47 ` [PATCH ulogd2 v2 v2 27/34] db, IP2BIN: defer formatting of raw strings Jeremy Sowden
2022-11-29 21:47 ` [PATCH ulogd2 v2 v2 28/34] db: add prep & exec support Jeremy Sowden
2022-11-29 21:47 ` [PATCH ulogd2 v2 v2 29/34] output: mysql: " Jeremy Sowden
2022-11-29 21:47 ` [PATCH ulogd2 v2 v2 30/34] output: pgsql: remove a couple of struct members Jeremy Sowden
2022-11-29 21:47 ` [PATCH ulogd2 v2 v2 31/34] output: pgsql: remove variable-length arrays Jeremy Sowden
2022-11-29 21:47 ` [PATCH ulogd2 v2 v2 32/34] output: pgsql: tidy up `open_db_pgsql` and fix memory leak Jeremy Sowden
2022-11-29 21:47 ` [PATCH ulogd2 v2 v2 33/34] output: pgsql: add prep & exec support Jeremy Sowden
2022-11-29 21:47 ` [PATCH ulogd2 v2 v2 34/34] output: sqlite3: reimplement using the common DB API Jeremy Sowden
2022-11-30 10:27 ` [PATCH ulogd2 v2 v2 00/34] Refactor of the DB output plug-ins Pablo Neira Ayuso
2022-11-30 16:03   ` Jeremy Sowden

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20221129214749.247878-14-jeremy@azazel.net \
    --to=jeremy@azazel.net \
    --cc=netfilter-devel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).