Skip to contentSkip to conversation

ipmi: use atomic_dec_not_zero()

PATCH In review Fabian Frederick 2 participants 3 messages Jan 30, 2017 – Jul 28, 2017 IPMI

lore
Share & tools
lore
#0 lore raw

PATCH 8/14 ipmi: use atomic_dec_not_zero()

instead of atomic_add_unless(value, -1, 0)

---
 drivers/char/ipmi/ipmi_msghandler.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/char/ipmi/ipmi_msghandler.c +1 -1
index 9f69995..961d677 100644
@@ -3851,7 +3851,7 @@ static void handle_new_recv_msgs(ipmi_smi_t intf)
 	 * If the pretimout count is non-zero, decrement one from it and
 	 * deliver pretimeouts to all the users.
 	 */
-	if (atomic_add_unless(&intf->watchdog_pretimeouts_to_deliver, -1, 0)) {
+	if (atomic_dec_not_zero(&intf->watchdog_pretimeouts_to_deliver)) {
 		ipmi_user_t user;
 
 		rcu_read_lock();
Signature · 1 line
2.9.3
#1 lore raw

I missed this until now, and I see it hasn't been applied yet. It's queued for the next release.

Thanks,

-corey

Quoted 20 lines · Fabian Frederick

instead of atomic_add_unless(value, -1, 0)

---
  drivers/char/ipmi/ipmi_msghandler.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
drivers/char/ipmi/ipmi_msghandler.c +1 -1
index 9f69995..961d677 100644
@@ -3851,7 +3851,7 @@ static void handle_new_recv_msgs(ipmi_smi_t intf)
  	 * If the pretimout count is non-zero, decrement one from it and
  	 * deliver pretimeouts to all the users.
  	 */
-	if (atomic_add_unless(&intf->watchdog_pretimeouts_to_deliver, -1, 0)) {
+	if (atomic_dec_not_zero(&intf->watchdog_pretimeouts_to_deliver)) {
  		ipmi_user_t user;
 
  		rcu_read_lock();
#2 lore raw
Quoted 2 lines · Corey Minyard

I missed this until now, and I see it hasn't been applied yet. It's queued for the next release.

Well, never mind, I see the main update didn't go in.

-corey

Quoted 27 lines

Thanks,

-corey

Quoted 20 lines · Fabian Frederick

instead of atomic_add_unless(value, -1, 0)

---
  drivers/char/ipmi/ipmi_msghandler.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
drivers/char/ipmi/ipmi_msghandler.c +1 -2
index 9f69995..961d677 100644
@@ -3851,7 +3851,7 @@ static void handle_new_recv_msgs(ipmi_smi_t intf)
       * If the pretimout count is non-zero, decrement one from it and
       * deliver pretimeouts to all the users.
       */
-    if (atomic_add_unless(&intf->watchdog_pretimeouts_to_deliver, 
-1, 0)) {
+    if (atomic_dec_not_zero(&intf->watchdog_pretimeouts_to_deliver)) {
          ipmi_user_t user;
            rcu_read_lock();