Skip to contentSkip to conversation

x86/mtrr: Get rid of mtrr_seq_show() forward declaration

PATCH Applied Borislav Petkov 2 participants 3 messages Nov 8, 2019 – Dec 9, 2019 x86

lore
Share & tools
lore

Borislav Petkov

author maintainer
#0 lore raw

PATCH 1/1 x86/mtrr: Get rid of mtrr_seq_show() forward declaration

From: Borislav Petkov <[email protected]>

... by moving the function up in the file.

No functional changes.

---
 arch/x86/kernel/cpu/mtrr/if.c | 42 +++++++++++++++++------------------
 1 file changed, 20 insertions(+), 22 deletions(-)
arch/x86/kernel/cpu/mtrr/if.c +20 -22
index 8e0cee89fd11..79f0d2d42b0d 100644
@@ -369,28 +369,6 @@ static int mtrr_close(struct inode *ino, struct file *file)
 	return single_release(ino, file);
 }
 
-static int mtrr_seq_show(struct seq_file *seq, void *offset);
-
-static int mtrr_open(struct inode *inode, struct file *file)
-{
-	if (!mtrr_if)
-		return -EIO;
-	if (!mtrr_if->get)
-		return -ENXIO;
-	return single_open(file, mtrr_seq_show, NULL);
-}
-
-static const struct file_operations mtrr_fops = {
-	.owner			= THIS_MODULE,
-	.open			= mtrr_open,
-	.read			= mtrr_read,
-	.llseek			= seq_lseek,
-	.write			= mtrr_write,
-	.unlocked_ioctl		= mtrr_ioctl,
-	.compat_ioctl		= mtrr_ioctl,
-	.release		= mtrr_close,
-};
-
 static int mtrr_seq_show(struct seq_file *seq, void *offset)
 {
 	char factor;
@@ -422,6 +400,26 @@ static int mtrr_seq_show(struct seq_file *seq, void *offset)
 	return 0;
 }
 
+static int mtrr_open(struct inode *inode, struct file *file)
+{
+	if (!mtrr_if)
+		return -EIO;
+	if (!mtrr_if->get)
+		return -ENXIO;
+	return single_open(file, mtrr_seq_show, NULL);
+}
+
+static const struct file_operations mtrr_fops = {
+	.owner			= THIS_MODULE,
+	.open			= mtrr_open,
+	.read			= mtrr_read,
+	.llseek			= seq_lseek,
+	.write			= mtrr_write,
+	.unlocked_ioctl		= mtrr_ioctl,
+	.compat_ioctl		= mtrr_ioctl,
+	.release		= mtrr_close,
+};
+
 static int __init mtrr_if_init(void)
 {
 	struct cpuinfo_x86 *c = &boot_cpu_data;
Signature · 1 line
2.21.0
#1 lore raw
The following commit has been merged into the x86/mtrr branch of tip:

The following commit has been merged into the x86/mtrr branch of tip:

Commit-ID:     bb2385bc38ffcea8afd0968e1895424e512c176c
Gitweb:        https://git.kernel.org/tip/bb2385bc38ffcea8afd0968e1895424e512c176c
Author:        Borislav Petkov <[email protected]>
AuthorDate:    Fri, 08 Nov 2019 21:05:45 +01:00
Committer:     Borislav Petkov <[email protected]>
CommitterDate: Fri, 08 Nov 2019 21:10:02 +01:00

x86/mtrr: Get rid of mtrr_seq_show() forward declaration

... by moving the function up in the file.

No functional changes.

---
 arch/x86/kernel/cpu/mtrr/if.c | 42 ++++++++++++++++------------------
 1 file changed, 20 insertions(+), 22 deletions(-)
arch/x86/kernel/cpu/mtrr/if.c +20 -22
index 8e0cee8..79f0d2d 100644
@@ -369,28 +369,6 @@ static int mtrr_close(struct inode *ino, struct file *file)
 	return single_release(ino, file);
 }
 
-static int mtrr_seq_show(struct seq_file *seq, void *offset);
-
-static int mtrr_open(struct inode *inode, struct file *file)
-{
-	if (!mtrr_if)
-		return -EIO;
-	if (!mtrr_if->get)
-		return -ENXIO;
-	return single_open(file, mtrr_seq_show, NULL);
-}
-
-static const struct file_operations mtrr_fops = {
-	.owner			= THIS_MODULE,
-	.open			= mtrr_open,
-	.read			= mtrr_read,
-	.llseek			= seq_lseek,
-	.write			= mtrr_write,
-	.unlocked_ioctl		= mtrr_ioctl,
-	.compat_ioctl		= mtrr_ioctl,
-	.release		= mtrr_close,
-};
-
 static int mtrr_seq_show(struct seq_file *seq, void *offset)
 {
 	char factor;
@@ -422,6 +400,26 @@ static int mtrr_seq_show(struct seq_file *seq, void *offset)
 	return 0;
 }
 
+static int mtrr_open(struct inode *inode, struct file *file)
+{
+	if (!mtrr_if)
+		return -EIO;
+	if (!mtrr_if->get)
+		return -ENXIO;
+	return single_open(file, mtrr_seq_show, NULL);
+}
+
+static const struct file_operations mtrr_fops = {
+	.owner			= THIS_MODULE,
+	.open			= mtrr_open,
+	.read			= mtrr_read,
+	.llseek			= seq_lseek,
+	.write			= mtrr_write,
+	.unlocked_ioctl		= mtrr_ioctl,
+	.compat_ioctl		= mtrr_ioctl,
+	.release		= mtrr_close,
+};
+
 static int __init mtrr_if_init(void)
 {
 	struct cpuinfo_x86 *c = &boot_cpu_data;
#2 lore raw
In reply to Borislav Petkov
The following commit has been merged into the x86/mtrr branch of tip:

The following commit has been merged into the x86/mtrr branch of tip:

Commit-ID:     2e30dd9e0698d5a04698f38e932a6e29893d8a93
Gitweb:        https://git.kernel.org/tip/2e30dd9e0698d5a04698f38e932a6e29893d8a93
Author:        Borislav Petkov <[email protected]>
AuthorDate:    Fri, 08 Nov 2019 21:05:45 +01:00
Committer:     Borislav Petkov <[email protected]>
CommitterDate: Mon, 09 Dec 2019 09:23:44 +01:00

x86/mtrr: Get rid of mtrr_seq_show() forward declaration

... by moving the function up in the file.

No functional changes.

---
 arch/x86/kernel/cpu/mtrr/if.c | 42 ++++++++++++++++------------------
 1 file changed, 20 insertions(+), 22 deletions(-)
arch/x86/kernel/cpu/mtrr/if.c +20 -22
index 4d36dcc..268d318 100644
@@ -373,28 +373,6 @@ static int mtrr_close(struct inode *ino, struct file *file)
 	return single_release(ino, file);
 }
 
-static int mtrr_seq_show(struct seq_file *seq, void *offset);
-
-static int mtrr_open(struct inode *inode, struct file *file)
-{
-	if (!mtrr_if)
-		return -EIO;
-	if (!mtrr_if->get)
-		return -ENXIO;
-	return single_open(file, mtrr_seq_show, NULL);
-}
-
-static const struct file_operations mtrr_fops = {
-	.owner			= THIS_MODULE,
-	.open			= mtrr_open,
-	.read			= seq_read,
-	.llseek			= seq_lseek,
-	.write			= mtrr_write,
-	.unlocked_ioctl		= mtrr_ioctl,
-	.compat_ioctl		= mtrr_ioctl,
-	.release		= mtrr_close,
-};
-
 static int mtrr_seq_show(struct seq_file *seq, void *offset)
 {
 	char factor;
@@ -426,6 +404,26 @@ static int mtrr_seq_show(struct seq_file *seq, void *offset)
 	return 0;
 }
 
+static int mtrr_open(struct inode *inode, struct file *file)
+{
+	if (!mtrr_if)
+		return -EIO;
+	if (!mtrr_if->get)
+		return -ENXIO;
+	return single_open(file, mtrr_seq_show, NULL);
+}
+
+static const struct file_operations mtrr_fops = {
+	.owner			= THIS_MODULE,
+	.open			= mtrr_open,
+	.read			= seq_read,
+	.llseek			= seq_lseek,
+	.write			= mtrr_write,
+	.unlocked_ioctl		= mtrr_ioctl,
+	.compat_ioctl		= mtrr_ioctl,
+	.release		= mtrr_close,
+};
+
 static int __init mtrr_if_init(void)
 {
 	struct cpuinfo_x86 *c = &boot_cpu_data;