summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorhwangcc <hwangcc@csie.nctu.edu.tw>2015-01-12 23:36:26 +0800
committerJavier Martinez Canillas <javier@dowhile0.org>2018-02-25 01:57:35 +0100
commit3080b55e3f21d4749244e3aa359bcc3e4ad80b53 (patch)
tree39751306f8fa1a6903d17969de8aa3ec8528afb4
parentdeeee9cfa2335370fb410d9a81b1df781c469af0 (diff)
downloadldd3-3080b55e3f21d4749244e3aa359bcc3e4ad80b53.tar.gz
seq.c: checkpatch.pl cleanups
Signed-off-by: hwangcc <hwangcc@csie.nctu.edu.tw>
-rw-r--r--misc-modules/seq.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/misc-modules/seq.c b/misc-modules/seq.c
index 146615a..5d0d100 100644
--- a/misc-modules/seq.c
+++ b/misc-modules/seq.c
@@ -1,7 +1,7 @@
/*
* Simple demonstration of the seq_file interface.
*
- * $Id: seq.c,v 1.3 2004/09/26 07:02:43 gregkh Exp $
+ * seq.c,v 1.3 2004/09/26 07:02:43 gregkh Exp
*/
#include <linux/init.h>
@@ -39,7 +39,7 @@ static void *ct_seq_next(struct seq_file *s, void *v, loff_t *pos)
static void ct_seq_stop(struct seq_file *s, void *v)
{
- kfree (v);
+ kfree(v);
}
/*
@@ -48,14 +48,14 @@ static void ct_seq_stop(struct seq_file *s, void *v)
static int ct_seq_show(struct seq_file *s, void *v)
{
loff_t *spos = (loff_t *) v;
- seq_printf(s, "%Ld\n", *spos);
+ seq_printf(s, "%lld\n", *spos);
return 0;
}
/*
* Tie them all together into a set of seq_operations.
*/
-static struct seq_operations ct_seq_ops = {
+static const struct seq_operations ct_seq_ops = {
.start = ct_seq_start,
.next = ct_seq_next,
.stop = ct_seq_stop,
@@ -77,15 +77,15 @@ static int ct_open(struct inode *inode, struct file *file)
* The file operations structure contains our open function along with
* set of the canned seq_ ops.
*/
-static struct file_operations ct_file_ops = {
+static const struct file_operations ct_file_ops = {
.owner = THIS_MODULE,
.open = ct_open,
.read = seq_read,
.llseek = seq_lseek,
.release = seq_release
};
-
-
+
+
/*
* Module setup and teardown.
*/
@@ -95,6 +95,8 @@ static int ct_init(void)
struct proc_dir_entry *entry;
entry = proc_create("sequence", 0, NULL, &ct_file_ops);
+ if (!entry)
+ return -ENOMEM;
return 0;
}