Re: [PATCH v2 01/10] boot-mode-reg: Add core

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Geert,

On 11.05.2016 09:54, Geert Uytterhoeven wrote:
Hi Dirk,

On Wed, May 11, 2016 at 7:29 AM, Dirk Behme <dirk.behme@xxxxxxxxxxxx> wrote:
--- /dev/null
+++ b/drivers/misc/boot-mode-reg/core.c

+/**
+ * boot_mode_reg_set() - record boot mode register value
+ * @mode: implementation-dependent boot mode register value
+ *
+ * Records the boot mode register value which may subsequently
+ * be retrieved using boot_mode_reg_get().
+ *
+ * return: 0 on success
+ */
+int boot_mode_reg_set(u32 mode)
+{
+       int err = -EBUSY;
+
+       mutex_lock(&boot_mode_mutex);
+       if (!boot_mode_is_set) {

You've dropped the check for calling this function a subsequent time with
a different value of mode?


Sometimes inverting 'complex' if statements is not that easy ;)

You mean

if (!boot_mode_is_set || boot_mode != mode)

?

Best regards

Dirk





[Index of Archives]     [Linux Samsung SOC]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]

  Powered by Linux