diff options
author | Stefan Richter <stefanr@s5r6.in-berlin.de> | 2007-03-20 14:42:15 -0400 |
---|---|---|
committer | Stefan Richter <stefanr@s5r6.in-berlin.de> | 2007-03-20 18:27:19 -0400 |
commit | d84702a5d7b500ead8db129ddea789c88764f357 (patch) | |
tree | 64a8fecec334a554517d0183b6b7c647e6448edc | |
parent | 633c52dccd73d83eabbe1fb23e3822b695a2718b (diff) |
firewire: fix compiler warnings on 64bit
Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
Signed-off-by: Kristian Høgsberg <krh@redhat.com>
-rw-r--r-- | drivers/firewire/fw-device-cdev.c | 7 | ||||
-rw-r--r-- | drivers/firewire/fw-device.c | 2 |
2 files changed, 5 insertions, 4 deletions
diff --git a/drivers/firewire/fw-device-cdev.c b/drivers/firewire/fw-device-cdev.c index b1b7edb0d2ad..f9f268861418 100644 --- a/drivers/firewire/fw-device-cdev.c +++ b/drivers/firewire/fw-device-cdev.c | |||
@@ -274,10 +274,11 @@ static int ioctl_get_info(struct client *client, void __user *arg) | |||
274 | 274 | ||
275 | if (get_info.rom != 0) { | 275 | if (get_info.rom != 0) { |
276 | void __user *uptr = u64_to_uptr(get_info.rom); | 276 | void __user *uptr = u64_to_uptr(get_info.rom); |
277 | size_t length = min(get_info.rom_length, | 277 | size_t want = get_info.rom_length; |
278 | client->device->config_rom_length * 4); | 278 | size_t have = client->device->config_rom_length * 4; |
279 | 279 | ||
280 | if (copy_to_user(uptr, client->device->config_rom, length)) | 280 | if (copy_to_user(uptr, client->device->config_rom, |
281 | min(want, have))) | ||
281 | return -EFAULT; | 282 | return -EFAULT; |
282 | } | 283 | } |
283 | get_info.rom_length = client->device->config_rom_length * 4; | 284 | get_info.rom_length = client->device->config_rom_length * 4; |
diff --git a/drivers/firewire/fw-device.c b/drivers/firewire/fw-device.c index 415e9abb062b..a834221b7588 100644 --- a/drivers/firewire/fw-device.c +++ b/drivers/firewire/fw-device.c | |||
@@ -240,7 +240,7 @@ show_rom_index_attribute(struct device *dev, | |||
240 | struct fw_unit *unit = fw_unit(dev); | 240 | struct fw_unit *unit = fw_unit(dev); |
241 | 241 | ||
242 | return snprintf(buf, PAGE_SIZE, "%d\n", | 242 | return snprintf(buf, PAGE_SIZE, "%d\n", |
243 | unit->directory - device->config_rom); | 243 | (int)(unit->directory - device->config_rom)); |
244 | } | 244 | } |
245 | 245 | ||
246 | static struct device_attribute rom_index_attribute = { | 246 | static struct device_attribute rom_index_attribute = { |