[uaccess] Remove trivial uses of userptr_t

Signed-off-by: Michael Brown <mcb30@ipxe.org>
This commit is contained in:
Michael Brown
2025-04-24 01:30:50 +01:00
parent 945df9b429
commit e8ffe2cd64
34 changed files with 69 additions and 86 deletions
+1 -1
View File
@@ -2119,7 +2119,7 @@ static void arbel_stop_firmware ( struct arbel *arbel ) {
DBGC ( arbel, "Arbel %p FATAL could not stop firmware: %s\n",
arbel, strerror ( rc ) );
/* Leak memory and return; at least we avoid corruption */
arbel->firmware_area = UNULL;
arbel->firmware_area = NULL;
return;
}
}
+2 -3
View File
@@ -10,7 +10,6 @@
FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
#include <stdint.h>
#include <ipxe/uaccess.h>
#include <ipxe/ib_packet.h>
#include "mlx_bitops.h"
#include "MT25218_PRM.h"
@@ -492,7 +491,7 @@ struct arbel {
* final teardown, in order to avoid memory map changes at
* runtime.
*/
userptr_t firmware_area;
void *firmware_area;
/** ICM size */
size_t icm_len;
/** ICM AUX size */
@@ -503,7 +502,7 @@ struct arbel {
* final teardown, in order to avoid memory map changes at
* runtime.
*/
userptr_t icm;
void *icm;
/** Offset within ICM of doorbell records */
size_t db_rec_offset;
/** Doorbell records */
+6 -6
View File
@@ -52,7 +52,7 @@ FILE_LICENCE ( GPL2_OR_LATER );
struct golan_page {
struct list_head list;
userptr_t addr;
void *addr;
};
static void golan_free_fw_areas ( struct golan *golan ) {
@@ -61,7 +61,7 @@ static void golan_free_fw_areas ( struct golan *golan ) {
for (i = 0; i < GOLAN_FW_AREAS_NUM; i++) {
if ( golan->fw_areas[i].area ) {
ufree ( golan->fw_areas[i].area );
golan->fw_areas[i].area = UNULL;
golan->fw_areas[i].area = NULL;
}
}
}
@@ -75,7 +75,7 @@ static int golan_init_fw_areas ( struct golan *golan ) {
}
for (i = 0; i < GOLAN_FW_AREAS_NUM; i++)
golan->fw_areas[i].area = UNULL;
golan->fw_areas[i].area = NULL;
return rc;
@@ -448,12 +448,12 @@ static inline int golan_provide_pages ( struct golan *golan , uint32_t pages
int size_ibox = 0;
int size_obox = 0;
int rc = 0;
userptr_t next_page_addr = UNULL;
void *next_page_addr = NULL;
DBGC(golan, "%s\n", __FUNCTION__);
if ( ! fw_area->area ) {
fw_area->area = umalloc ( GOLAN_PAGE_SIZE * pages );
if ( fw_area->area == UNULL ) {
if ( fw_area->area == NULL ) {
rc = -ENOMEM;
DBGC (golan ,"Failed to allocated %d pages \n",pages);
goto err_golan_alloc_fw_area;
@@ -467,7 +467,7 @@ static inline int golan_provide_pages ( struct golan *golan , uint32_t pages
unsigned i, j;
struct golan_cmd_layout *cmd;
struct golan_manage_pages_inbox *in;
userptr_t addr = 0;
void *addr = NULL;
mailbox = GET_INBOX(golan, MEM_MBOX);
size_ibox = sizeof(struct golan_manage_pages_inbox) + (pas_num * GOLAN_PAS_SIZE);
+1 -1
View File
@@ -121,7 +121,7 @@ struct golan_firmware_area {
* final teardown, in order to avoid memory map changes at
* runtime.
*/
userptr_t area;
void *area;
};
/* Queue Pair */
#define GOLAN_SEND_WQE_BB_SIZE 64
+1 -1
View File
@@ -2422,7 +2422,7 @@ static void hermon_stop_firmware ( struct hermon *hermon ) {
DBGC ( hermon, "Hermon %p FATAL could not stop firmware: %s\n",
hermon, strerror ( rc ) );
/* Leak memory and return; at least we avoid corruption */
hermon->firmware_area = UNULL;
hermon->firmware_area = NULL;
return;
}
}
+2 -3
View File
@@ -10,7 +10,6 @@
FILE_LICENCE ( GPL2_OR_LATER );
#include <stdint.h>
#include <ipxe/uaccess.h>
#include <ipxe/ib_packet.h>
#include <ipxe/bofm.h>
#include <ipxe/nvsvpd.h>
@@ -887,7 +886,7 @@ struct hermon {
* final teardown, in order to avoid memory map changes at
* runtime.
*/
userptr_t firmware_area;
void *firmware_area;
/** ICM map */
struct hermon_icm_map icm_map[HERMON_ICM_NUM_REGIONS];
/** ICM size */
@@ -900,7 +899,7 @@ struct hermon {
* final teardown, in order to avoid memory map changes at
* runtime.
*/
userptr_t icm;
void *icm;
/** Event queue */
struct hermon_event_queue eq;
+1 -1
View File
@@ -177,7 +177,7 @@ struct nii_nic {
size_t mtu;
/** Hardware transmit/receive buffer */
userptr_t buffer;
void *buffer;
/** Hardware transmit/receive buffer length */
size_t buffer_len;
+1 -1
View File
@@ -622,7 +622,7 @@ static int netvsc_buffer_copy ( struct vmbus_xfer_pages *pages, void *data,
return -ERANGE;
/* Copy data from buffer */
copy_from_user ( data, buffer->data, offset, len );
memcpy ( data, ( buffer->data + offset ), len );
return 0;
}
+1 -1
View File
@@ -305,7 +305,7 @@ struct netvsc_buffer {
/** Buffer length */
size_t len;
/** Buffer */
userptr_t data;
void *data;
/** GPADL ID */
unsigned int gpadl;
};
+1 -2
View File
@@ -11,7 +11,6 @@ FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
#include <assert.h>
#include <ipxe/pci.h>
#include <ipxe/uaccess.h>
#include <ipxe/usb.h>
/** Minimum alignment required for data structures
@@ -1054,7 +1053,7 @@ struct xhci_scratchpad {
/** Number of page-sized scratchpad buffers */
unsigned int count;
/** Scratchpad buffer area */
userptr_t buffer;
void *buffer;
/** Buffer DMA mapping */
struct dma_mapping buffer_map;
/** Scratchpad array */