]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
efivarfs: Make 'datasize' unsigned long
authorMatt Fleming <matt.fleming@intel.com>
Tue, 23 Oct 2012 11:35:43 +0000 (12:35 +0100)
committerMatt Fleming <matt.fleming@intel.com>
Tue, 30 Oct 2012 10:39:27 +0000 (10:39 +0000)
There's no reason to declare 'datasize' as an int, since the majority
of the functions it's passed to expect an unsigned long anyway. Plus,
this way we avoid any sign problems during arithmetic.

Acked-by: Jeremy Kerr <jeremy.kerr@canonical.com>
Signed-off-by: Matt Fleming <matt.fleming@intel.com>
drivers/firmware/efivars.c

index 3b0cf9acb504805b849900a07842bca296af9752..6a858d1a5bb308b73b4fe57bb9ea62e5b3f2dd18 100644 (file)
@@ -692,7 +692,7 @@ static ssize_t efivarfs_file_write(struct file *file,
        void *data;
        u32 attributes;
        struct inode *inode = file->f_mapping->host;
-       int datasize = count - sizeof(attributes);
+       unsigned long datasize = count - sizeof(attributes);
        unsigned long newdatasize;
 
        if (count < sizeof(attributes))