From patchwork Wed Sep 19 10:51:15 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chi-Hsien Lin X-Patchwork-Id: 10605625 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 7944E1390 for ; Wed, 19 Sep 2018 10:51:22 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 764E62B59D for ; Wed, 19 Sep 2018 10:51:22 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6A8B12B5CB; Wed, 19 Sep 2018 10:51:22 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C41292B5DB for ; Wed, 19 Sep 2018 10:51:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731144AbeISQ2l (ORCPT ); Wed, 19 Sep 2018 12:28:41 -0400 Received: from mail-eopbgr720119.outbound.protection.outlook.com ([40.107.72.119]:53040 "EHLO NAM05-CO1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728059AbeISQ2l (ORCPT ); Wed, 19 Sep 2018 12:28:41 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cycorp.onmicrosoft.com; s=selector1-cypress-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=tohzweSknGrRGL7abyvUMn4N7fY+N/lrQE4QO9aWUsk=; b=i5SJQCN+sSCcteFFuwtUxbUG0pKC83VrB/Bsljxz+FeioCtW7JhzbFpEY/wXiiDFux1H+R2hC+ZWL5JOLn5z7QpuB85wxe+aulg/ivjKfaHE9g5LQE7nkUmpJO+Rv2bi+7piefJ47DC+62AvTj0p4vHOXPBIf17ExIdv0CbaRUY= Received: from BY1PR0601MB1436.namprd06.prod.outlook.com (10.162.111.23) by BY1PR0601MB1222.namprd06.prod.outlook.com (10.161.204.18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1143.15; Wed, 19 Sep 2018 10:51:16 +0000 Received: from BY1PR0601MB1436.namprd06.prod.outlook.com ([fe80::10be:ee6a:862e:98b0]) by BY1PR0601MB1436.namprd06.prod.outlook.com ([fe80::10be:ee6a:862e:98b0%2]) with mapi id 15.20.1143.017; Wed, 19 Sep 2018 10:51:16 +0000 From: Chi-Hsien Lin To: "backports@vger.kernel.org" , Johannes Berg CC: Winnie Chang , Winnie Chang , Chi-Hsien Lin Subject: [PATCH v2] backports: add strreplace() Thread-Topic: [PATCH v2] backports: add strreplace() Thread-Index: AQHUUAawE0lLg4evH0aS4D4egepxGg== Date: Wed, 19 Sep 2018 10:51:15 +0000 Message-ID: <1537354267-42104-1-git-send-email-chi-hsien.lin@cypress.com> Accept-Language: en-US, zh-TW Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [12.110.209.245] x-clientproxiedby: BYAPR02CA0019.namprd02.prod.outlook.com (2603:10b6:a02:ee::32) To BY1PR0601MB1436.namprd06.prod.outlook.com (2a01:111:e400:522c::23) authentication-results: spf=none (sender IP is ) smtp.mailfrom=Chi-Hsien.Lin@cypress.com; x-ms-exchange-messagesentrepresentingtype: 1 x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1;BY1PR0601MB1222;6:HfT/1MjR/ceEwNw+AfKUVuTE27wC3KuI4zAsS8r1elwqFr21Gr8akekduylIuokTzpH03NjDSbvYgt0LG51nwH+yR6/NzSjVQgXfdsRs0hK3V9nCAgFvXBdsjTBcEvmdGZUsgcx0bWFtL0guUVWY/W0EK80I3+RZzHP4e9BUkakmSakjegiwdA8VxNHopMlxLQKazfMfjaSK65NE6SggDk5XXo/JOG7V6mgCCUL/cFiRAMoQJLnpok3vZj5VGiPrdDvQevnFWMq5/Ccq2+cp61n2uVWcFUyOoT1HxKoJDdmtC1ckUrReS0mMhiL61yWfu7Y1W9zgMM1igf1a7XUuoOEGt12AWqJiJicKAzqx4rh7Edvk7zKDPqHghRhEX+NnXHgRjljTXkIJ14QWcDAzpq2pqmfbjEh2ff1UToL1PW0mz3gYm1eA1YDyxtU/Is0zbBrfh4FFi3u2Yz8wK0BflQ==;5:fyLwqKNCJpmFyFm2E0Ve8qMORj2WrNLBqZaj1dEKYPBJrqphZJztvOiOuwIaeHN9f4l8d8sEWfKxYmqvqBxDpq8UCZR/+aMmQtfeuBB6fe+YGCkcrYQ4FiGf8NmUX1M5FY7Gw41sFrANiG2PHZR8vMexgSAa/H+2SPuZ2V+XdgQ=;7:3VurRWLzkb+jgMtYiXYuSaDBNqgdb6gDk3t0QHgzEkNjM4VVAJnfSKbQLQrz0JV4gp/3cqlLzSzEPi0nF4t1m3MbPXEADIPFVU+o6Ypx6aLjdIaLKag+qDzXdnuA7aPZ/s9B5JuKBbx1DNctRXZRb/BxLONaf8mKAH2QGEvjnS/BRZQbCYDS7t+dyfUKmkxNk5z40FF04C8r+pUeeLMrDThGmYQsN8gzzNrAuhXiPd9QSYLHgUZAY6XmkcSSnzaI x-ms-office365-filtering-correlation-id: 54cf6505-e878-42c6-a869-08d61e1dd244 x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0;PCL:0;RULEID:(7020095)(4652040)(8989299)(4534165)(4627221)(201703031133081)(201702281549075)(8990200)(5600074)(711020)(4618075)(2017052603328)(7153060)(7193020);SRVR:BY1PR0601MB1222; x-ms-traffictypediagnostic: BY1PR0601MB1222: x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(258095267146985)(103651359005742); x-ms-exchange-senderadcheck: 1 x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(8211001083)(6040522)(2401047)(5005006)(8121501046)(3002001)(10201501046)(93006095)(93001095)(3231355)(944501410)(52105095)(6055026)(149027)(150027)(6041310)(20161123564045)(20161123558120)(20161123562045)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(201708071742011)(7699050);SRVR:BY1PR0601MB1222;BCL:0;PCL:0;RULEID:;SRVR:BY1PR0601MB1222; x-forefront-prvs: 0800C0C167 x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(136003)(39860400002)(346002)(366004)(376002)(396003)(199004)(189003)(486006)(7736002)(102836004)(8936002)(5660300001)(6436002)(476003)(86362001)(478600001)(2616005)(6116002)(386003)(97736004)(6486002)(305945005)(53936002)(2906002)(6506007)(72206003)(3846002)(6512007)(2900100001)(81156014)(256004)(5024004)(186003)(25786009)(99286004)(68736007)(106356001)(105586002)(36756003)(107886003)(54906003)(5250100002)(4326008)(14444005)(2501003)(66066001)(52116002)(316002)(81166006)(14454004)(26005)(110136005)(8676002);DIR:OUT;SFP:1102;SCL:1;SRVR:BY1PR0601MB1222;H:BY1PR0601MB1436.namprd06.prod.outlook.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;A:1;MX:1; received-spf: None (protection.outlook.com: cypress.com does not designate permitted sender hosts) x-microsoft-antispam-message-info: nJAB35RB3CXTnulixeH9fT33ca21gjuFcdFStbSDvCR9ikQ9oYG9F4FwnQi5iLJbHuC9ffCUxhhk1cIP4S0kmeUt3u1bd3HMsnBthlM04dWcyz1WxqocDzeROP1QV0sCNRr0wEcIlSACauv/qBG66D3wd5sZ9PiamczNVzUu3n27QgKuLJwfj3Wf/K0v9oWi3WxEmMv4AlXiY4YooZHkeqSrQn38JBBHSX+zdUZCdmXrd7QlR0OVMW7JU+S3PaVOCJu+pDeyn1oO1YBdw4HodrHWGUPgK8eHX5lYBZlUo/UEBm/QfqU7MlyYOi5lw19yXT43hufXTnguHrkodEb23YIB3FH9HF1Yi0sNGE4K32o= spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM MIME-Version: 1.0 X-OriginatorOrg: cypress.com X-MS-Exchange-CrossTenant-Network-Message-Id: 54cf6505-e878-42c6-a869-08d61e1dd244 X-MS-Exchange-CrossTenant-originalarrivaltime: 19 Sep 2018 10:51:15.9741 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 011addfc-2c09-450d-8938-e0bbc2dd2376 X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY1PR0601MB1222 Sender: backports-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: backports@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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.2. 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(+) -- 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 advise the sender and immediately delete this message. -- To unsubscribe from this list: send the line "unsubscribe backports" in diff --git a/backport/backport-include/linux/string.h b/backport/backport-include/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 == old) +*s = new; +return s; +} +EXPORT_SYMBOL_GPL(strreplace);