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=-6.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS autolearn=no 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 7B23EC388F9 for ; Sun, 8 Nov 2020 20:59:05 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 3AB5A206D4 for ; Sun, 8 Nov 2020 20:59:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728834AbgKHU67 (ORCPT ); Sun, 8 Nov 2020 15:58:59 -0500 Received: from smtprelay0088.hostedemail.com ([216.40.44.88]:39838 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727570AbgKHU67 (ORCPT ); Sun, 8 Nov 2020 15:58:59 -0500 Received: from filter.hostedemail.com (clb03-v110.bra.tucows.net [216.40.38.60]) by smtprelay05.hostedemail.com (Postfix) with ESMTP id 339BD18029121; Sun, 8 Nov 2020 20:58:58 +0000 (UTC) X-Session-Marker: 6A6F6540706572636865732E636F6D X-HE-Tag: bait61_5108df2272e6 X-Filterd-Recvd-Size: 1901 Received: from XPS-9350.home (unknown [47.151.133.149]) (Authenticated sender: joe@perches.com) by omf08.hostedemail.com (Postfix) with ESMTPA; Sun, 8 Nov 2020 20:58:56 +0000 (UTC) Message-ID: <2b8fb8823fe73f28ef77bbdd78c9c8b2105e3077.camel@perches.com> Subject: Re: [PATCH] s390/qeth: remove useless if/else From: Joe Perches To: xiakaixu1987@gmail.com, hca@linux.ibm.com, gor@linux.ibm.com, borntraeger@de.ibm.com Cc: linux-s390@vger.kernel.org, linux-kernel@vger.kernel.org, Kaixu Xia Date: Sun, 08 Nov 2020 12:58:55 -0800 In-Reply-To: <1604817287-11258-1-git-send-email-kaixuxia@tencent.com> References: <1604817287-11258-1-git-send-email-kaixuxia@tencent.com> Content-Type: text/plain; charset="ISO-8859-1" User-Agent: Evolution 3.38.1-1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, 2020-11-08 at 14:34 +0800, xiakaixu1987@gmail.com wrote: > From: Kaixu Xia > > Fix the following coccinelle report: > > ./drivers/s390/net/qeth_l3_main.c:107:2-4: WARNING: possible condition with no effect (if == else) > > Both branches are the same, so remove them. [] > diff --git a/drivers/s390/net/qeth_l3_main.c b/drivers/s390/net/qeth_l3_main.c [] > @@ -104,10 +104,7 @@ static bool qeth_l3_is_addr_covered_by_ipato(struct qeth_card *card, >   qeth_l3_convert_addr_to_bits(ipatoe->addr, ipatoe_bits, >   (ipatoe->proto == QETH_PROT_IPV4) ? >   4 : 16); > - if (addr->proto == QETH_PROT_IPV4) > - rc = !memcmp(addr_bits, ipatoe_bits, ipatoe->mask_bits); > - else > - rc = !memcmp(addr_bits, ipatoe_bits, ipatoe->mask_bits); > + rc = !memcmp(addr_bits, ipatoe_bits, ipatoe->mask_bits); It's not always best to remove one branch. Is this a copy/paste defect or is it useless? Do you know which? If you do, you should state this in the commit message.