[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20201204170319.20383-1-laniel_francis@privacyrequired.com>
Date: Fri, 4 Dec 2020 18:03:06 +0100
From: laniel_francis@...vacyrequired.com
To: Russell King <linux@...linux.org.uk>,
Hauke Mehrtens <hauke@...ke-m.de>,
Rafał Miłecki <zajec5@...il.com>,
Thomas Bogendoerfer <tsbogend@...ha.franken.de>,
Florian Fainelli <f.fainelli@...il.com>,
bcm-kernel-feedback-list@...adcom.com,
Herbert Xu <herbert@...dor.apana.org.au>,
"David S. Miller" <davem@...emloft.net>,
Ard Biesheuvel <ardb@...nel.org>,
Tomi Valkeinen <tomi.valkeinen@...com>,
David Airlie <airlied@...ux.ie>,
Daniel Vetter <daniel@...ll.ch>,
Laurent Pinchart <laurent.pinchart@...asonboard.com>,
Kieran Bingham <kieran.bingham+renesas@...asonboard.com>,
Alasdair Kergon <agk@...hat.com>,
Mike Snitzer <snitzer@...hat.com>, dm-devel@...hat.com,
Bin Liu <b-liu@...com>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Jessica Yu <jeyu@...nel.org>
Cc: Francis Laniel <laniel_francis@...vacyrequired.com>,
linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org,
linux-mips@...r.kernel.org, linux-crypto@...r.kernel.org,
linux-efi@...r.kernel.org, dri-devel@...ts.freedesktop.org,
linux-renesas-soc@...r.kernel.org, linux-ide@...r.kernel.org,
linux-usb@...r.kernel.org
Subject: [RFC PATCH v1 00/12] Replace strstarts() by str_has_prefix()
From: Francis Laniel <laniel_francis@...vacyrequired.com>
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
Powered by blists - more mailing lists