]> Pileus Git - ~andy/linux/commitdiff
Merge branch 'x86-cleanups-for-linus' of git://git.kernel.org/pub/scm/linux/kernel...
authorLinus Torvalds <torvalds@linux-foundation.org>
Tue, 12 Nov 2013 01:45:01 +0000 (10:45 +0900)
committerLinus Torvalds <torvalds@linux-foundation.org>
Tue, 12 Nov 2013 01:45:01 +0000 (10:45 +0900)
Pull x86 cleanups from Ingo Molnar:
 "Two small cleanups"

* 'x86-cleanups-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
  x86, msr: Use file_inode(), not f_mapping->host
  x86: mkpiggy.c: Explicitly close the output file

arch/x86/boot/compressed/mkpiggy.c
arch/x86/kernel/msr.c

index 958a641483dd5fa3817eebae63170da86e36e2b1..b669ab65bf6cf2e6973d6dc50cb693a1a8568324 100644 (file)
@@ -36,11 +36,12 @@ int main(int argc, char *argv[])
        uint32_t olen;
        long ilen;
        unsigned long offs;
-       FILE *f;
+       FILE *f = NULL;
+       int retval = 1;
 
        if (argc < 2) {
                fprintf(stderr, "Usage: %s compressed_file\n", argv[0]);
-               return 1;
+               goto bail;
        }
 
        /* Get the information for the compressed kernel image first */
@@ -48,7 +49,7 @@ int main(int argc, char *argv[])
        f = fopen(argv[1], "r");
        if (!f) {
                perror(argv[1]);
-               return 1;
+               goto bail;
        }
 
 
@@ -58,12 +59,11 @@ int main(int argc, char *argv[])
 
        if (fread(&olen, sizeof(olen), 1, f) != 1) {
                perror(argv[1]);
-               return 1;
+               goto bail;
        }
 
        ilen = ftell(f);
        olen = get_unaligned_le32(&olen);
-       fclose(f);
 
        /*
         * Now we have the input (compressed) and output (uncompressed)
@@ -91,5 +91,9 @@ int main(int argc, char *argv[])
        printf(".incbin \"%s\"\n", argv[1]);
        printf("input_data_end:\n");
 
-       return 0;
+       retval = 0;
+bail:
+       if (f)
+               fclose(f);
+       return retval;
 }
index 88458faea2f8f0ace5ae6d2b02a451bf43a2d9af..05266b5aae22916e864bb21e1399193ff253374e 100644 (file)
@@ -46,7 +46,7 @@ static struct class *msr_class;
 static loff_t msr_seek(struct file *file, loff_t offset, int orig)
 {
        loff_t ret;
-       struct inode *inode = file->f_mapping->host;
+       struct inode *inode = file_inode(file);
 
        mutex_lock(&inode->i_mutex);
        switch (orig) {