Backports Archive on
 help / color / Atom feed
From: Chi-Hsien Lin <>
To: "" <>,
	Johannes Berg <>
Cc: Winnie Chang <>,
	Winnie Chang <>,
	Chi-Hsien Lin <>
Subject: [PATCH] backports: add strreplace()
Date: Wed, 19 Sep 2018 10:01:14 +0000
Message-ID: <> (raw)

From: Winnie Chang <>

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

Signed-off-by: Winnie Chang <>
Signed-off-by: Chi-Hsien Lin <>
 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=
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);

+char *strreplace(char *s, char old, char new);
diff --git a/backport/compat/backport-4.2.c b/backport/compat/backport-4.2.=
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;
+char *strreplace(char *s, char old, char new)
+for (; *s; ++s)
+if (*s =3D=3D old)
+*s =3D new;
+return s;

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

             reply index

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-09-19 10:01 Chi-Hsien Lin [this message]
2018-09-19 10:03 ` Johannes Berg
2018-09-19 10:57   ` Chi-Hsien Lin

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:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \ \ \ \ \ \

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

Backports Archive on

Archives are clonable:
	git clone --mirror 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/ \
	public-inbox-index backports

Example config snippet for mirrors

Newsgroup available over NNTP:

AGPL code for this site: git clone