Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp436282ybz; Wed, 22 Apr 2020 00:55:36 -0700 (PDT) X-Google-Smtp-Source: APiQypLDSsgdiTD/1pP9ys6M++Dwfd8/jw4WqJ2z1KEZe20qznCh5VdF62YT+omeeAue2Svp++HN X-Received: by 2002:aa7:c453:: with SMTP id n19mr22048111edr.218.1587542136473; Wed, 22 Apr 2020 00:55:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1587542136; cv=none; d=google.com; s=arc-20160816; b=yBB2fbMHayKBJo7JEPUJ8WASGduhswS8qbnsrgT10JG4XbnZaTbZLNPrS6to59NJ3N s7xtDM/ZVsqO7ob2PGuYFtZ8Ri+vayRSSFGvCmCe46o39adp3+qInLFp81pEGWsqZz3l 3z/w1S/Sng5YWh3MIgI//tugZoCgnJcmQ0LDmmYdizMQtxBHNLNFBwbw7ILNW9ym4IYv Q3s4UwPtfIDrqWHwLvTweuHRXFHn2z0qQzwz7v8t8doui0c4pR8v/obsj87xqU5+69Wj lk+u4TiRIPsMBgZi1kGjz89MstAnQdh7aZiYjfxQpIixbYkYCcs4eWmhivVcvXoY3pS0 cBAA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=NVmVMdo+ZMkh7kpy8Xn9alW+UOrjmpe0Vx3EOKT8pCA=; b=DieWFx1xaf3Cg4t09sywkaOUNYYFm6Eq1QZiBl1e2usKSj8xYo8IVFKY3BEYKAAxtO 5vl5bCuc0wcywfc5ODUvPxVFUylFkzK0CLFMPsUpu1CRtiKdFIxL2XXecdCasyIpMOv1 3DCGkZOJg7lK7iM4ajp7Z+NikyYrcgeZZsCfey6Q5J9J4B1otQyZWQHAAo/a/TJp7ybo h5JDHSOq1gjkmsFmeoVeZ3f1ebNxvP8miHzW/4uhOp/uYbaCVpTK3KMn4w6q+Vo7kj+E HPt+ZyRw5iJSzO0KlwA+ezeCwjs1YPJd6ZJV/x4FHLd8vDQZdyK7JI1bAoHrcKDysySi kUAA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id m7si714662edv.557.2020.04.22.00.55.13; Wed, 22 Apr 2020 00:55:36 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726495AbgDVHwJ (ORCPT + 99 others); Wed, 22 Apr 2020 03:52:09 -0400 Received: from out30-133.freemail.mail.aliyun.com ([115.124.30.133]:37629 "EHLO out30-133.freemail.mail.aliyun.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726154AbgDVHwI (ORCPT ); Wed, 22 Apr 2020 03:52:08 -0400 X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R511e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=e01e01355;MF=joseph.qi@linux.alibaba.com;NM=1;PH=DS;RN=7;SR=0;TI=SMTPD_---0TwIs7uZ_1587541925; Received: from JosephdeMacBook-Pro.local(mailfrom:joseph.qi@linux.alibaba.com fp:SMTPD_---0TwIs7uZ_1587541925) by smtp.aliyun-inc.com(127.0.0.1); Wed, 22 Apr 2020 15:52:05 +0800 Subject: Re: [PATCH] fs:ocfs2:remove unneeded variable 'o2dlm_flags' To: Wu Bo , mark@fasheh.com, jlbec@evilplan.org Cc: linux-kernel@vger.kernel.org, ocfs2-devel@oss.oracle.com, liuzhiqiang26@huawei.com, linfeilong@huawei.com References: <1587539521-461177-1-git-send-email-wubo40@huawei.com> From: Joseph Qi Message-ID: <7214599d-3bd2-96b7-59f9-d731bb27f744@linux.alibaba.com> Date: Wed, 22 Apr 2020 15:52:05 +0800 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.13; rv:68.0) Gecko/20100101 Thunderbird/68.7.0 MIME-Version: 1.0 In-Reply-To: <1587539521-461177-1-git-send-email-wubo40@huawei.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2020/4/22 15:12, Wu Bo wrote: > Fix the following coccicheck warning: > fs/ocfs2/stack_o2cb.c:69:5-16: Unneeded variable: "o2dlm_flags". > Return "0" on line 84 > Umm... This is not right, NAK. Something tricky is in map_flag() so that coccicheck doesn't recognize. Thanks, Joseph > Signed-off-by: Wu Bo > --- > fs/ocfs2/stack_o2cb.c | 4 +--- > 1 file changed, 1 insertion(+), 3 deletions(-) > > diff --git a/fs/ocfs2/stack_o2cb.c b/fs/ocfs2/stack_o2cb.c > index dbf8b57..2da9633 100644 > --- a/fs/ocfs2/stack_o2cb.c > +++ b/fs/ocfs2/stack_o2cb.c > @@ -66,8 +66,6 @@ static inline int mode_to_o2dlm(int mode) > } > static int flags_to_o2dlm(u32 flags) > { > - int o2dlm_flags = 0; > - > map_flag(DLM_LKF_NOQUEUE, LKM_NOQUEUE); > map_flag(DLM_LKF_CANCEL, LKM_CANCEL); > map_flag(DLM_LKF_CONVERT, LKM_CONVERT); > @@ -81,7 +79,7 @@ static int flags_to_o2dlm(u32 flags) > /* map_flag() should have cleared every flag passed in */ > BUG_ON(flags != 0); > > - return o2dlm_flags; > + return 0; > } > #undef map_flag > >