From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 41FDEC2BB40 for ; Fri, 4 Dec 2020 17:06:08 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 12F3622B43 for ; Fri, 4 Dec 2020 17:06:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388531AbgLDRGA (ORCPT ); Fri, 4 Dec 2020 12:06:00 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33396 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727536AbgLDRF6 (ORCPT ); Fri, 4 Dec 2020 12:05:58 -0500 Received: from latitanza.investici.org (latitanza.investici.org [IPv6:2001:888:2000:56::19]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3E3BFC061A56; Fri, 4 Dec 2020 09:04:40 -0800 (PST) Received: from mx3.investici.org (unknown [127.0.0.1]) by latitanza.investici.org (Postfix) with ESMTP id 4CnfFg0NLqz8sfb; Fri, 4 Dec 2020 17:04:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=privacyrequired.com; s=stigmate; t=1607101479; bh=UdwxBvooMqxx5IHG/cr4Vy5TgCZ3SrzMXwuTOdWz9ss=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=nfWArkaqMQH8dswdXmU6Jfdz3NT6526m6iWoMkCcoAEefXQquMxIby8MtVehmY+S2 L7/9Ug3O3/9WY+1+ssh6eRm3WBqdfCAxSdS+fEYVGAPbsste8y2s6dFBFsinhxrq7u kJlRNTR4rdbYQn0CDFm06/rcILZeiYTx4mqOOWjA= Received: from [82.94.249.234] (mx3.investici.org [82.94.249.234]) (Authenticated sender: laniel_francis@privacyrequired.com) by localhost (Postfix) with ESMTPSA id 4CnfFf0G5fz8sj5; Fri, 4 Dec 2020 17:04:37 +0000 (UTC) From: laniel_francis@privacyrequired.com To: Thomas Bogendoerfer , Florian Fainelli , bcm-kernel-feedback-list@broadcom.com Cc: Francis Laniel , linux-mips@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [RFC PATCH v1 09/12] mips: Replace strstarts() by str_has_prefix(). Date: Fri, 4 Dec 2020 18:03:15 +0100 Message-Id: <20201204170319.20383-10-laniel_francis@privacyrequired.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20201204170319.20383-1-laniel_francis@privacyrequired.com> References: <20201204170319.20383-1-laniel_francis@privacyrequired.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Francis Laniel The two functions indicates if a string begins with a given prefix. The only difference is that strstarts() returns a bool while str_has_prefix() returns the length of the prefix if the string begins with it or 0 otherwise. Signed-off-by: Francis Laniel --- arch/mips/bcm63xx/boards/board_bcm963xx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/mips/bcm63xx/boards/board_bcm963xx.c b/arch/mips/bcm63xx/boards/board_bcm963xx.c index 01aff80a5967..85ccb2b02621 100644 --- a/arch/mips/bcm63xx/boards/board_bcm963xx.c +++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c @@ -747,7 +747,7 @@ void __init board_prom_init(void) /* dump cfe version */ cfe = boot_addr + BCM963XX_CFE_VERSION_OFFSET; - if (strstarts(cfe, "cfe-")) { + if (str_has_prefix(cfe, "cfe-")) { if(cfe[4] == 'v') { if(cfe[5] == 'd') snprintf(cfe_version, 11, "%s", -- 2.20.1 From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-17.4 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_ADSP_ALL,DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0E8EDC4361A for ; Fri, 4 Dec 2020 17:05:56 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id BFBCA22B3B for ; Fri, 4 Dec 2020 17:05:55 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org BFBCA22B3B Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=privacyrequired.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=Zv0j+sT4NXui9oGqjOgxCxfNesxlYLbYpl9NzLshEEs=; b=GkcYIVhhyLH1Qs9i1AqpNp+A0 VjVJw+w/9UZ/VLfkjYw1VrciI8s+vZWl94L/gBNlpXhgog7FUrsveB1zjrMlZjrm8vBPgbALf6Uqs KGL6lYsAr8PXUG1viyBncWBFtPQIrY+T51o1qcPMZfoAAfmShkxlSf6NjfyX/XO1V/ud13eF2ZYDJ 79DITdLF4twtNSCieCz4jX8AVSNTDFsz2nsXO/q2EL+YXhOh/KodPtpp9iPipBOWdO6K5qLrToCSB 46nWw90T4a3jjbazMPgdwBNk5qYn15EcCc4gNiIuWlRva1JcgtZKt2oAwrnZtacmHdUQ97uwr3scF 10H6UXCWA==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1klEVe-00025D-Ac; Fri, 04 Dec 2020 17:04:42 +0000 Received: from latitanza.investici.org ([82.94.249.234]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1klEVb-00024K-Sn for linux-arm-kernel@lists.infradead.org; Fri, 04 Dec 2020 17:04:40 +0000 Received: from mx3.investici.org (unknown [127.0.0.1]) by latitanza.investici.org (Postfix) with ESMTP id 4CnfFg0NLqz8sfb; Fri, 4 Dec 2020 17:04:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=privacyrequired.com; s=stigmate; t=1607101479; bh=UdwxBvooMqxx5IHG/cr4Vy5TgCZ3SrzMXwuTOdWz9ss=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=nfWArkaqMQH8dswdXmU6Jfdz3NT6526m6iWoMkCcoAEefXQquMxIby8MtVehmY+S2 L7/9Ug3O3/9WY+1+ssh6eRm3WBqdfCAxSdS+fEYVGAPbsste8y2s6dFBFsinhxrq7u kJlRNTR4rdbYQn0CDFm06/rcILZeiYTx4mqOOWjA= Received: from [82.94.249.234] (mx3.investici.org [82.94.249.234]) (Authenticated sender: laniel_francis@privacyrequired.com) by localhost (Postfix) with ESMTPSA id 4CnfFf0G5fz8sj5; Fri, 4 Dec 2020 17:04:37 +0000 (UTC) From: laniel_francis@privacyrequired.com To: Thomas Bogendoerfer , Florian Fainelli , bcm-kernel-feedback-list@broadcom.com Subject: [RFC PATCH v1 09/12] mips: Replace strstarts() by str_has_prefix(). Date: Fri, 4 Dec 2020 18:03:15 +0100 Message-Id: <20201204170319.20383-10-laniel_francis@privacyrequired.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20201204170319.20383-1-laniel_francis@privacyrequired.com> References: <20201204170319.20383-1-laniel_francis@privacyrequired.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201204_120440_103088_10D951F2 X-CRM114-Status: GOOD ( 12.37 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Francis Laniel , linux-mips@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org From: Francis Laniel The two functions indicates if a string begins with a given prefix. The only difference is that strstarts() returns a bool while str_has_prefix() returns the length of the prefix if the string begins with it or 0 otherwise. Signed-off-by: Francis Laniel --- arch/mips/bcm63xx/boards/board_bcm963xx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/mips/bcm63xx/boards/board_bcm963xx.c b/arch/mips/bcm63xx/boards/board_bcm963xx.c index 01aff80a5967..85ccb2b02621 100644 --- a/arch/mips/bcm63xx/boards/board_bcm963xx.c +++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c @@ -747,7 +747,7 @@ void __init board_prom_init(void) /* dump cfe version */ cfe = boot_addr + BCM963XX_CFE_VERSION_OFFSET; - if (strstarts(cfe, "cfe-")) { + if (str_has_prefix(cfe, "cfe-")) { if(cfe[4] == 'v') { if(cfe[5] == 'd') snprintf(cfe_version, 11, "%s", -- 2.20.1 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel