Backports Archive on lore.kernel.org
 help / Atom feed
* [PATCH v2] backports: add strreplace()
@ 2018-09-19 10:51 Chi-Hsien Lin
  2018-09-24  7:19 ` Johannes Berg
  0 siblings, 1 reply; 3+ messages in thread
From: Chi-Hsien Lin @ 2018-09-19 10:51 UTC (permalink / raw)
  To: backports, Johannes Berg; +Cc: Winnie Chang, Winnie Chang, Chi-Hsien Lin

From: Winnie Chang <Winnie.Chang@cypress.com>

wireless-drivers-next.git commit cb18e2e9ec71 (brcmfmac: fix wrong
strnchr usage) used strreplace(), which is not available in kernel prior
to v4.2. Before this commit proprgates to linux-stable.git, add
strreplace() to avoid gentree failure.

Signed-off-by: Winnie Chang <winnie.chang@cypress.com>
Signed-off-by: Chi-Hsien Lin <chi-hsien.lin@cypress.com>
---
 backport/backport-include/linux/string.h | 4 ++++
 backport/compat/backport-4.2.c           | 9 +++++++++
 2 files changed, 13 insertions(+)

diff --git a/backport/backport-include/linux/string.h b/backport/backport-i=
nclude/linux/string.h
index b85d9c73dc27..4b35eb9f2baf 100644
--- a/backport/backport-include/linux/string.h
+++ b/backport/backport-include/linux/string.h
@@ -29,4 +29,8 @@ void memzero_explicit(void *s, size_t count);
 ssize_t strscpy(char *dest, const char *src, size_t count);
 #endif

+#if LINUX_VERSION_IS_LESS(4,2,0)
+char *strreplace(char *s, char old, char new);
+#endif
+
 #endif /* __BACKPORT_LINUX_STRING_H */
diff --git a/backport/compat/backport-4.2.c b/backport/compat/backport-4.2.=
c
index e00aa49c7e4a..b275d349f7eb 100644
--- a/backport/compat/backport-4.2.c
+++ b/backport/compat/backport-4.2.c
@@ -65,3 +65,12 @@ struct aead_request *crypto_backport_convert(struct aead=
_request *req)
 return &nreq->subreq;
 }
 EXPORT_SYMBOL_GPL(crypto_backport_convert);
+
+char *strreplace(char *s, char old, char new)
+{
+for (; *s; ++s)
+if (*s =3D=3D old)
+*s =3D new;
+return s;
+}
+EXPORT_SYMBOL_GPL(strreplace);
--
2.1.0


This message and any attachments may contain confidential information from =
Cypress or its subsidiaries. If it has been received in error, please advis=
e the sender and immediately delete this message.
--
To unsubscribe from this list: send the line "unsubscribe backports" in

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH v2] backports: add strreplace()
  2018-09-19 10:51 [PATCH v2] backports: add strreplace() Chi-Hsien Lin
@ 2018-09-24  7:19 ` Johannes Berg
  2018-09-26 10:13   ` Chi-Hsien Lin
  0 siblings, 1 reply; 3+ messages in thread
From: Johannes Berg @ 2018-09-24  7:19 UTC (permalink / raw)
  To: Chi-Hsien Lin, backports; +Cc: Winnie Chang

On Wed, 2018-09-19 at 10:51 +0000, Chi-Hsien Lin wrote:
> From: Winnie Chang <Winnie.Chang@cypress.com>
> 
> wireless-drivers-next.git commit cb18e2e9ec71 (brcmfmac: fix wrong
> strnchr usage) used strreplace(), which is not available in kernel prior
> to v4.2. Before this commit proprgates to linux-stable.git, add
> strreplace() to avoid gentree failure.

Something's fishy with your email - there's no whitespace in it at all??

Anyway, since it was only a few lines I've fixed it up, but please check
what the reason was before/when you send a new patch.

Thanks,
johannes
--
To unsubscribe from this list: send the line "unsubscribe backports" in

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH v2] backports: add strreplace()
  2018-09-24  7:19 ` Johannes Berg
@ 2018-09-26 10:13   ` Chi-Hsien Lin
  0 siblings, 0 replies; 3+ messages in thread
From: Chi-Hsien Lin @ 2018-09-26 10:13 UTC (permalink / raw)
  To: Johannes Berg, backports; +Cc: Winnie Chang



On 09/24/2018 3:19, Johannes Berg wrote:
> On Wed, 2018-09-19 at 10:51 +0000, Chi-Hsien Lin wrote:
>> From: Winnie Chang <Winnie.Chang@cypress.com>
>>
>> wireless-drivers-next.git commit cb18e2e9ec71 (brcmfmac: fix wrong
>> strnchr usage) used strreplace(), which is not available in kernel prior
>> to v4.2. Before this commit proprgates to linux-stable.git, add
>> strreplace() to avoid gentree failure.
> 
> Something's fishy with your email - there's no whitespace in it at all??
> 
> Anyway, since it was only a few lines I've fixed it up, but please check
> what the reason was before/when you send a new patch.

Thanks for catching this. It's identified to be caused by our SMTP 
server which does extra processing to external mails. I will work with 
our IT to fix it and make sure it doesn't happen in our future patch 
submissions.

Regards,
Chi-hsien Lin
--
To unsubscribe from this list: send the line "unsubscribe backports" in

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, back to index

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-09-19 10:51 [PATCH v2] backports: add strreplace() Chi-Hsien Lin
2018-09-24  7:19 ` Johannes Berg
2018-09-26 10:13   ` Chi-Hsien Lin

Backports Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/backports/0 backports/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 backports backports/ https://lore.kernel.org/backports \
		backports@vger.kernel.org backports@archiver.kernel.org
	public-inbox-index backports


Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.backports


AGPL code for this site: git clone https://public-inbox.org/ public-inbox