lkml.org 
[lkml]   [2000]   [Nov]   [30]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH] minor do_syslog cleanup
Date
Hello,

This patch removes extra setting of the error value in the do_syslog
function. The patch is against 2.2.16, but printk.c seems to have changed
little so it probably applies against other kernels.

See Ya,
Steve Grubb

--------------------

--- printk.orig Thu Nov 30 07:58:58 2000
+++ printk.c Thu Nov 30 08:55:07 2000
@@ -123,19 +123,18 @@
unsigned long i, j, limit, count;
int do_clear = 0;
char c;
- int error = -EPERM;
+ int error = 0;

- error = 0;
switch (type) {
case 0: /* Close log */
break;
case 1: /* Open log */
break;
case 2: /* Read from log */
- error = -EINVAL;
- if (!buf || len < 0)
+ if (!buf || len < 0) {
+ error = -EINVAL;
goto out;
- error = 0;
+ }
if (!len)
goto out;
error = verify_area(VERIFY_WRITE,buf,len);
@@ -163,10 +162,10 @@
do_clear = 1;
/* FALL THRU */
case 3: /* Read last kernel messages */
- error = -EINVAL;
- if (!buf || len < 0)
+ if (!buf || len < 0) {
+ error = -EINVAL;
goto out;
- error = 0;
+ }
if (!len)
goto out;
error = verify_area(VERIFY_WRITE,buf,len);
@@ -224,15 +223,15 @@
spin_unlock_irq(&console_lock);
break;
case 8:
- error = -EINVAL;
- if (len < 1 || len > 8)
+ if (len < 1 || len > 8) {
+ error = -EINVAL;
goto out;
+ }
if (len < minimum_console_loglevel)
len = minimum_console_loglevel;
spin_lock_irq(&console_lock);
console_loglevel = len;
spin_unlock_irq(&console_lock);
- error = 0;
break;
default:
error = -EINVAL;

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 12:49    [W:0.040 / U:0.432 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site