Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ee514c7a authored by Gustavo A. R. Silva's avatar Gustavo A. R. Silva Committed by Borislav Petkov
Browse files

EDAC, pnd2: Return proper error value from apl_rd_reg()



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: default avatarGustavo A. R. Silva <garsilva@embeddedor.com>
Cc: Qiuxu Zhuo <qiuxu.zhuo@intel.com>
Cc: Tony Luck <tony.luck@intel.com>
Cc: linux-edac <linux-edac@vger.kernel.org>
Link: http://lkml.kernel.org/r/20170622220535.GA4896@embeddedgus


[ Massage a bit. ]
Signed-off-by: default avatarBorislav Petkov <bp@suse.de>
parent ff0abed4
Loading
Loading
Loading
Loading
+3 −2
Original line number Original line Diff line number Diff line
@@ -174,8 +174,9 @@ static int apl_rd_reg(int port, int off, int op, void *data, size_t sz, char *na
	switch (sz) {
	switch (sz) {
	case 8:
	case 8:
		ret = sbi_send(port, off + 4, op, (u32 *)(data + 4));
		ret = sbi_send(port, off + 4, op, (u32 *)(data + 4));
		/* fall through */
	case 4:
	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,
		pnd2_printk(KERN_DEBUG, "%s=%x%08x ret=%d\n", name,
					sz == 8 ? *((u32 *)(data + 4)) : 0, *((u32 *)data), ret);
					sz == 8 ? *((u32 *)(data + 4)) : 0, *((u32 *)data), ret);
		break;
		break;