Skip to contentSkip to conversation

ocfs2/dlm: Remove unnecessary parentheses

PATCH RESEND New Nathan Chancellor 1 participant 1 message Sep 24, 2018 OCFS2

lore
Share & tools
lore
#0 lore raw

PATCH RESEND 1/1 ocfs2/dlm: Remove unnecessary parentheses

Clang warns when more than one set of parentheses is used for a single conditional statement:

fs/ocfs2/dlm/dlmthread.c:534:18: warning: equality comparison with extraneous

      parentheses [-Wparentheses-equality]
        if ((res->owner == dlm->node_num)) {
             ~~~~~~~~~~~^~~~~~~~~~~~~~~~

fs/ocfs2/dlm/dlmthread.c:534:18: note: remove extraneous parentheses around the
comparison to silence this warning
if ((res->owner == dlm->node_num)) {
~ ^ ~

---
 fs/ocfs2/dlm/dlmthread.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
fs/ocfs2/dlm/dlmthread.c +1 -1
index 838a06d4066a..074d5de17bb2 100644
@@ -531,7 +531,7 @@ void __dlm_dirty_lockres(struct dlm_ctxt *dlm, struct dlm_lock_resource *res)
 	assert_spin_locked(&res->spinlock);
 
 	/* don't shuffle secondary queues */
-	if ((res->owner == dlm->node_num)) {
+	if (res->owner == dlm->node_num) {
 		if (res->state & (DLM_LOCK_RES_MIGRATING |
 				  DLM_LOCK_RES_BLOCK_DIRTY))
 		    return;
Signature · 1 line
2.19.0