Skip to content

Commit

Permalink
Merge branch 'x86-cleanups-for-linus' of git://git.kernel.org/pub/scm…
Browse files Browse the repository at this point in the history
…/linux/kernel/git/tip/tip

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
  • Loading branch information
Linus Torvalds committed Nov 12, 2013
2 parents 54e1130 + 1224987 commit d96d8aa
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 7 deletions.
16 changes: 10 additions & 6 deletions arch/x86/boot/compressed/mkpiggy.c
Original file line number Diff line number Diff line change
Expand Up @@ -36,19 +36,20 @@ 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 */

f = fopen(argv[1], "r");
if (!f) {
perror(argv[1]);
return 1;
goto bail;
}


Expand All @@ -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)
Expand Down Expand Up @@ -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;
}
2 changes: 1 addition & 1 deletion arch/x86/kernel/msr.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit d96d8aa

Please sign in to comment.