Home Home > GIT Browse
summaryrefslogtreecommitdiff
authorLinus Torvalds <torvalds@g5.osdl.org>2006-11-08 02:22:31 (GMT)
committer Linus Torvalds <torvalds@g5.osdl.org>2006-11-08 02:22:31 (GMT)
commit5b064423d66159a1b33ff9d5bcb42040a03e7dfe (patch) (side-by-side diff)
tree2eb42eb50d75ca6e4ec773e81db6136adb5c0d7a
parent3d4248885b9fca818e7fe6b66328e714876d36ad (diff)
parent16b7f4dcd340875625714438a812ea06400f9666 (diff)
Merge branch 'fixes_for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jbglaw/vax-linux
* 'fixes_for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jbglaw/vax-linux: Update for the srm_env driver.
Diffstat (more/less context) (show whitespace changes)
-rw-r--r--arch/alpha/kernel/srm_env.c60
1 files changed, 15 insertions, 45 deletions
diff --git a/arch/alpha/kernel/srm_env.c b/arch/alpha/kernel/srm_env.c
index 990ac61..f7dd081 100644
--- a/arch/alpha/kernel/srm_env.c
+++ b/arch/alpha/kernel/srm_env.c
@@ -4,3 +4,3 @@
*
- * Copyright (C) 2001-2002 Jan-Benedict Glaw <jbglaw@lug-owl.de>
+ * (C) 2001,2002,2006 by Jan-Benedict Glaw <jbglaw@lug-owl.de>
*
@@ -31,29 +31,2 @@
-/*
- * Changelog
- * ~~~~~~~~~
- *
- * Thu, 22 Aug 2002 15:10:43 +0200
- * - Update Config.help entry. I got a number of emails asking
- * me to tell their senders if they could make use of this
- * piece of code... So: "SRM is something like BIOS for your
- * Alpha"
- * - Update code formatting a bit to better conform CodingStyle
- * rules.
- * - So this is v0.0.5, with no changes (except formatting)
- *
- * Wed, 22 May 2002 00:11:21 +0200
- * - Fix typo on comment (SRC -> SRM)
- * - Call this "Version 0.0.4"
- *
- * Tue, 9 Apr 2002 18:44:40 +0200
- * - Implement access by variable name and additionally
- * by number. This is done by creating two subdirectories
- * where one holds all names (like the old directory
- * did) and the other holding 256 files named like "0",
- * "1" and so on.
- * - Call this "Version 0.0.3"
- *
- */
-
#include <linux/kernel.h>
@@ -69,3 +42,3 @@
#define NUMBERED_DIR "numbered_variables" /* Subdir for all variables */
-#define VERSION "0.0.5" /* Module version */
+#define VERSION "0.0.6" /* Module version */
#define NAME "srm_env" /* Module name */
@@ -108,3 +81,2 @@ static srm_env_t srm_numbered_entries[256];
-
static int
@@ -117,4 +89,6 @@ srm_env_read(char *page, char **start, off_t off, int count, int *eof,
- if(off != 0)
- return -EFAULT;
+ if (off != 0) {
+ *eof = 1;
+ return 0;
+ }
@@ -123,5 +97,6 @@ srm_env_read(char *page, char **start, off_t off, int count, int *eof,
- if((ret >> 61) == 0)
+ if ((ret >> 61) == 0) {
nbytes = (int) ret;
- else
+ *eof = 1;
+ } else
nbytes = -EFAULT;
@@ -131,3 +106,2 @@ srm_env_read(char *page, char **start, off_t off, int count, int *eof,
-
static int
@@ -214,3 +188,2 @@ srm_env_cleanup(void)
-
static int __init
@@ -242,3 +215,3 @@ srm_env_init(void)
base_dir = proc_mkdir(BASE_DIR, NULL);
- if(base_dir == NULL) {
+ if (!base_dir) {
printk(KERN_ERR "Couldn't create base dir /proc/%s\n",
@@ -253,3 +226,3 @@ srm_env_init(void)
named_dir = proc_mkdir(NAMED_DIR, base_dir);
- if(named_dir == NULL) {
+ if (!named_dir) {
printk(KERN_ERR "Couldn't create dir /proc/%s/%s\n",
@@ -264,3 +237,3 @@ srm_env_init(void)
numbered_dir = proc_mkdir(NUMBERED_DIR, base_dir);
- if(numbered_dir == NULL) {
+ if (!numbered_dir) {
printk(KERN_ERR "Couldn't create dir /proc/%s/%s\n",
@@ -276,6 +249,6 @@ srm_env_init(void)
entry = srm_named_entries;
- while(entry->name != NULL && entry->id != 0) {
+ while (entry->name && entry->id) {
entry->proc_entry = create_proc_entry(entry->name,
0644, named_dir);
- if(entry->proc_entry == NULL)
+ if (!entry->proc_entry)
goto cleanup;
@@ -299,3 +272,3 @@ srm_env_init(void)
0644, numbered_dir);
- if(entry->proc_entry == NULL)
+ if (!entry->proc_entry)
goto cleanup;
@@ -320,3 +293,2 @@ cleanup:
-
static void __exit
@@ -330,5 +302,3 @@ srm_env_exit(void)
-
module_init(srm_env_init);
module_exit(srm_env_exit);
-