firewire: fix compiler warnings on 64bit
authorStefan Richter <stefanr@s5r6.in-berlin.de>
Tue, 20 Mar 2007 18:42:15 +0000 (19:42 +0100)
committerStefan Richter <stefanr@s5r6.in-berlin.de>
Tue, 20 Mar 2007 22:27:19 +0000 (23:27 +0100)
Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
Signed-off-by: Kristian Høgsberg <krh@redhat.com>
drivers/firewire/fw-device-cdev.c
drivers/firewire/fw-device.c

index b1b7edb0d2adc1958d56863f90c4194336b52a8e..f9f2688614183f48a824d6f0a8193bcaea02727b 100644 (file)
@@ -274,10 +274,11 @@ static int ioctl_get_info(struct client *client, void __user *arg)
 
        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;
index 415e9abb062b486e8fa471e162e25caa8f67630e..a834221b7588568fbe094a498779e003abcd5472 100644 (file)
@@ -240,7 +240,7 @@ show_rom_index_attribute(struct device *dev,
        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 = {