Re: [PATCH] watchdog: make imx2_wdt report boot status correctly

From: Wolfram Sang
Date: Thu Feb 16 2012 - 09:24:00 EST



> Seen from the perspective of code compactness ("save some lines"),
> one could try to be consequent here, and save the "val" variable
> altogether, ending up with some "new_value = __raw_readw ... & ... ? ... : 0;"
> But eventually there might be code readability issues, so it's
> a good idea to keep the balance.

Yes.

> An argument for the original, longer version might be it is easier
> to extend, when more flags need to be handled, like
> "else if (val & ...) new_value = ...", while nested conditional
> expressions would most likely become quite complex soon.

Once we have support to handle non-stoppable watchdogs in the the new
watchdog framework, the code will be greatly refactored anyhow :)

Thanks,

Wolfram

--
Pengutronix e.K. | Wolfram Sang |
Industrial Linux Solutions | http://www.pengutronix.de/ |

Attachment: signature.asc
Description: Digital signature