diff mbox series

[v1,1/3] string_helpers: Move string_is_valid() to the header

Message ID 20230203140501.67659-1-andriy.shevchenko@linux.intel.com (mailing list archive)
State Superseded
Delegated to: Netdev Maintainers
Headers show
Series [v1,1/3] string_helpers: Move string_is_valid() to the header | expand

Checks

Context Check Description
netdev/tree_selection success Guessed tree name to be net-next, async
netdev/fixes_present success Fixes tag not required for -next series
netdev/subject_prefix warning Target tree name not specified in the subject
netdev/cover_letter warning Series does not have a cover letter
netdev/patch_count success Link
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit success Errors and warnings before: 15358 this patch: 15358
netdev/cc_maintainers warning 5 maintainers not CCed: daniel.vetter@ffwll.ch ddrokosov@sberdevices.ru jani.nikula@intel.com lucas.demarchi@intel.com cezary.rojewski@intel.com
netdev/build_clang success Errors and warnings before: 3463 this patch: 3463
netdev/module_param success Was 0 now: 0
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/check_selftest success No net selftest shell script
netdev/verify_fixes success No Fixes tag
netdev/build_allmodconfig_warn success Errors and warnings before: 16210 this patch: 16210
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 29 lines checked
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/source_inline success Was 1 now: 0

Commit Message

Andy Shevchenko Feb. 3, 2023, 2:04 p.m. UTC
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(-)

Comments

Simon Horman Feb. 4, 2023, 1:25 p.m. UTC | #1
On Fri, Feb 03, 2023 at 04:04:59PM +0200, Andy Shevchenko wrote:
> Move string_is_valid() to the header for wider use.
> 
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>

For networking patches, the target tree, in this case net-next, should
appear in the patch subject:

[PATCH v1 net-next 1/3] string_helpers: Move string_is_valid()

That notwithstanding,

Reviewed-by: Simon Horman <simon.horman@corigine.com>
diff mbox series

Patch

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)