From: "Gustavo A. R. Silva" <garsi...@embeddedor.com>

commit ee514c7a2379385fcec363f2f5f8db4eb56bc48c upstream.

Add code comment to make it clear that the fall-through is intentional
and, OR ret with its previous value to avoid overwriting it so that
callers can check the correct return value.

Signed-off-by: Gustavo A. R. Silva <garsi...@embeddedor.com>
Cc: Qiuxu Zhuo <qiuxu.z...@intel.com>
Cc: Tony Luck <tony.l...@intel.com>
Cc: linux-edac <linux-e...@vger.kernel.org>
Link: http://lkml.kernel.org/r/20170622220535.GA4896@embeddedgus
[ Massage a bit. ]
Signed-off-by: Borislav Petkov <b...@suse.de>

Signed-off-by: Liwei Song <liwei.s...@windriver.com>
---
 drivers/edac/pnd2_edac.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/edac/pnd2_edac.c b/drivers/edac/pnd2_edac.c
index 1cad5a9af8d0..e1748d7e5190 100644
--- a/drivers/edac/pnd2_edac.c
+++ b/drivers/edac/pnd2_edac.c
@@ -168,14 +168,15 @@ int sbi_send(int port, int off, int op, u32 *data)
 
 static int apl_rd_reg(int port, int off, int op, void *data, size_t sz, char 
*name)
 {
-       int     ret = 0;
+       int ret = 0;
 
        edac_dbg(2, "Read %s port=%x off=%x op=%x\n", name, port, off, op);
        switch (sz) {
        case 8:
                ret = sbi_send(port, off + 4, op, (u32 *)(data + 4));
+               /* fall through */
        case 4:
-               ret = sbi_send(port, off, op, (u32 *)data);
+               ret |= sbi_send(port, off, op, (u32 *)data);
                pnd2_printk(KERN_DEBUG, "%s=%x%08x ret=%d\n", name,
                                        sz == 8 ? *((u32 *)(data + 4)) : 0, 
*((u32 *)data), ret);
                break;
-- 
2.7.4

-- 
_______________________________________________
linux-yocto mailing list
linux-yocto@yoctoproject.org
https://lists.yoctoproject.org/listinfo/linux-yocto

Reply via email to