Skip to content

Commit 2e30dd9

Browse files
committed
x86/mtrr: Get rid of mtrr_seq_show() forward declaration
... by moving the function up in the file. No functional changes. Signed-off-by: Borislav Petkov <[email protected]> Cc: [email protected] Link: https://lkml.kernel.org/r/[email protected]
1 parent e42617b commit 2e30dd9

File tree

1 file changed

+20
-22
lines changed
  • arch/x86/kernel/cpu/mtrr

1 file changed

+20
-22
lines changed

arch/x86/kernel/cpu/mtrr/if.c

Lines changed: 20 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -373,28 +373,6 @@ static int mtrr_close(struct inode *ino, struct file *file)
373373
return single_release(ino, file);
374374
}
375375

376-
static int mtrr_seq_show(struct seq_file *seq, void *offset);
377-
378-
static int mtrr_open(struct inode *inode, struct file *file)
379-
{
380-
if (!mtrr_if)
381-
return -EIO;
382-
if (!mtrr_if->get)
383-
return -ENXIO;
384-
return single_open(file, mtrr_seq_show, NULL);
385-
}
386-
387-
static const struct file_operations mtrr_fops = {
388-
.owner = THIS_MODULE,
389-
.open = mtrr_open,
390-
.read = seq_read,
391-
.llseek = seq_lseek,
392-
.write = mtrr_write,
393-
.unlocked_ioctl = mtrr_ioctl,
394-
.compat_ioctl = mtrr_ioctl,
395-
.release = mtrr_close,
396-
};
397-
398376
static int mtrr_seq_show(struct seq_file *seq, void *offset)
399377
{
400378
char factor;
@@ -426,6 +404,26 @@ static int mtrr_seq_show(struct seq_file *seq, void *offset)
426404
return 0;
427405
}
428406

407+
static int mtrr_open(struct inode *inode, struct file *file)
408+
{
409+
if (!mtrr_if)
410+
return -EIO;
411+
if (!mtrr_if->get)
412+
return -ENXIO;
413+
return single_open(file, mtrr_seq_show, NULL);
414+
}
415+
416+
static const struct file_operations mtrr_fops = {
417+
.owner = THIS_MODULE,
418+
.open = mtrr_open,
419+
.read = seq_read,
420+
.llseek = seq_lseek,
421+
.write = mtrr_write,
422+
.unlocked_ioctl = mtrr_ioctl,
423+
.compat_ioctl = mtrr_ioctl,
424+
.release = mtrr_close,
425+
};
426+
429427
static int __init mtrr_if_init(void)
430428
{
431429
struct cpuinfo_x86 *c = &boot_cpu_data;

0 commit comments

Comments
 (0)