Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp535568pxu; Fri, 4 Dec 2020 09:08:16 -0800 (PST) X-Google-Smtp-Source: ABdhPJyZMY6tOwczVL9dZ7mLEYLZbcUW4kaCEWZQqHBjOk4Efm292PS9JCKt9TDMvbaxQT/IJh5R X-Received: by 2002:a1c:1d85:: with SMTP id d127mr5468262wmd.49.1607101696577; Fri, 04 Dec 2020 09:08:16 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1607101696; cv=none; d=google.com; s=arc-20160816; b=VTEmN/TCAUWmAVYWQiJq0tqsmwM+a2vYMw44RpLUDia9Qg6gX1klw+wVvRjQej8/2D ha4G5pqt4mdTZyS2NNDEF0n/sHP0nsQHuApLyIOsi155qoOILsdsV0F34WOvPTpPEXqu zsXfmoOmJ5Ud70Zh93kLXXPv+pCoLSETvlQS5fUXZNZXgMm4lDf+dthfmBMNBqaeRbbg ikiX+kod9sIVk1NzAZIBDgtJVNzmTZ40urvKS+KsOC/8dTLWRfQwuYf+kKg6eaR08W2U nSiyNkIoS9WrPCnv9ZXXPwNDM3Cyf1gSJ10KNumy+dmBPVucJO6ZOZLeyw05vc+jQikV 5uRg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=CNSPo3rU73iLufUhzAAlkyJdrqDxV3HykhrbciRVVqg=; b=b12UsU8/DMr/yhU8AsErPIYZdkswP/yaNC61Di1SDargTIj7vLmxFOmiyMZmeYr7jC lMd5/s61GG+G/zFuCqRgl1czAtZW160v8PzN3LZoyy8cuEY7C9rZM8Z4zYlmVWOIMpip VHNt8NiVsQaQICXptPFyJRSSRuvUU6mFD12fKDAi5kiZ3vD+Mz4/VOv9w52nRe203JeY jdMJVJNU9a+IypN28gn2jQbzmHcf1gDpiMwmHutvwJv9RJCtF8kPvOkAxs1yakkO62GX og0x+ztua6Z+LG2FakNsmZ1BnkoW3472jk7whw32qx1yGFaj355RHD0+fnzP26Q45GHH pPog== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@privacyrequired.com header.s=stigmate header.b=CAj2903I; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id h8si3340935edl.562.2020.12.04.09.07.38; Fri, 04 Dec 2020 09:08:16 -0800 (PST) Received-SPF: pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@privacyrequired.com header.s=stigmate header.b=CAj2903I; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388518AbgLDRFq (ORCPT + 99 others); Fri, 4 Dec 2020 12:05:46 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33422 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388510AbgLDRFq (ORCPT ); Fri, 4 Dec 2020 12:05:46 -0500 Received: from latitanza.investici.org (latitanza.investici.org [IPv6:2001:888:2000:56::19]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C1612C08E85E; Fri, 4 Dec 2020 09:04:50 -0800 (PST) Received: from mx3.investici.org (unknown [127.0.0.1]) by latitanza.investici.org (Postfix) with ESMTP id 4CnfF12X1nz8shk; Fri, 4 Dec 2020 17:04:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=privacyrequired.com; s=stigmate; t=1607101445; bh=CNSPo3rU73iLufUhzAAlkyJdrqDxV3HykhrbciRVVqg=; h=From:To:Cc:Subject:Date:From; b=CAj2903IlbaunC80bM+z7sehEdvvySRvMXF2B7QVSeGl9c1o2+R49o1Johhg6BSQ4 Q4EMyEP3bIuGgoqirMK1uT98XPrJ1OTptjksAJf1V5Duw6RhXyRn+MKAiMRbwunKkr vE228J0uaZtyVw5ECCzsQr3hgtGk8lvECyg5M/Pg= 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 4CnfDy1SRgz8sfb; Fri, 4 Dec 2020 17:04:02 +0000 (UTC) From: laniel_francis@privacyrequired.com To: Russell King , Hauke Mehrtens , =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= , Thomas Bogendoerfer , Florian Fainelli , bcm-kernel-feedback-list@broadcom.com, Herbert Xu , "David S. Miller" , Ard Biesheuvel , Tomi Valkeinen , David Airlie , Daniel Vetter , Laurent Pinchart , Kieran Bingham , Alasdair Kergon , Mike Snitzer , dm-devel@redhat.com, Bin Liu , Greg Kroah-Hartman , Jessica Yu Cc: Francis Laniel , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-mips@vger.kernel.org, linux-crypto@vger.kernel.org, linux-efi@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-renesas-soc@vger.kernel.org, linux-ide@vger.kernel.org, linux-usb@vger.kernel.org Subject: [RFC PATCH v1 00/12] Replace strstarts() by str_has_prefix() Date: Fri, 4 Dec 2020 18:03:06 +0100 Message-Id: <20201204170319.20383-1-laniel_francis@privacyrequired.com> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org From: Francis Laniel Hi. First, I hope you are fine and the same for your relatives. In this patch set, I replaced all calls to strstarts() by calls to str_has_prefix(). Indeed, the kernel has two functions to test if a string begins with an other: 1. strstarts() which returns a bool, so 1 if the string begins with the prefix, 0 otherwise. 2. str_has_prefix() which returns the length of the prefix or 0. str_has_prefix() was introduced later than strstarts(), in commit 495d714ad140 which also stated that str_has_prefix() should replace strstarts(). This is what this patch set does. Concerning the patches, the modifications cover different areas of the kernel. I compiled all of them and they compile smoothly. Unfortunately, I did not test all of them, so here are the status of the patches regarding test: 1. Tested with qemu-system-arm using insmod. 2. I do not have access to a bcm47xx MIPS CPU an qemu-system-mips does not emulate this board. 3. Tested with qemu-system-x86_64 calling crypto_alloc_skcipher("essiv(authenc(hmac(sha256),cbc(aes)),sha256)", 0, 0) through LKDTM. 4. Tested with qemu-system-x86_64 using crypsetup. 5. I do not have access to a renesas board and I lack some context to test it with qemu-system-arm. 6. I do not have access to an OMAP board and I lack some context to test it with qemu-system-arm. 7. I did not find how to boot from the EFI_STUB with qemu. If you know how to do, I would be happy to try running this code. 8. I ran qemu-system-x86_64 with a floppy disk attached but impossible to go through this module code... 9. I do not have access to a bcm63xx MIPS CPU an qemu-system-mips does not emulate this board. 10. Tested with qemu-system-x86_64 using insmod. 11. I do not have access to an AM335x or DA8xx platforms and I lack some context to test it with qemu-system-arm. If you see a way to improve the patches or if I did something wrong with the mail do not hesitate to ask. Best regards. Francis Laniel (12): arm: Replace strstarts() by str_has_prefix(). mips: Replace strstarts() by str_has_prefix(). crypto: Replace strstarts() by str_has_prefix(). device-mapper: Replace strstarts() by str_has_prefix(). renesas: Replace strstarts() by str_has_prefix(). omap: Replace strstarts() by str_has_prefix(). efi: Replace strstarts() by str_has_prefix(). ide: Replace strstarts() by str_has_prefix(). mips: Replace strstarts() by str_has_prefix(). module: Replace strstarts() by str_has_prefix(). musb: Replace strstarts() by str_has_prefix(). string.h: Remove strstarts(). arch/arm/kernel/module.c | 12 +++++------ arch/mips/bcm47xx/board.c | 4 ++-- arch/mips/bcm63xx/boards/board_bcm963xx.c | 2 +- crypto/essiv.c | 2 +- .../firmware/efi/libstub/efi-stub-helper.c | 2 +- drivers/firmware/efi/libstub/gop.c | 10 +++++----- drivers/gpu/drm/omapdrm/dss/base.c | 2 +- drivers/gpu/drm/rcar-du/rcar_du_crtc.c | 2 +- drivers/ide/ide-floppy.c | 4 ++-- drivers/md/dm-crypt.c | 4 ++-- drivers/usb/musb/musb_cppi41.c | 4 ++-- drivers/usb/musb/musb_debugfs.c | 20 +++++++++---------- include/linux/string.h | 10 ---------- kernel/module.c | 6 +++--- 14 files changed, 37 insertions(+), 47 deletions(-) -- 2.20.1