Linux EDAC development
 help / color / mirror / Atom feed
* edac: pnd2_edac: add code comment for clarification and update variable assignment
@ 2017-06-22 22:05 Gustavo A. R. Silva
  0 siblings, 0 replies; 2+ messages in thread
From: Gustavo A. R. Silva @ 2017-06-22 22:05 UTC (permalink / raw)
  To: Borislav Petkov, Tony Luck, Mauro Carvalho Chehab, Qiuxu Zhuo
  Cc: linux-edac, linux-kernel, Gustavo A. R. Silva

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

Cc: Borislav Petkov <bp@alien8.de>
Signed-off-by: Gustavo A. R. Silva <garsilva@embeddedor.com>
---
 drivers/edac/pnd2_edac.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/edac/pnd2_edac.c b/drivers/edac/pnd2_edac.c
index 1cad5a9..63cb323 100644
--- a/drivers/edac/pnd2_edac.c
+++ b/drivers/edac/pnd2_edac.c
@@ -174,8 +174,9 @@ static int apl_rd_reg(int port, int off, int op, void *data, size_t sz, char *na
 	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;

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

* edac: pnd2_edac: add code comment for clarification and update variable assignment
@ 2017-06-23  7:53 Borislav Petkov
  0 siblings, 0 replies; 2+ messages in thread
From: Borislav Petkov @ 2017-06-23  7:53 UTC (permalink / raw)
  To: Gustavo A. R. Silva
  Cc: Tony Luck, Mauro Carvalho Chehab, Qiuxu Zhuo, linux-edac,
	linux-kernel

On Thu, Jun 22, 2017 at 05:05:35PM -0500, Gustavo A. R. Silva wrote:
> Add code comment to make it clear that the fall-through is intentional and,
> OR ret with its previous value to avoid overwriting it.
> 
> Cc: Borislav Petkov <bp@alien8.de>
> Signed-off-by: Gustavo A. R. Silva <garsilva@embeddedor.com>
> ---
>  drivers/edac/pnd2_edac.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)

Applied, thanks.

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

end of thread, other threads:[~2017-06-23  7:53 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-06-22 22:05 edac: pnd2_edac: add code comment for clarification and update variable assignment Gustavo A. R. Silva
  -- strict thread matches above, loose matches on Subject: below --
2017-06-23  7:53 Borislav Petkov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox