All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Steve Grubb" <steve@web-insights.net>
To: <linux-kernel@vger.kernel.org>
Subject: [PATCH] minor do_syslog cleanup
Date: Thu, 30 Nov 2000 09:26:17 -0500	[thread overview]
Message-ID: <000301c05ad9$830bde10$df1a24cf@master> (raw)

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/

                 reply	other threads:[~2000-11-30 14:58 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='000301c05ad9$830bde10$df1a24cf@master' \
    --to=steve@web-insights.net \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.