if (get_info.rom != 0) {
void __user *uptr = u64_to_uptr(get_info.rom);
- size_t length = min(get_info.rom_length,
- client->device->config_rom_length * 4);
+ size_t want = get_info.rom_length;
+ size_t have = client->device->config_rom_length * 4;
- if (copy_to_user(uptr, client->device->config_rom, length))
+ if (copy_to_user(uptr, client->device->config_rom,
+ min(want, have)))
return -EFAULT;
}
get_info.rom_length = client->device->config_rom_length * 4;
struct fw_unit *unit = fw_unit(dev);
return snprintf(buf, PAGE_SIZE, "%d\n",
- unit->directory - device->config_rom);
+ (int)(unit->directory - device->config_rom));
}
static struct device_attribute rom_index_attribute = {