netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
To: Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
	Jakub Kicinski <kuba@kernel.org>, Xin Long <lucien.xin@gmail.com>,
	linux-kernel@vger.kernel.org, netdev@vger.kernel.org,
	dev@openvswitch.org, tipc-discussion@lists.sourceforge.net
Cc: Andy Shevchenko <andy@kernel.org>,
	"David S. Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@google.com>,
	Paolo Abeni <pabeni@redhat.com>,
	Pravin B Shelar <pshelar@ovn.org>, Jon Maloy <jmaloy@redhat.com>,
	Ying Xue <ying.xue@windriver.com>
Subject: [PATCH v1 1/3] string_helpers: Move string_is_valid() to the header
Date: Fri,  3 Feb 2023 16:04:59 +0200	[thread overview]
Message-ID: <20230203140501.67659-1-andriy.shevchenko@linux.intel.com> (raw)

Move string_is_valid() to the header for wider use.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
 include/linux/string_helpers.h | 5 +++++
 net/tipc/netlink_compat.c      | 6 +-----
 2 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/include/linux/string_helpers.h b/include/linux/string_helpers.h
index 88fb8e1d0421..01c9a432865a 100644
--- a/include/linux/string_helpers.h
+++ b/include/linux/string_helpers.h
@@ -12,6 +12,11 @@ struct device;
 struct file;
 struct task_struct;
 
+static inline bool string_is_valid(const char *s, int len)
+{
+	return memchr(s, '\0', len) ? true : false;
+}
+
 /* Descriptions of the types of units to
  * print in */
 enum string_size_units {
diff --git a/net/tipc/netlink_compat.c b/net/tipc/netlink_compat.c
index dfea27a906f2..75186cd551a0 100644
--- a/net/tipc/netlink_compat.c
+++ b/net/tipc/netlink_compat.c
@@ -39,6 +39,7 @@
 #include "node.h"
 #include "net.h"
 #include <net/genetlink.h>
+#include <linux/string_helpers.h>
 #include <linux/tipc_config.h>
 
 /* The legacy API had an artificial message length limit called
@@ -173,11 +174,6 @@ static struct sk_buff *tipc_get_err_tlv(char *str)
 	return buf;
 }
 
-static inline bool string_is_valid(char *s, int len)
-{
-	return memchr(s, '\0', len) ? true : false;
-}
-
 static int __tipc_nl_compat_dumpit(struct tipc_nl_compat_cmd_dump *cmd,
 				   struct tipc_nl_compat_msg *msg,
 				   struct sk_buff *arg)
-- 
2.39.1


             reply	other threads:[~2023-02-03 14:07 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-03 14:04 Andy Shevchenko [this message]
2023-02-03 14:05 ` [PATCH v1 2/3] genetlink: Use string_is_valid() helper Andy Shevchenko
2023-02-04 13:25   ` [ovs-dev] " Simon Horman
2023-02-03 14:05 ` [PATCH v1 3/3] openvswitch: " Andy Shevchenko
2023-02-04 13:26   ` [ovs-dev] " Simon Horman
2023-02-04 13:25 ` [ovs-dev] [PATCH v1 1/3] string_helpers: Move string_is_valid() to the header Simon Horman

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=20230203140501.67659-1-andriy.shevchenko@linux.intel.com \
    --to=andriy.shevchenko@linux.intel.com \
    --cc=andy@kernel.org \
    --cc=davem@davemloft.net \
    --cc=dev@openvswitch.org \
    --cc=edumazet@google.com \
    --cc=jmaloy@redhat.com \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lucien.xin@gmail.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=pshelar@ovn.org \
    --cc=tipc-discussion@lists.sourceforge.net \
    --cc=ying.xue@windriver.com \
    /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).