Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp442824ybz; Wed, 22 Apr 2020 01:05:00 -0700 (PDT) X-Google-Smtp-Source: APiQypLhqxnIl213TjvxZH2o57BW0V2P/Kqb1mpXp9Vlk2wdolDeNGY8p2RtvxQuTyuGFexsH0t5 X-Received: by 2002:a05:6402:1008:: with SMTP id c8mr21380483edu.242.1587542700801; Wed, 22 Apr 2020 01:05:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1587542700; cv=none; d=google.com; s=arc-20160816; b=zjMzft0KXUf071sJP3qjgAHk6KIQWlj0PRzeL4mzXqRDGMIklKr4JyxDnb1jQhQMQq ZQGhOCr4rJtwhtUOEX3ETvv1cFuATQr+JUdPOcCG3xVIa+sfu9pccx8c49mwAOxsks0i PdcMCRetEVn/nCYT6GSd3tj2Xm8CbkrumDoOD774wlSKK1Vumy6EkDvXAia+iHjjyk0L K5C5yChoVnJ4tydTNVMquS2zKBlN+j5C2N0mjYe/gFsXlKHTBdFxDweXgNZv2yUAb9ZI inUfp/6pxzm3+cj7sybCekL/85IHLhPCxfEUpF0Nq+eq9pLWhcXGfjeoifBvHGV2WywB Zfbw== 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=/dPBUtttuJLRFUvHwhbd0LD8i3o5w8/wUMSebzIjWVo=; b=iM2S8wC7c801MykahVaLK4kyJVN0NX4A1+qzDAqDwLyvrLcAYkVSHL7XCze5BEsqX7 KNc4D9gs1+uO5dX7qKyfVIM4afjG+WDRTFFgL5uu0N4GviN9uzEA7z4PyoklaJDUsmpA 3gH5W8gFvIz1m1Zii/oma/7tL7kdeUUA23Ycov0Km5YbHB/Imvx4ncbhd0uHYKn8g/Ey YJVyZIScScDVwmqq3jN+PYPgR1U7IEKoL+UvVjRc0PjYbicO4RiL3noNbn2wvj8RDJ1D be3i3jRZXV7WIxcYDVqFs0xX9CXsTKGBF8Ov74sEuqvs5oZYQiEiiIdnVD3BOgDSjGlh UpVQ== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id oo21si2890015ejb.453.2020.04.22.01.04.29; Wed, 22 Apr 2020 01:05:00 -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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726389AbgDVIAD (ORCPT + 99 others); Wed, 22 Apr 2020 04:00:03 -0400 Received: from szxga06-in.huawei.com ([45.249.212.32]:51722 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726321AbgDVIAD (ORCPT ); Wed, 22 Apr 2020 04:00:03 -0400 Received: from DGGEMS404-HUB.china.huawei.com (unknown [172.30.72.60]) by Forcepoint Email with ESMTP id 7467612D12D69904D6A9; Wed, 22 Apr 2020 15:59:58 +0800 (CST) Received: from [127.0.0.1] (10.166.215.100) by DGGEMS404-HUB.china.huawei.com (10.3.19.204) with Microsoft SMTP Server id 14.3.487.0; Wed, 22 Apr 2020 15:59:50 +0800 Subject: Re: [PATCH] fs:ocfs2:remove unneeded variable 'o2dlm_flags' To: Joseph Qi , , CC: , , , References: <1587539521-461177-1-git-send-email-wubo40@huawei.com> <7214599d-3bd2-96b7-59f9-d731bb27f744@linux.alibaba.com> From: Wu Bo Message-ID: <9bf0798a-7dd5-4328-68f5-8bc2cd2ffa99@huawei.com> Date: Wed, 22 Apr 2020 15:59:49 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.6.0 MIME-Version: 1.0 In-Reply-To: <7214599d-3bd2-96b7-59f9-d731bb27f744@linux.alibaba.com> Content-Type: text/plain; charset="utf-8"; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Originating-IP: [10.166.215.100] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2020/4/22 15:52, Joseph Qi wrote: > > > 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 You are right. Did not notice that map_flag is a macro, Please ignore this patch. Thanks, Wu Bo > >> 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 >> >> > > . >