# HG changeset patch # User Florian Pose # Date 1354815836 -3600 # Node ID ccafdf1e261f4ff6eec4345ba845a7dd87e8fc4d # Parent 807983200019d723e1d021997cc637f266b005ae Fixed some warnings on 64 bit systems. diff -r 807983200019 -r ccafdf1e261f master/ioctl.c --- a/master/ioctl.c Thu Dec 06 18:13:02 2012 +0100 +++ b/master/ioctl.c Thu Dec 06 18:43:56 2012 +0100 @@ -589,7 +589,7 @@ 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 @@ } 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 @@ } 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 @@ 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 @@ } 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 @@ /* 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 @@ /* 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 @@ 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 -r 807983200019 -r ccafdf1e261f master/ioctl.h --- a/master/ioctl.h Thu Dec 06 18:13:02 2012 +0100 +++ b/master/ioctl.h Thu Dec 06 18:43:56 2012 +0100 @@ -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 @@ 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 @@ 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 @@ // 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 @@ 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 @@ // 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;