summaryrefslogtreecommitdiffstats
path: root/src/interface/linux/linux_sysfs.c
diff options
context:
space:
mode:
authorSimon Rettberg2026-01-28 12:53:53 +0100
committerSimon Rettberg2026-01-28 12:53:53 +0100
commit8e82785c584dc13e20f9229decb95bd17bbe9cd1 (patch)
treea8b359e59196be5b2e3862bed189107f4bc9975f /src/interface/linux/linux_sysfs.c
parentMerge branch 'master' into openslx (diff)
parent[prefix] Make unlzma.S compatible with 386 class CPUs (diff)
downloadipxe-8e82785c584dc13e20f9229decb95bd17bbe9cd1.tar.gz
ipxe-8e82785c584dc13e20f9229decb95bd17bbe9cd1.tar.xz
ipxe-8e82785c584dc13e20f9229decb95bd17bbe9cd1.zip
Merge branch 'master' into openslxopenslx
Diffstat (limited to 'src/interface/linux/linux_sysfs.c')
-rw-r--r--src/interface/linux/linux_sysfs.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/src/interface/linux/linux_sysfs.c b/src/interface/linux/linux_sysfs.c
index 4f0027cd4..321824ba9 100644
--- a/src/interface/linux/linux_sysfs.c
+++ b/src/interface/linux/linux_sysfs.c
@@ -42,8 +42,8 @@ FILE_LICENCE ( GPL2_OR_LATER );
* @v data Data to fill in
* @ret len Length read, or negative error
*/
-int linux_sysfs_read ( const char *filename, userptr_t *data ) {
- userptr_t tmp;
+int linux_sysfs_read ( const char *filename, void **data ) {
+ void *tmp;
ssize_t read;
size_t len;
int fd;
@@ -59,7 +59,7 @@ int linux_sysfs_read ( const char *filename, userptr_t *data ) {
}
/* Read file */
- for ( *data = UNULL, len = 0 ; ; len += read ) {
+ for ( *data = NULL, len = 0 ; ; len += read ) {
/* (Re)allocate space */
tmp = urealloc ( *data, ( len + LINUX_SYSFS_BLKSIZE ) );
@@ -70,8 +70,7 @@ int linux_sysfs_read ( const char *filename, userptr_t *data ) {
*data = tmp;
/* Read from file */
- read = linux_read ( fd, user_to_virt ( *data, len ),
- LINUX_SYSFS_BLKSIZE );
+ read = linux_read ( fd, ( *data + len ), LINUX_SYSFS_BLKSIZE );
if ( read == 0 )
break;
if ( read < 0 ) {