Linux-mtd Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: David Binderman <dcb314@hotmail.com>
To: "dwmw2@infradead.org" <dwmw2@infradead.org>,
	"computersforpeace@gmail.com" <computersforpeace@gmail.com>,
	"linux-mtd@lists.infradead.org" <linux-mtd@lists.infradead.org>
Subject: linux-next/include/linux/mtd/pfow.h: possible poor sequence of conditionals ?
Date: Tue, 22 Mar 2016 14:49:06 +0000	[thread overview]
Message-ID: <DUB128-W1B9618CEFDEE4D2DDF6C89C800@phx.gbl> (raw)

Hello there,

> [linux-next/include/linux/mtd/pfow.h:133]: (style) Expression is always false because 'else if' condition matches previous condition at line 130.
> [linux-next/include/linux/mtd/pfow.h:136]: (style) Expression is always false because 'else if' condition matches previous condition at line 130.

Source code is

    if (prog_status & 0x03)
        printk(KERN_NOTICE"DSR.9,8: (11) Attempt to program invalid "
                        "half with 41h command\n");
    else if (prog_status & 0x02)
        printk(KERN_NOTICE"DSR.9,8: (10) Object Mode Program attempt "
                    "in region with Control Mode data\n");
    else if (prog_status &  0x01)
        printk(KERN_NOTICE"DSR.9,8: (01) Program attempt in region "
                        "with Object Mode data\n");

Maybe something like

    switch (prog_status & 0x03)
    {
        case 0x03:
            printk(); break;
        case 0x02:
            printk(); break;
        case 0x01:
            printk(); break;
    }

might be better code.


Regards

David Binderman

 		 	   		  

             reply	other threads:[~2016-03-22 14:49 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-22 14:49 David Binderman [this message]
2016-04-03  6:27 ` linux-next/include/linux/mtd/pfow.h: possible poor sequence of conditionals ? Brian Norris
2016-04-03 15:41   ` David Binderman

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=DUB128-W1B9618CEFDEE4D2DDF6C89C800@phx.gbl \
    --to=dcb314@hotmail.com \
    --cc=computersforpeace@gmail.com \
    --cc=dwmw2@infradead.org \
    --cc=linux-mtd@lists.infradead.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox