diff --git a/master/ioctl.c b/master/ioctl.c index 8ebd016f..71f22d81 100644 --- a/master/ioctl.c +++ b/master/ioctl.c @@ -589,7 +589,7 @@ static ATTRIBUTES int ec_ioctl_master_debug( void *arg /**< ioctl() argument. */ ) { - return ec_master_debug_level(master, (unsigned int) arg); + return ec_master_debug_level(master, (unsigned long) arg); } /*****************************************************************************/ @@ -781,7 +781,7 @@ static ATTRIBUTES int ec_ioctl_slave_sdo_upload( } if (!(target = kmalloc(data.target_size, GFP_KERNEL))) { - EC_MASTER_ERR(master, "Failed to allocate %u bytes" + EC_MASTER_ERR(master, "Failed to allocate %zu bytes" " for SDO upload.\n", data.target_size); return -ENOMEM; } @@ -825,7 +825,7 @@ static ATTRIBUTES int ec_ioctl_slave_sdo_download( } if (!(sdo_data = kmalloc(data.data_size, GFP_KERNEL))) { - EC_MASTER_ERR(master, "Failed to allocate %u bytes" + EC_MASTER_ERR(master, "Failed to allocate %zu bytes" " for SDO download.\n", data.data_size); return -ENOMEM; } @@ -1586,7 +1586,7 @@ static ATTRIBUTES int ec_ioctl_select_ref_clock( ec_ioctl_context_t *ctx /**< Private data structure of file handle. */ ) { - uint32_t config_index = (uint32_t) arg; + unsigned long config_index = (unsigned long) arg; ec_slave_config_t *sc = NULL; int ret = 0; @@ -2754,7 +2754,7 @@ static ATTRIBUTES int ec_ioctl_domain_offset( } list_for_each_entry(domain, &master->domains, list) { - if (domain->index == (unsigned int) arg) { + if (domain->index == (unsigned long) arg) { up(&master->master_sem); return offset; } @@ -2783,7 +2783,7 @@ static ATTRIBUTES int ec_ioctl_domain_process( /* no locking of master_sem needed, because domain will not be deleted in * the meantime. */ - if (!(domain = ec_master_find_domain(master, (unsigned int) arg))) { + if (!(domain = ec_master_find_domain(master, (unsigned long) arg))) { return -ENOENT; } @@ -2809,7 +2809,7 @@ static ATTRIBUTES int ec_ioctl_domain_queue( /* no locking of master_sem needed, because domain will not be deleted in * the meantime. */ - if (!(domain = ec_master_find_domain(master, (unsigned int) arg))) { + if (!(domain = ec_master_find_domain(master, (unsigned long) arg))) { return -ENOENT; } @@ -3746,7 +3746,7 @@ static ATTRIBUTES int ec_ioctl_slave_soe_read( data = kmalloc(ioctl.mem_size, GFP_KERNEL); if (!data) { - EC_MASTER_ERR(master, "Failed to allocate %u bytes of IDN data.\n", + EC_MASTER_ERR(master, "Failed to allocate %zu bytes of IDN data.\n", ioctl.mem_size); return -ENOMEM; } diff --git a/master/ioctl.h b/master/ioctl.h index 8735d586..4b5b69bd 100644 --- a/master/ioctl.h +++ b/master/ioctl.h @@ -56,7 +56,7 @@ * * Increment this when changing the ioctl interface! */ -#define EC_IOCTL_VERSION_MAGIC 24 +#define EC_IOCTL_VERSION_MAGIC 25 // Command-line tool #define EC_IOCTL_MODULE EC_IOR(0x00, ec_ioctl_module_t) @@ -379,11 +379,11 @@ typedef struct { uint16_t slave_position; uint16_t sdo_index; uint8_t sdo_entry_subindex; - uint32_t target_size; + size_t target_size; uint8_t *target; // outputs - uint32_t data_size; + size_t data_size; uint32_t abort_code; } ec_ioctl_slave_sdo_upload_t; @@ -395,7 +395,7 @@ typedef struct { uint16_t sdo_index; uint8_t sdo_entry_subindex; uint8_t complete_access; - uint32_t data_size; + size_t data_size; uint8_t *data; // outputs @@ -428,11 +428,11 @@ typedef struct { // inputs uint16_t slave_position; uint16_t offset; - uint32_t buffer_size; + size_t buffer_size; uint8_t *buffer; // outputs - uint32_t data_size; + size_t data_size; uint32_t result; uint32_t error_code; char file_name[32]; @@ -445,7 +445,7 @@ typedef struct { uint16_t slave_position; uint8_t drive_no; uint16_t idn; - uint32_t mem_size; + size_t mem_size; uint8_t *data; // outputs @@ -538,7 +538,7 @@ typedef struct { // outputs uint16_t index; uint8_t subindex; - uint32_t size; + size_t size; uint8_t data[EC_MAX_SDO_DATA_SIZE]; uint8_t complete_access; } ec_ioctl_config_sdo_t;