From: Michael Brown Date: Thu, 24 Apr 2025 15:35:49 +0000 (+0100) Subject: [uaccess] Remove now-obsolete memchr_user() X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=2742ed5d77e1dd6cdcf20800d2b43295874ac621;p=thirdparty%2Fipxe.git [uaccess] Remove now-obsolete memchr_user() Signed-off-by: Michael Brown --- diff --git a/src/arch/x86/include/librm.h b/src/arch/x86/include/librm.h index 7755abdcf..379b6d849 100644 --- a/src/arch/x86/include/librm.h +++ b/src/arch/x86/include/librm.h @@ -131,13 +131,6 @@ UACCESS_INLINE ( librm, virt_to_user ) ( volatile const void *addr ) { return trivial_virt_to_user ( addr ); } -static inline __always_inline off_t -UACCESS_INLINE ( librm, memchr_user ) ( userptr_t buffer, off_t offset, - int c, size_t len ) { - return trivial_memchr_user ( buffer, offset, c, len ); -} - - /****************************************************************************** * * Access to variables in .data16 and .text16 diff --git a/src/arch/x86/transitions/librm_mgmt.c b/src/arch/x86/transitions/librm_mgmt.c index e0679f0ff..5a6942825 100644 --- a/src/arch/x86/transitions/librm_mgmt.c +++ b/src/arch/x86/transitions/librm_mgmt.c @@ -431,7 +431,6 @@ void setup_sipi ( unsigned int vector, uint32_t handler, PROVIDE_UACCESS_INLINE ( librm, phys_to_virt ); PROVIDE_UACCESS_INLINE ( librm, virt_to_phys ); PROVIDE_UACCESS_INLINE ( librm, virt_to_user ); -PROVIDE_UACCESS_INLINE ( librm, memchr_user ); PROVIDE_IOMAP_INLINE ( pages, io_to_bus ); PROVIDE_IOMAP ( pages, ioremap, ioremap_pages ); PROVIDE_IOMAP ( pages, iounmap, iounmap_pages ); diff --git a/src/core/uaccess.c b/src/core/uaccess.c index 32bd1ac38..bf922f66d 100644 --- a/src/core/uaccess.c +++ b/src/core/uaccess.c @@ -35,4 +35,3 @@ FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL ); PROVIDE_UACCESS_INLINE ( flat, phys_to_virt ); PROVIDE_UACCESS_INLINE ( flat, virt_to_phys ); PROVIDE_UACCESS_INLINE ( flat, virt_to_user ); -PROVIDE_UACCESS_INLINE ( flat, memchr_user ); diff --git a/src/include/ipxe/linux/linux_uaccess.h b/src/include/ipxe/linux/linux_uaccess.h index b4f7e2fc6..7d5f5f642 100644 --- a/src/include/ipxe/linux/linux_uaccess.h +++ b/src/include/ipxe/linux/linux_uaccess.h @@ -62,10 +62,4 @@ UACCESS_INLINE ( linux, virt_to_user ) ( volatile const void *addr ) { return trivial_virt_to_user ( addr ); } -static inline __always_inline off_t -UACCESS_INLINE ( linux, memchr_user ) ( userptr_t buffer, off_t offset, - int c, size_t len ) { - return trivial_memchr_user ( buffer, offset, c, len ); -} - #endif /* _IPXE_LINUX_UACCESS_H */ diff --git a/src/include/ipxe/uaccess.h b/src/include/ipxe/uaccess.h index 62030dd8a..d0c6882ed 100644 --- a/src/include/ipxe/uaccess.h +++ b/src/include/ipxe/uaccess.h @@ -51,23 +51,6 @@ trivial_virt_to_user ( volatile const void *addr ) { return ( ( userptr_t ) addr ); } -/** - * Find character in user buffer - * - * @v buffer User buffer - * @v offset Starting offset within buffer - * @v c Character to search for - * @v len Length of user buffer - * @ret offset Offset of character, or <0 if not found - */ -static inline __always_inline off_t -trivial_memchr_user ( userptr_t buffer, off_t offset, int c, size_t len ) { - void *found; - - found = memchr ( ( ( void * ) buffer + offset ), c, len ); - return ( found ? ( found - ( void * ) buffer ) : -1 ); -} - /** @} */ /** @@ -114,12 +97,6 @@ UACCESS_INLINE ( flat, virt_to_user ) ( volatile const void *addr ) { return trivial_virt_to_user ( addr ); } -static inline __always_inline off_t -UACCESS_INLINE ( flat, memchr_user ) ( userptr_t buffer, off_t offset, - int c, size_t len ) { - return trivial_memchr_user ( buffer, offset, c, len ); -} - /* Include all architecture-independent user access API headers */ #include @@ -179,15 +156,4 @@ copy_from_user ( void *dest, userptr_t src, off_t src_off, size_t len ) { memcpy ( dest, ( src + src_off ), len ); } -/** - * Find character in user buffer - * - * @v userptr User buffer - * @v offset Starting offset within buffer - * @v c Character to search for - * @v len Length of user buffer - * @ret offset Offset of character, or <0 if not found - */ -off_t memchr_user ( userptr_t userptr, off_t offset, int c, size_t len ); - #endif /* _IPXE_UACCESS_H */ diff --git a/src/interface/linux/linux_uaccess.c b/src/interface/linux/linux_uaccess.c index 4fdd8c03a..436707757 100644 --- a/src/interface/linux/linux_uaccess.c +++ b/src/interface/linux/linux_uaccess.c @@ -30,4 +30,3 @@ FILE_LICENCE(GPL2_OR_LATER); PROVIDE_UACCESS_INLINE(linux, phys_to_virt); PROVIDE_UACCESS_INLINE(linux, virt_to_phys); PROVIDE_UACCESS_INLINE(linux, virt_to_user); -PROVIDE_UACCESS_INLINE(linux, memchr_user);