lib: string: add strreplace_nonalnum
Subsystems (5)
Heiner Kallweit
maintainercover lib: string: add strreplace_nonalnum
Add a new function strreplace_nonalnum that replaces all non-alphanumeric characters. Such functionality is needed e.g. when a string is supposed to be used in a file name. If '\0' is given as new character then non-alphanumeric characters are cut.
There doesn't seem to be a maintainer or mailing list for lib/string.c Therefore I hope it's ok to submit this through the netdev tree.
Heiner Kallweit (2):
lib: string: add strreplace_nonalnum
net: phy: aquantia: use new function strreplace_nonalnum
drivers/net/phy/aquantia_hwmon.c | 10 +--------- include/linux/string.h | 1 + lib/string.c | 27 +++++++++++++++++++++++++++ 3 files changed, 29 insertions(+), 9 deletions(-)
Signature · 1 line
2.21.0
Heiner Kallweit
maintainerPATCH 1/2 lib: string: add strreplace_nonalnum
Add a new function strreplace_nonalnum that replaces all non-alphanumeric characters. Such functionality is needed e.g. when a string is supposed to be used in a sysfs file name. If '\0' is given as new character then non-alphanumeric characters are cut.
--- include/linux/string.h | 1 + lib/string.c | 27 +++++++++++++++++++++++++++ 2 files changed, 28 insertions(+)
include/linux/string.h +1 -0
@@ -169,6 +169,7 @@ static inline void memcpy_flushcache(void *dst, const void *src, size_t cnt)#endif void *memchr_inv (const void *s,int c,size_t n);char *strreplace (char *s,char old,char new); +char *strreplace_nonalnum (char *s,char new);extern void kfree_const (const void *x);
lib/string.c +27 -0
@@ -1047,6 +1047,33 @@ char *strreplace(char *s, char old, char new) }EXPORT_SYMBOL (strreplace); +/** +* strreplace_nonalnum - Replace all non-alphanumeric characters in a string. +* @s: The string to operate on. +* @new: The character non-alphanumeric characters are replaced with. +* +* If new is '\0' then non-alphanumeric characters are cut. +* +* Returns pointer to the nul byte at the end of the modified string. +*/ +char *strreplace_nonalnum (char *s,char new) +{ +char *p = s; + +for (; *s; ++s) +if (isalnum (*s)) { +if (p != s) + *p = *s; + ++p; + }else if (new) { + *p++ = new; + } + *p ='\0' ; + +return p; +} +EXPORT_SYMBOL (strreplace_nonalnum); +void fortify_panic (const char *name) {pr_emerg ("detected buffer overflow in %s\n" , name);
Signature · 1 line
2.21.0
Heiner Kallweit
maintainerPATCH 1/2 lib: string: add strreplace_nonalnum
I submitted this through the netdev tree, maybe relevant for you as well. See also here: https://marc.info/?t=155103900100003&r=1&w=2
-------- Forwarded Message --------
Subject: [PATCH net-next 1/2] lib: string: add strreplace_nonalnum
Date: Sun, 3 Mar 2019 18:20:50 +0100
From: Heiner Kallweit <[email protected]>
To: Florian Fainelli <[email protected]>, Andrew Lunn <[email protected]>, David Miller <[email protected]>
CC: [email protected] <[email protected]>
Add a new function strreplace_nonalnum that replaces all non-alphanumeric characters. Such functionality is needed e.g. when a string is supposed to be used in a sysfs file name. If '\0' is given as new character then non-alphanumeric characters are cut.
--- include/linux/string.h | 1 + lib/string.c | 27 +++++++++++++++++++++++++++ 2 files changed, 28 insertions(+)
include/linux/string.h +1 -0
@@ -169,6 +169,7 @@ static inline void memcpy_flushcache(void *dst, const void *src, size_t cnt)#endif void *memchr_inv (const void *s,int c,size_t n);char *strreplace (char *s,char old,char new); +char *strreplace_nonalnum (char *s,char new);extern void kfree_const (const void *x);
lib/string.c +27 -0
@@ -1047,6 +1047,33 @@ char *strreplace(char *s, char old, char new) }EXPORT_SYMBOL (strreplace); +/** +* strreplace_nonalnum - Replace all non-alphanumeric characters in a string. +* @s: The string to operate on. +* @new: The character non-alphanumeric characters are replaced with. +* +* If new is '\0' then non-alphanumeric characters are cut. +* +* Returns pointer to the nul byte at the end of the modified string. +*/ +char *strreplace_nonalnum (char *s,char new) +{ +char *p = s; + +for (; *s; ++s) +if (isalnum (*s)) { +if (p != s) + *p = *s; + ++p; + }else if (new) { + *p++ = new; + } + *p ='\0' ; + +return p; +} +EXPORT_SYMBOL (strreplace_nonalnum); +void fortify_panic (const char *name) {pr_emerg ("detected buffer overflow in %s\n" , name);
Signature · 1 line
2.21.0
Quoted 10 lines · Heiner Kallweit
I submitted this through the netdev tree, maybe relevant for you as well. See also here: https://marc.info/?t=155103900100003&r=1&w=2
-------- Forwarded Message --------
Subject: [PATCH net-next 1/2] lib: string: addstrreplace_nonalnum
Date: Sun, 3 Mar 2019 18:20:50 +0100
From: Heiner Kallweit <[email protected]>
To: Florian Fainelli <[email protected]>, Andrew Lunn <[email protected]>, David Miller <[email protected]>
CC: [email protected] <[email protected]>
Quoted 4 lines
Add a new function
strreplace_nonalnumthat replaces all non-alphanumeric characters. Such functionality is needed e.g. when a string is supposed to be used in a sysfs file name. If '\0' is given as new character then non-alphanumeric characters are cut.
sysfs doesn't have any such requirements, it can use whatever you want to give it for a filename.
So don't create a random kernel function for sysfs please.
Quoted 25 lines
Signed-off-by Heiner Kallweit <[email protected]>--- include/linux/string.h | 1 + lib/string.c | 27 +++++++++++++++++++++++++++ 2 files changed, 28 insertions(+)include/linux/string.h +1
-0@@ -169,6 +169,7 @@ static inline void memcpy_flushcache(void *dst, const void *src, size_t cnt)#endif void *memchr_inv (const void *s,int c,size_t n);char *strreplace (char *s,char old,char new); +char *strreplace_nonalnum (char *s,char new);extern void kfree_const (const void *x);lib/string.c +0
-0@@ -1047,6 +1047,33 @@ char *strreplace(char *s, char old, char new) }
lib/string.c char *strreplace(char *s, char old, char new) · line 1057
Quoted 10 lines
lib/string.c +8
-0EXPORT_SYMBOL (strreplace); +/** +* strreplace_nonalnum - Replace all non-alphanumeric characters in a string. +* @s: The string to operate on. +* @new: The character non-alphanumeric characters are replaced with. +* +* If new is '\0' then non-alphanumeric characters are cut. +* +* Returns pointer to the nul byte at the end of the modified string.
Why do you need to point to the end of the string?
Quoted 4 lines
lib/string.c +4
-0+*/ +char *strreplace_nonalnum (char *s,char new) +{ +char *p = s;
lib/string.c char *strreplace(char *s, char old, char new) · line 1071
Quoted 10 lines
lib/string.c +10
-0+ +for (; *s; ++s) +if (isalnum (*s)) { +if (p != s) + *p = *s; + ++p; + }else if (new) { + *p++ = new; + } + *p ='\0' ;
No max length? No error checking? Surely we can do better, see the long thread on the kernel-hardnening list about string functions please.
greg k-h
Heiner Kallweit
maintainerQuoted 11 lines · Greg Kroah-Hartman
Quoted 10 lines · Heiner Kallweit
I submitted this through the netdev tree, maybe relevant for you as well. See also here: https://marc.info/?t=155103900100003&r=1&w=2
-------- Forwarded Message --------
Subject: [PATCH net-next 1/2] lib: string: addstrreplace_nonalnum
Date: Sun, 3 Mar 2019 18:20:50 +0100
From: Heiner Kallweit <[email protected]>
To: Florian Fainelli <[email protected]>, Andrew Lunn <[email protected]>, David Miller <[email protected]>
CC: [email protected] <[email protected]>
Quoted 8 lines
Quoted 4 lines
Add a new function
strreplace_nonalnumthat replaces all non-alphanumeric characters. Such functionality is needed e.g. when a string is supposed to be used in a sysfs file name. If '\0' is given as new character then non-alphanumeric characters are cut.sysfs doesn't have any such requirements, it can use whatever you want to give it for a filename.
Even a slash?
HWMON drivers is an example where such functionality occurs open-coded.
Quoted 29 lines
So don't create a random kernel function for sysfs please.
Quoted 27 lines
Signed-off-by Heiner Kallweit <[email protected]>--- include/linux/string.h | 1 + lib/string.c | 27 +++++++++++++++++++++++++++ 2 files changed, 28 insertions(+)include/linux/string.h +1
-0@@ -169,6 +169,7 @@ static inline void memcpy_flushcache(void *dst, const void *src, size_t cnt)#endif void *memchr_inv (const void *s,int c,size_t n);char *strreplace (char *s,char old,char new); +char *strreplace_nonalnum (char *s,char new);extern void kfree_const (const void *x);lib/string.c +0
-0@@ -1047,6 +1047,33 @@ char *strreplace(char *s, char old, char new) }EXPORT_SYMBOL (strreplace);
Quoted 11 lines
lib/string.c char *strreplace(char *s, char old, char new) · line 1057
Quoted 8 lines
lib/string.c +8
-0+/** +* strreplace_nonalnum - Replace all non-alphanumeric characters in a string. +* @s: The string to operate on. +* @new: The character non-alphanumeric characters are replaced with. +* +* If new is '\0' then non-alphanumeric characters are cut. +* +* Returns pointer to the nul byte at the end of the modified string. Why do you need to point to the end of the string?
I don't have to. I just tried to keep as close as possible to the original strreplace().
Quoted 10 lines
Quoted 10 lines
lib/string.c +9
-0+*/ +char *strreplace_nonalnum (char *s,char new) +{ +char *p = s; + +for (; *s; ++s) +if (isalnum (*s)) { +if (p != s) + *p = *s;
Quoted 9 lines
lib/string.c char *strreplace(char *s, char old, char new) · line 1071
Quoted 5 lines
lib/string.c +5
-0+ ++p; + }else if (new) { + *p++ = new; + } + *p ='\0' ;No max length? No error checking? Surely we can do better, see the long thread on the kernel-hardnening list about string functions please.
As for the review comment before, I basically used strreplace() as template and extended it. What you say about hardening is right, but it's open for quite a few functions, isn't it?
I'll have a look at the mail thread you mentioned.
Quoted 2 lines
greg k-h
Heiner
Quoted 17 lines · Heiner Kallweit
Quoted 16 lines · Greg Kroah-Hartman
Quoted 14 lines · Heiner Kallweit
I submitted this through the netdev tree, maybe relevant for you as well. See also here: https://marc.info/?t=155103900100003&r=1&w=2
-------- Forwarded Message --------
Subject: [PATCH net-next 1/2] lib: string: addstrreplace_nonalnum
Date: Sun, 3 Mar 2019 18:20:50 +0100
From: Heiner Kallweit <[email protected]>
To: Florian Fainelli <[email protected]>, Andrew Lunn <[email protected]>, David Miller <[email protected]>
CC: [email protected] <[email protected]>Add a new function
strreplace_nonalnumthat replaces all non-alphanumeric characters. Such functionality is needed e.g. when a string is supposed to be used in a sysfs file name. If '\0' is given as new character then non-alphanumeric characters are cut.
Quoted 4 lines
Quoted 3 lines
sysfs doesn't have any such requirements, it can use whatever you want to give it for a filename.
Even a slash?
Is a slash an illegal character for a file to have? It's up to the vfs to care about this, don't force random parts of the kernel to care :)
Quoted 1 line
HWMON drivers is an example where such functionality occurs open-coded.
Is that data coming from userspace or from a kernel driver?
thanks,
greg k-h
Heiner Kallweit
maintainerQuoted 21 lines · Greg Kroah-Hartman
Quoted 20 lines · Heiner Kallweit
Quoted 19 lines · Greg Kroah-Hartman
Quoted 10 lines · Heiner Kallweit
I submitted this through the netdev tree, maybe relevant for you as well. See also here: https://marc.info/?t=155103900100003&r=1&w=2
-------- Forwarded Message --------
Subject: [PATCH net-next 1/2] lib: string: addstrreplace_nonalnum
Date: Sun, 3 Mar 2019 18:20:50 +0100
From: Heiner Kallweit <[email protected]>
To: Florian Fainelli <[email protected]>, Andrew Lunn <[email protected]>, David Miller <[email protected]>
CC: [email protected] <[email protected]>Quoted 4 lines
Add a new function
strreplace_nonalnumthat replaces all non-alphanumeric characters. Such functionality is needed e.g. when a string is supposed to be used in a sysfs file name. If '\0' is given as new character then non-alphanumeric characters are cut.sysfs doesn't have any such requirements, it can use whatever you want to give it for a filename.
Quoted 9 lines
Quoted 1 line
Even a slash?
Is a slash an illegal character for a file to have? It's up to the vfs to care about this, don't force random parts of the kernel to care :)
Quoted 1 line
HWMON drivers is an example where such functionality occurs open-coded.
Is that data coming from userspace or from a kernel driver?
Usually from a kernel driver. That's whatDocumentation/hwmon/hwmon-kernel-api.txt says:
All supported hwmon device registration functions only accept valid device names. Device names including invalid characters (whitespace, '*', or '-') will be rejected. The 'name' parameter is mandatory.
The hwmon subsystem has an own function to check for such characters:hwmon_is_bad_char()
Quoted 4 lines
thanks,
greg k-h
Heiner
Quoted 27 lines · Heiner Kallweit
Quoted 26 lines · Greg Kroah-Hartman
Quoted 17 lines · Heiner Kallweit
Quoted 16 lines · Greg Kroah-Hartman
Quoted 14 lines · Heiner Kallweit
I submitted this through the netdev tree, maybe relevant for you as well. See also here: https://marc.info/?t=155103900100003&r=1&w=2
-------- Forwarded Message --------
Subject: [PATCH net-next 1/2] lib: string: addstrreplace_nonalnum
Date: Sun, 3 Mar 2019 18:20:50 +0100
From: Heiner Kallweit <[email protected]>
To: Florian Fainelli <[email protected]>, Andrew Lunn <[email protected]>, David Miller <[email protected]>
CC: [email protected] <[email protected]>Add a new function
strreplace_nonalnumthat replaces all non-alphanumeric characters. Such functionality is needed e.g. when a string is supposed to be used in a sysfs file name. If '\0' is given as new character then non-alphanumeric characters are cut.Quoted 4 lines
Quoted 3 lines
sysfs doesn't have any such requirements, it can use whatever you want to give it for a filename.
Even a slash?
Is a slash an illegal character for a file to have? It's up to the vfs to care about this, don't force random parts of the kernel to care :)
Quoted 6 lines
Quoted 4 lines
Quoted 1 line
HWMON drivers is an example where such functionality occurs open-coded.
Is that data coming from userspace or from a kernel driver?
Usually from a kernel driver. That's what
Documentation/hwmon/hwmon-kernel-api.txtsays:
Usually? So userspace can set the name?
Quoted 6 lines
All supported hwmon device registration functions only accept valid device names. Device names including invalid characters (whitespace, '*', or '-') will be rejected. The 'name' parameter is mandatory.
The hwmon subsystem has an own function to check for such characters:
hwmon_is_bad_char()
It looks like hwmon is the only thing that cares about this then, why do you want to make this a common function?
thanks,
greg k-h
Heiner Kallweit
maintainerQuoted 28 lines · Greg Kroah-Hartman
Quoted 27 lines · Heiner Kallweit
Quoted 26 lines · Greg Kroah-Hartman
Quoted 17 lines · Heiner Kallweit
Quoted 16 lines · Greg Kroah-Hartman
Quoted 14 lines · Heiner Kallweit
I submitted this through the netdev tree, maybe relevant for you as well. See also here: https://marc.info/?t=155103900100003&r=1&w=2
-------- Forwarded Message --------
Subject: [PATCH net-next 1/2] lib: string: addstrreplace_nonalnum
Date: Sun, 3 Mar 2019 18:20:50 +0100
From: Heiner Kallweit <[email protected]>
To: Florian Fainelli <[email protected]>, Andrew Lunn <[email protected]>, David Miller <[email protected]>
CC: [email protected] <[email protected]>Add a new function
strreplace_nonalnumthat replaces all non-alphanumeric characters. Such functionality is needed e.g. when a string is supposed to be used in a sysfs file name. If '\0' is given as new character then non-alphanumeric characters are cut.Quoted 4 lines
Quoted 3 lines
sysfs doesn't have any such requirements, it can use whatever you want to give it for a filename.
Even a slash?
Is a slash an illegal character for a file to have? It's up to the vfs to care about this, don't force random parts of the kernel to care :)
Quoted 9 lines
Quoted 6 lines
Quoted 4 lines
Quoted 1 line
HWMON drivers is an example where such functionality occurs open-coded.
Is that data coming from userspace or from a kernel driver?
Usually from a kernel driver. That's what
Documentation/hwmon/hwmon-kernel-api.txtsays:Usually? So userspace can set the name?
I'm not sure about that.
Quoted 10 lines
Quoted 6 lines
All supported hwmon device registration functions only accept valid device names. Device names including invalid characters (whitespace, '*', or '-') will be rejected. The 'name' parameter is mandatory.
The hwmon subsystem has an own function to check for such characters:
hwmon_is_bad_char()It looks like hwmon is the only thing that cares about this then, why do you want to make this a common function?
In phylib we have a similar issue, sysfs is broken if a PHY driver name includes a slash, typically if some driver author uses "10 / 100 Mbit" or similar.
IIRC for HWMON there has been some longer discussion about how to deal with naming, I'd be curious to hear Guenter's opinion on the topic.
Quoted 4 lines
thanks,
greg k-h
Heiner
Quoted 31 lines · Heiner Kallweit
Quoted 30 lines · Greg Kroah-Hartman
Quoted 29 lines · Heiner Kallweit
Quoted 28 lines · Greg Kroah-Hartman
Quoted 17 lines · Heiner Kallweit
Quoted 16 lines · Greg Kroah-Hartman
Quoted 14 lines · Heiner Kallweit
I submitted this through the netdev tree, maybe relevant for you as well. See also here: https://marc.info/?t=155103900100003&r=1&w=2
-------- Forwarded Message --------
Subject: [PATCH net-next 1/2] lib: string: addstrreplace_nonalnum
Date: Sun, 3 Mar 2019 18:20:50 +0100
From: Heiner Kallweit <[email protected]>
To: Florian Fainelli <[email protected]>, Andrew Lunn <[email protected]>, David Miller <[email protected]>
CC: [email protected] <[email protected]>Add a new function
strreplace_nonalnumthat replaces all non-alphanumeric characters. Such functionality is needed e.g. when a string is supposed to be used in a sysfs file name. If '\0' is given as new character then non-alphanumeric characters are cut.Quoted 4 lines
Quoted 3 lines
sysfs doesn't have any such requirements, it can use whatever you want to give it for a filename.
Even a slash?
Is a slash an illegal character for a file to have? It's up to the vfs to care about this, don't force random parts of the kernel to care :)
Quoted 1 line
HWMON drivers is an example where such functionality occurs open-coded.
Quoted 8 lines
Quoted 7 lines
Quoted 4 lines
Quoted 2 lines
Is that data coming from userspace or from a kernel driver?
Usually from a kernel driver. That's what
Documentation/hwmon/hwmon-kernel-api.txtsays:Usually? So userspace can set the name?
I'm not sure about that.
You might want to check :)
Quoted 7 lines
Quoted 7 lines
Quoted 6 lines
All supported hwmon device registration functions only accept valid device names. Device names including invalid characters (whitespace, '*', or '-') will be rejected. The 'name' parameter is mandatory.
The hwmon subsystem has an own function to check for such characters:
hwmon_is_bad_char()
Quoted 8 lines
Quoted 3 lines
It looks like hwmon is the only thing that cares about this then, why do you want to make this a common function?
In phylib we have a similar issue, sysfs is broken if a PHY driver name includes a slash, typically if some driver author uses "10 / 100 Mbit" or similar.
IIRC for HWMON there has been some longer discussion about how to deal with naming, I'd be curious to hear Guenter's opinion on the topic.
Making drivers "safe" from themselves is pretty foolish, as if they don't know they are doing stupid things, they will continue to do those stupid things :)
Having a driver name itself something bad like this is fine, nothing breaks except no one can access any sysfs files from the driver, so the driver needs to be fixed.
Now if userspace can set this string, that's a totaly different story, that needs to be properly sanitized, because as we all know, "all input is evil."
thanks,
greg k-h
Heiner Kallweit
maintainerPATCH 2/2 net: phy: aquantia: use new function strreplace_nonalnum
In reply to Heiner KallweitUse new function strreplace_nonalnum to simplify the code.
--- drivers/net/phy/aquantia_hwmon.c | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-)
drivers/net/phy/aquantia_hwmon.c +1 -9
@@ -226,20 +226,12 @@ int aqr_hwmon_probe(struct phy_device *phydev)struct device *dev = &phydev->mdio.dev;struct device *hwmon_dev;char *hwmon_name; -int i, j; hwmon_name =devm_kstrdup (dev,dev_name (dev),GFP_KERNEL );if (!hwmon_name)return -ENOMEM ; -for (i = j =0 ; hwmon_name[i]; i++) { -if (isalnum (hwmon_name[i])) { -if (i != j) - hwmon_name[j] = hwmon_name[i]; - j++; - } - } - hwmon_name[j] ='\0' ; +strreplace_nonalnum (hwmon_name,0 ); hwmon_dev =devm_hwmon_device_register_with_info (dev, hwmon_name, phydev, &aqr_hwmon_chip_info,NULL );
Signature · 1 line
2.21.0
Andrew Lunn
maintainerRe: [PATCH net-next 2/2] net: phy: aquantia: use new function strreplace_nonalnum
Quoted 1 line · Heiner Kallweit
Use new function
strreplace_nonalnumto simplify the code.
Hi Heiner
Both Marvell PHY drivers could use this.
sfp.c has a variant of this as well.
Andrew
Heiner Kallweit
maintainerRe: [PATCH net-next 2/2] net: phy: aquantia: use new function strreplace_nonalnum
Quoted 9 lines · Andrew Lunn
Quoted 1 line · Heiner Kallweit
Use new function
strreplace_nonalnumto simplify the code.Hi Heiner
Both Marvell PHY drivers could use this.
sfp.chas a variant of this as well.
Thanks! My plan was to provide a first user so that the new function gets accepted, and then look for more places where it could be used. Most likely there are few HWMON drivers also open-coding this functionality.
Quoted 2 lines
Andrew
Heiner
Andrew Lunn
maintainerQuoted 2 lines · Heiner Kallweit
There doesn't seem to be a maintainer or mailing list for
lib/string.cTherefore I hope it's ok to submit this through the netdev tree.
Hi Heiner
It is probably a good idea to Cc:
~/linux$ ./scripts/get_maintainer.pl -f lib/string.c
Alexander Shishkin <[email protected]> (commit_signer:2/2=100%,authored:2/2=100%,added_lines:31/31=100%,removed_lines:30/30=100%) Greg Kroah-Hartman <[email protected]> (commit_signer:2/2=100%)
Andy Shevchenko <[email protected]> (commit_signer:1/2=50%)
[email protected] (open list)
And also Guenter Roeck who does most of the HWMON maintenance work.
Andrew
Heiner Kallweit
maintainerQuoted 6 lines · Andrew Lunn
Quoted 2 lines · Heiner Kallweit
There doesn't seem to be a maintainer or mailing list for
lib/string.cTherefore I hope it's ok to submit this through the netdev tree.Hi Heiner
Quoted 8 lines
It is probably a good idea to Cc:
~/linux$
./scripts/get_maintainer.pl-flib/string.c
Alexander Shishkin <[email protected]> (commit_signer:2/2=100%,authored:2/2=100%,added_lines:31/31=100%,removed_lines:30/30=100%) Greg Kroah-Hartman <[email protected]> (commit_signer:2/2=100%)
Andy Shevchenko <[email protected]> (commit_signer:1/2=50%)
[email protected] (open list)
Strange, when I use get_maintainer.pl with the patch I get the following only:
[root@hkvirt linux-next]# scripts/get_maintainer.pl 0001-lib-string-add-strreplace_nonalnum.patch
Stephen Rothwell <[email protected]> (commit_signer:1/1=100%,authored:1/1=100%,added_lines:479/479=100%,added_lines:1055/1055=100%) [email protected] (open list)
Therefore I sent it to the usual suspects only.
Quoted 2 lines
And also Guenter Roeck who does most of the HWMON maintenance work.
Right.
Quoted 2 lines
Andrew
Heiner
Heiner Kallweit
maintainerQuoted 8 lines · Heiner Kallweit
Add a new function
strreplace_nonalnumthat replaces all non-alphanumeric characters. Such functionality is needed e.g. when a string is supposed to be used in a file name. If '\0' is given as new character then non-alphanumeric characters are cut.There doesn't seem to be a maintainer or mailing list for
lib/string.cTherefore I hope it's ok to submit this through the netdev tree.
Quoted 9 lines
Heiner Kallweit (2):
lib: string: addstrreplace_nonalnum
net: phy: aquantia: use new functionstrreplace_nonalnumdrivers/net/phy/aquantia_hwmon.c | 10 +--------- include/linux/string.h | 1 + lib/string.c | 27 +++++++++++++++++++++++++++ 3 files changed, 29 insertions(+), 9 deletions(-)
Greg still has some concerns, let's see what the outcome of this discussion is.
https://lkml.org/lkml/2019/3/3/151
Heiner Kallweit
maintainerQuoted 13 lines · Heiner Kallweit
Quoted 12 lines · Heiner Kallweit
Add a new function
strreplace_nonalnumthat replaces all non-alphanumeric characters. Such functionality is needed e.g. when a string is supposed to be used in a file name. If '\0' is given as new character then non-alphanumeric characters are cut.There doesn't seem to be a maintainer or mailing list for
lib/string.cTherefore I hope it's ok to submit this through the netdev tree.Heiner Kallweit (2):
lib: string: addstrreplace_nonalnum
net: phy: aquantia: use new functionstrreplace_nonalnum
Quoted 9 lines
Quoted 5 lines
drivers/net/phy/aquantia_hwmon.c | 10 +--------- include/linux/string.h | 1 + lib/string.c | 27 +++++++++++++++++++++++++++ 3 files changed, 29 insertions(+), 9 deletions(-)Greg still has some concerns, let's see what the outcome of this discussion is.
https://lkml.org/lkml/2019/3/3/151
This series should be deferred to next merge window.
Heiner
David Miller
maintainerFrom: Heiner Kallweit <[email protected]>
Date: Mon, 4 Mar 2019 19:54:16 +0100
Quoted 19 lines · Heiner Kallweit
Quoted 18 lines · Heiner Kallweit
Quoted 17 lines
Add a new function
strreplace_nonalnumthat replaces all non-alphanumeric characters. Such functionality is needed e.g. when a string is supposed to be used in a file name. If '\0' is given as new character then non-alphanumeric characters are cut.There doesn't seem to be a maintainer or mailing list for
lib/string.cTherefore I hope it's ok to submit this through the netdev tree.Heiner Kallweit (2):
lib: string: addstrreplace_nonalnum
net: phy: aquantia: use new functionstrreplace_nonalnumdrivers/net/phy/aquantia_hwmon.c | 10 +--------- include/linux/string.h | 1 + lib/string.c | 27 +++++++++++++++++++++++++++ 3 files changed, 29 insertions(+), 9 deletions(-)
Quoted 5 lines
Quoted 4 lines
Greg still has some concerns, let's see what the outcome of this discussion is.
https://lkml.org/lkml/2019/3/3/151This series should be deferred to next merge window.
Ok I'll revert, sorry I just saw this.
Heiner Kallweit
maintainerQuoted 22 lines · David Miller
From: Heiner Kallweit <[email protected]>
Date: Mon, 4 Mar 2019 19:54:16 +0100Quoted 19 lines · Heiner Kallweit
Quoted 18 lines · Heiner Kallweit
Quoted 17 lines
Add a new function
strreplace_nonalnumthat replaces all non-alphanumeric characters. Such functionality is needed e.g. when a string is supposed to be used in a file name. If '\0' is given as new character then non-alphanumeric characters are cut.There doesn't seem to be a maintainer or mailing list for
lib/string.cTherefore I hope it's ok to submit this through the netdev tree.Heiner Kallweit (2):
lib: string: addstrreplace_nonalnum
net: phy: aquantia: use new functionstrreplace_nonalnumdrivers/net/phy/aquantia_hwmon.c | 10 +--------- include/linux/string.h | 1 + lib/string.c | 27 +++++++++++++++++++++++++++ 3 files changed, 29 insertions(+), 9 deletions(-)
Quoted 8 lines
Quoted 5 lines
Quoted 4 lines
Greg still has some concerns, let's see what the outcome of this discussion is.
https://lkml.org/lkml/2019/3/3/151This series should be deferred to next merge window.
Ok I'll revert, sorry I just saw this.
Thank you!