From patchwork Fri Oct 13 07:39:32 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: KaiLong Wang X-Patchwork-Id: 152358 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:2908:b0:403:3b70:6f57 with SMTP id ib8csp1722662vqb; Fri, 13 Oct 2023 00:41:44 -0700 (PDT) X-Google-Smtp-Source: AGHT+IH99OMS51oBeyqGI9xa6qU1gps6ivEQ2Egh8WDGAje5viYDBYHol7wyeAqZGshUHt6fdLGs X-Received: by 2002:a17:902:da87:b0:1c6:2902:24f9 with SMTP id j7-20020a170902da8700b001c6290224f9mr29737347plx.1.1697182904413; Fri, 13 Oct 2023 00:41:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697182904; cv=none; d=google.com; s=arc-20160816; b=bVMVY7LtLLWX7I0gwvBkFdrZ5CG0Ryf2QtncVI8uTB2Nm6AcrSzF4L2UDz4uX0yiB1 R42F09zVjNI8narqaMCmIHi2pS1YWLpzrTLQMZJbk+EyAnzw3oU6lXPrsSG0oENqUcSi P3Gs5KEKvOS47ZbGk+tSVCoiczBa9UbGXnMU5V7qb3vWNSpqsIbBsAsBSYTDYw8JcmhE H+c0DNuOCI7UXPEPARVwh4DzrHc7kS4+mnH3obhggR+X6NC6KwOvXtJ4kk0a2YJSaV/J XltAEOk5t+xZNqGGjM7LSmYFxLUTPMA88a+t1ivukswI2Ih+lbRasKMrJQdxveOsqtnT gTbw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:message-id:mime-version :content-transfer-encoding:subject:cc:to:from:date; bh=1bGQT9O7DKjq+nruYxlXLF+prYSJ1/TxUa00gv00SkU=; fh=rLt+2nbm/xVfBVN4+4iEfWF8IqTi6wGQAa3OIw/WOio=; b=QsHv91IlbjksUZMr/AGfwwXpK5Fbumu8oHmGJrkKe7UTZa0LbxbAdM63erLoBh+A4v IKmjbx4MFHvoUobzLwA210Wv1mV/RUB5H2BsdwORp80aTXRLCKmKFgXwdWWHb4Qc6LcU iPvxXCoaSEBgYpel/LCkYz5917CEvkyCbmAjtMKcaCbhAXWWbUwJJT97yzdOOKLUVRbn XB1aplcxV7Jbvuh3jzyGP7ss/tS730Qg5bvqhpfRstuTNwlrPg83d4blyff49QUYwQ9T yJLMdr2swQKBpPNTChu4Uwlyq/kvBdbBa6512SJuxEIJ24l1IBauE9/x50tvggP1vg5e cTQA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from morse.vger.email (morse.vger.email. [23.128.96.31]) by mx.google.com with ESMTPS id d2-20020a170903230200b001c62bbdde51si4292929plh.479.2023.10.13.00.41.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Oct 2023 00:41:44 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) client-ip=23.128.96.31; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by morse.vger.email (Postfix) with ESMTP id 0AD218032102; Fri, 13 Oct 2023 00:41:42 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at morse.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229938AbjJMHl0 (ORCPT + 19 others); Fri, 13 Oct 2023 03:41:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52736 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229688AbjJMHlX (ORCPT ); Fri, 13 Oct 2023 03:41:23 -0400 Received: from jari.cn (unknown [218.92.28.115]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 12EB783 for ; Fri, 13 Oct 2023 00:41:19 -0700 (PDT) Received: from wangkailong$jari.cn ( [182.148.14.172] ) by ajax-webmail-localhost.localdomain (Coremail) ; Fri, 13 Oct 2023 15:39:32 +0800 (GMT+08:00) X-Originating-IP: [182.148.14.172] Date: Fri, 13 Oct 2023 15:39:32 +0800 (GMT+08:00) X-CM-HeaderCharset: UTF-8 From: "KaiLong Wang" To: mark@fasheh.com, jlbec@evilplan.org, akpm@linux-foundation.org Cc: ocfs2-devel@lists.linux.dev, linux-kernel@vger.kernel.org Subject: [PATCH] ocfs2/dlm: Clean up errors in dlmdomain.c X-Priority: 3 X-Mailer: Coremail Webmail Server Version 2023.1-cmXT6 build 20230419(ff23bf83) Copyright (c) 2002-2023 www.mailtech.cn mispb-4e503810-ca60-4ec8-a188-7102c18937cf-zhkzyfz.cn MIME-Version: 1.0 Message-ID: <62e91e34.969.18b27f9ec40.Coremail.wangkailong@jari.cn> X-Coremail-Locale: zh_CN X-CM-TRANSID: AQAAfwD3lD809ChlLd_BAA--.756W X-CM-SenderInfo: 5zdqwypdlo00nj6mt2flof0/1tbiAQADB2UnvzMAKwACsi X-Coremail-Antispam: 1Ur529EdanIXcx71UUUUU7IcSsGvfJ3iIAIbVAYjsxI4VWxJw CS07vEb4IE77IF4wCS07vE1I0E4x80FVAKz4kxMIAIbVAFxVCaYxvI4VCIwcAKzIAtYxBI daVFxhVjvjDU= X-Spam-Status: No, score=-0.8 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on morse.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (morse.vger.email [0.0.0.0]); Fri, 13 Oct 2023 00:41:42 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1779625261095225293 X-GMAIL-MSGID: 1779625261095225293 Fix the following errors reported by checkpatch: ERROR: "foo * bar" should be "foo *bar" ERROR: spaces required around that '=' (ctx:VxV) ERROR: spaces required around that '==' (ctx:VxV) ERROR: do not use assignment in if condition Signed-off-by: KaiLong Wang --- fs/ocfs2/dlm/dlmdomain.c | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/fs/ocfs2/dlm/dlmdomain.c b/fs/ocfs2/dlm/dlmdomain.c index 5c04dde99981..a9955eb97625 100644 --- a/fs/ocfs2/dlm/dlmdomain.c +++ b/fs/ocfs2/dlm/dlmdomain.c @@ -76,7 +76,8 @@ static void **dlm_alloc_pagevec(int pages) return NULL; for (i = 0; i < pages; i++) - if (!(vec[i] = (void *)__get_free_page(GFP_KERNEL))) + vec[i] = (void *)__get_free_page(GFP_KERNEL); + if (!(vec[i])) goto out_free; mlog(0, "Allocated DLM hash pagevec; %d pages (%lu expected), %lu buckets per page\n", @@ -170,7 +171,7 @@ void __dlm_insert_lockres(struct dlm_ctxt *dlm, struct dlm_lock_resource *res) res->lockname.name); } -struct dlm_lock_resource * __dlm_lookup_lockres_full(struct dlm_ctxt *dlm, +struct dlm_lock_resource *__dlm_lookup_lockres_full(struct dlm_ctxt *dlm, const char *name, unsigned int len, unsigned int hash) @@ -203,7 +204,7 @@ struct dlm_lock_resource * __dlm_lookup_lockres_full(struct dlm_ctxt *dlm, * currently in the process of dropping its mastery reference. * use __dlm_lookup_lockres_full when you need the lock resource * regardless (e.g. dlm_get_lock_resource) */ -struct dlm_lock_resource * __dlm_lookup_lockres(struct dlm_ctxt *dlm, +struct dlm_lock_resource *__dlm_lookup_lockres(struct dlm_ctxt *dlm, const char *name, unsigned int len, unsigned int hash) @@ -228,7 +229,7 @@ struct dlm_lock_resource * __dlm_lookup_lockres(struct dlm_ctxt *dlm, return res; } -struct dlm_lock_resource * dlm_lookup_lockres(struct dlm_ctxt *dlm, +struct dlm_lock_resource *dlm_lookup_lockres(struct dlm_ctxt *dlm, const char *name, unsigned int len) { @@ -241,7 +242,7 @@ struct dlm_lock_resource * dlm_lookup_lockres(struct dlm_ctxt *dlm, return res; } -static struct dlm_ctxt * __dlm_lookup_domain_full(const char *domain, int len) +static struct dlm_ctxt *__dlm_lookup_domain_full(const char *domain, int len) { struct dlm_ctxt *tmp; @@ -251,7 +252,7 @@ static struct dlm_ctxt * __dlm_lookup_domain_full(const char *domain, int len) * but domain may not be! */ list_for_each_entry(tmp, &dlm_domains, list) { if (strlen(tmp->name) == len && - memcmp(tmp->name, domain, len)==0) + memcmp(tmp->name, domain, len) == 0) return tmp; } @@ -259,7 +260,7 @@ static struct dlm_ctxt * __dlm_lookup_domain_full(const char *domain, int len) } /* For null terminated domain strings ONLY */ -static struct dlm_ctxt * __dlm_lookup_domain(const char *domain) +static struct dlm_ctxt *__dlm_lookup_domain(const char *domain) { assert_spin_locked(&dlm_domain_lock); @@ -827,7 +828,7 @@ static int dlm_query_join_handler(struct o2net_msg *msg, u32 len, void *data, * node(s) that just left but still part of the cluster. DISALLOW * join request if joining node has different node map. */ - nodenum=0; + nodenum = 0; while (nodenum < O2NM_MAX_NODES) { if (test_bit(nodenum, dlm->domain_map)) { if (!byte_test_bit(nodenum, query->node_map)) { @@ -2095,7 +2096,7 @@ static int dlm_protocol_compare(struct dlm_protocol_version *existing, * If registration was successful, proto will contain the negotiated * locking protocol. */ -struct dlm_ctxt * dlm_register_domain(const char *domain, +struct dlm_ctxt *dlm_register_domain(const char *domain, u32 key, struct dlm_protocol_version *fs_proto) {