netfilter-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Thomas Haller <thaller@redhat.com>
To: NetFilter <netfilter-devel@vger.kernel.org>
Cc: Thomas Haller <thaller@redhat.com>
Subject: [PATCH nft 1/1] datatype: rename "dtype_clone()" to datatype_clone()
Date: Fri,  8 Sep 2023 19:34:47 +0200	[thread overview]
Message-ID: <20230908173505.1182605-1-thaller@redhat.com> (raw)

The struct is called "datatype" and related functions have the fitting
"datatype_" prefix. Rename.

Also rename the internal "dtype_alloc()" to "datatype_alloc()".

This is a follow up to commit 01a13882bb59 ('src: add reference counter
for dynamic datatypes'), which started adding "datatype_*()" functions.

Signed-off-by: Thomas Haller <thaller@redhat.com>
---
 include/datatype.h | 2 +-
 src/datatype.c     | 8 ++++----
 src/evaluate.c     | 4 ++--
 src/payload.c      | 2 +-
 4 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/include/datatype.h b/include/datatype.h
index 9ce7359cd340..6146eda1d2ec 100644
--- a/include/datatype.h
+++ b/include/datatype.h
@@ -177,7 +177,7 @@ extern const struct datatype *datatype_lookup_byname(const char *name);
 extern struct datatype *datatype_get(const struct datatype *dtype);
 extern void datatype_set(struct expr *expr, const struct datatype *dtype);
 extern void datatype_free(const struct datatype *dtype);
-struct datatype *dtype_clone(const struct datatype *orig_dtype);
+struct datatype *datatype_clone(const struct datatype *orig_dtype);
 
 struct parse_ctx {
 	struct symbol_tables	*tbl;
diff --git a/src/datatype.c b/src/datatype.c
index eff9fa53e354..678a16b1f3af 100644
--- a/src/datatype.c
+++ b/src/datatype.c
@@ -1198,7 +1198,7 @@ static struct error_record *concat_type_parse(struct parse_ctx *ctx,
 		     sym->dtype->desc);
 }
 
-static struct datatype *dtype_alloc(void)
+static struct datatype *datatype_alloc(void)
 {
 	struct datatype *dtype;
 
@@ -1229,7 +1229,7 @@ void datatype_set(struct expr *expr, const struct datatype *dtype)
 	expr->dtype = datatype_get(dtype);
 }
 
-struct datatype *dtype_clone(const struct datatype *orig_dtype)
+struct datatype *datatype_clone(const struct datatype *orig_dtype)
 {
 	struct datatype *dtype;
 
@@ -1285,7 +1285,7 @@ const struct datatype *concat_type_alloc(uint32_t type)
 	}
 	strncat(desc, ")", sizeof(desc) - strlen(desc) - 1);
 
-	dtype		= dtype_alloc();
+	dtype		= datatype_alloc();
 	dtype->type	= type;
 	dtype->size	= size;
 	dtype->subtypes = subtypes;
@@ -1305,7 +1305,7 @@ const struct datatype *set_datatype_alloc(const struct datatype *orig_dtype,
 	if (orig_dtype != &integer_type)
 		return orig_dtype;
 
-	dtype = dtype_clone(orig_dtype);
+	dtype = datatype_clone(orig_dtype);
 	dtype->byteorder = byteorder;
 
 	return dtype;
diff --git a/src/evaluate.c b/src/evaluate.c
index 8d53994a8f18..b0c6919f600a 100644
--- a/src/evaluate.c
+++ b/src/evaluate.c
@@ -1518,7 +1518,7 @@ static int expr_evaluate_concat(struct eval_ctx *ctx, struct expr **expr)
 		if (!key && i->dtype->type == TYPE_INTEGER) {
 			struct datatype *clone;
 
-			clone = dtype_clone(i->dtype);
+			clone = datatype_clone(i->dtype);
 			clone->size = i->len;
 			clone->byteorder = i->byteorder;
 			clone->refcnt = 1;
@@ -4546,7 +4546,7 @@ static int set_expr_evaluate_concat(struct eval_ctx *ctx, struct expr **expr)
 		    i->dtype->type == TYPE_INTEGER) {
 			struct datatype *dtype;
 
-			dtype = dtype_clone(i->dtype);
+			dtype = datatype_clone(i->dtype);
 			dtype->size = i->len;
 			dtype->byteorder = i->byteorder;
 			dtype->refcnt = 1;
diff --git a/src/payload.c b/src/payload.c
index c8faea99eb07..dcd87485c068 100644
--- a/src/payload.c
+++ b/src/payload.c
@@ -250,7 +250,7 @@ static struct expr *payload_expr_parse_udata(const struct nftnl_udata *attr)
 		expr->payload.offset = offset;
 		expr->payload.is_raw = true;
 		expr->len = len;
-		dtype = dtype_clone(&xinteger_type);
+		dtype = datatype_clone(&xinteger_type);
 		dtype->size = len;
 		dtype->byteorder = BYTEORDER_BIG_ENDIAN;
 		dtype->refcnt = 1;
-- 
2.41.0


                 reply	other threads:[~2023-09-08 17:36 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20230908173505.1182605-1-thaller@redhat.com \
    --to=thaller@redhat.com \
    --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).