From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6FDF6C433E0 for ; Tue, 5 Jan 2021 23:59:20 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 416252071A for ; Tue, 5 Jan 2021 23:59:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726908AbhAEX6s (ORCPT ); Tue, 5 Jan 2021 18:58:48 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33404 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726722AbhAEX6s (ORCPT ); Tue, 5 Jan 2021 18:58:48 -0500 Received: from mail.monkeyblade.net (shards.monkeyblade.net [IPv6:2620:137:e000::1:9]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5ABE6C061793; Tue, 5 Jan 2021 15:58:08 -0800 (PST) Received: from localhost (unknown [IPv6:2601:601:9f00:477::3d5]) by mail.monkeyblade.net (Postfix) with ESMTPSA id D5CF64CE685B7; Tue, 5 Jan 2021 15:58:06 -0800 (PST) Date: Tue, 05 Jan 2021 15:58:06 -0800 (PST) Message-Id: <20210105.155806.1768484944984996325.davem@davemloft.net> To: abaci-bugfix@linux.alibaba.com Cc: kuba@kernel.org, dchickles@marvell.com, sburla@marvell.com, fmanlunas@marvell.com, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] liquidio: style: Identical condition and return expression 'retval', return value is always 0. From: David Miller In-Reply-To: <1609308450-50695-1-git-send-email-abaci-bugfix@linux.alibaba.com> References: <1609308450-50695-1-git-send-email-abaci-bugfix@linux.alibaba.com> X-Mailer: Mew version 6.8 on Emacs 27.1 Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.6.2 (mail.monkeyblade.net [0.0.0.0]); Tue, 05 Jan 2021 15:58:07 -0800 (PST) Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: YANG LI Date: Wed, 30 Dec 2020 14:07:30 +0800 > The warning was because of the following line in function > liquidio_set_fec(): > > retval = wait_for_sc_completion_timeout(oct, sc, 0); > if (retval) > return (-EIO); > > If this statement is not true, retval must be 0 and not updated > later. So, It is better to return 0 directly. > > Signed-off-by: YANG LI > Reported-by: Abaci Maybe you can remove the rest of the 'retval' usage in this function and even the variable itself? Thanks.