All of lore.kernel.org
 help / color / mirror / Atom feed
* linux-next/include/linux/mtd/pfow.h: possible poor sequence of conditionals ?
@ 2016-03-22 14:49 David Binderman
  2016-04-03  6:27 ` Brian Norris
  0 siblings, 1 reply; 3+ messages in thread
From: David Binderman @ 2016-03-22 14:49 UTC (permalink / raw)
  To: dwmw2@infradead.org, computersforpeace@gmail.com,
	linux-mtd@lists.infradead.org

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

 		 	   		  

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2016-04-03 15:42 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-03-22 14:49 linux-next/include/linux/mtd/pfow.h: possible poor sequence of conditionals ? David Binderman
2016-04-03  6:27 ` Brian Norris
2016-04-03 15:41   ` David Binderman

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.