Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp4692995iob; Sun, 8 May 2022 22:13:35 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwx7ORDgiRQCCziIEP3vbHEiG5b+aR+yaPP/aNRPqUFNYwWNAGvKd3F3okr+HZiZzz/Aofv X-Received: by 2002:a63:6e0b:0:b0:397:f965:64a7 with SMTP id j11-20020a636e0b000000b00397f96564a7mr11734804pgc.581.1652073215501; Sun, 08 May 2022 22:13:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1652073215; cv=none; d=google.com; s=arc-20160816; b=lrn2RnptY+ySN59w5lZJOM+4h8vUIhLXZ3WchpElXsngc1l62Lg+/tYW7+f924aqCu ybnEI0odxreMb7ETqCHkXANTMM+/Rnx1ExsAi6E5jpvfdOz/fS0U+colkGfv/OTgG0A2 ECx1p0Qb/oa+SfbL/90el1JjtQb8FL1mAxaQ+iCpBhEE3f56VhuyNlE94rpA+/eRLfXR mOvNrjVUv4yw4RTnPGU5e2BaLD6asT3zhf0IWvB6X5hKhV8jgEq+S1jgqrs/qwKAV3mb 5HzJp3d29SvcRlwZsekav5Uie3W2mqafb5NS1IkTzHgVocr3EjuRGJV+AgQAEoItVO6p tlsg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=yGEwWPgAOFv3suN6nm6KEA8gpXdmMPjJNcqn8/i8d/I=; b=I/07v14QIoxcXHl2H3gFmg9Iz3gebrNAt701X4vt3JGx2/Dg5iTZ4c0zA1kYVPf1mJ FF65loyjtjwRx86ja6mF9Ge4aF63BSBOKpBVKVAJNfvFjpi3UeGdArILctY2EZw+GhEg pUsPthwYsd1tank2mJgH9Hyv//rCst/k4uxYD6WUmWXO2B36i+gi928WtYT+rwSbLgqq Lel8rKwO8fMQD1EbXwsusJQWTL3VZxrD6hewhKXqec/iLvzgvxRfuCgJ+dcKseJn6KMH meDay0CRqPg8eFFuPbT6QfQslG54FMgj8Fi5aNI2YX1rq0wD7P8sKiyudi31+G8qN8SK 7ezw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=kPql0bm+; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id v62-20020a638941000000b003c61ecf51c6si13105542pgd.495.2022.05.08.22.13.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 08 May 2022 22:13:35 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=kPql0bm+; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 5092550031; Sun, 8 May 2022 22:10:06 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236478AbiEHTIr (ORCPT + 99 others); Sun, 8 May 2022 15:08:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47816 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1353322AbiEHS2x (ORCPT ); Sun, 8 May 2022 14:28:53 -0400 Received: from mail-pg1-x535.google.com (mail-pg1-x535.google.com [IPv6:2607:f8b0:4864:20::535]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C861EBC2D for ; Sun, 8 May 2022 11:25:02 -0700 (PDT) Received: by mail-pg1-x535.google.com with SMTP id r192so6081798pgr.6 for ; Sun, 08 May 2022 11:25:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=yGEwWPgAOFv3suN6nm6KEA8gpXdmMPjJNcqn8/i8d/I=; b=kPql0bm+gk1+YgYsHlo0ZyE8Zgdc39j/z7vVCXNE1Tc03WigZf+xdr6/JxyUs8LZnl cyXck4msvnCHexQIY2TfLFFQatrqP93c0yPw1G0hA0V5ceiWM5JPA+NFfgFYqGuRgqJv d8g/ec1hvcSlwOyrvIU1E/EixJ6e5Re75QFrMvMPAVUFJGWd4lacPRrFbMNjuvvMcE3D DyeGOCWehMG4c4V3HEU5GxC1wFA0b5oaAeC1s8USOGHNnYwNeQXj2oWWpuJRmSAZVGIm ZJDdjMeRzmJDTpaYYgppFI7LRlTXfmcZILyc+vMekb2pkTCiKE7FpK3aqeQhp4Lwqurz iOkA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=yGEwWPgAOFv3suN6nm6KEA8gpXdmMPjJNcqn8/i8d/I=; b=kqzMYZYrZ5yLd4jWtd+Dtb5vCRCYRU3xL1rqTMMdgYOMOW7OHV/0h66VLYrfCyjKdC /9vdYZdgoqRiyNOVvA10gEKBpYF3wubqtNRwMntRI485WWRQURLPc8cnYSsvSthQfq4m GFHJH3CoBOeKULMiMqimgY3nkRufIC8c9m1Muvgh0NGzTimv1lyTvQL469N1tu7CV5vJ RN5BAwiBy4GvSRa9atp8IfeENQgGDimpa2hUEaVkBucS24ZY30rmhGOFtE/2FN7a1HDi mWK1GfS78xE8o36xROGSJ8O3W4867NMukKvyszgcwEQqPai4jzE784bUnkc4/dHbrYGH SFHw== X-Gm-Message-State: AOAM533CWP0VdJgMJF2IAqPNFaffi/vO0D5zOCKYpozcIWDuk+innKHK ZBt6g4PpY+eFl3FVm5tfkSk= X-Received: by 2002:a05:6a00:181d:b0:50d:d56c:73d3 with SMTP id y29-20020a056a00181d00b0050dd56c73d3mr12613659pfa.22.1652034301383; Sun, 08 May 2022 11:25:01 -0700 (PDT) Received: from makvihas.localhost.com ([2405:201:202b:1:26d8:8642:a5dc:edc4]) by smtp.gmail.com with ESMTPSA id b187-20020a62cfc4000000b0050dc76281eesm6889258pfg.200.2022.05.08.11.24.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 08 May 2022 11:25:01 -0700 (PDT) From: Vihas Makwana To: Larry Finger , Phillip Potter , Greg Kroah-Hartman , Michael Straube Cc: linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org, Dan Carpenter , Pavel Skripkin , Vihas Makwana Subject: [PATCH] staging: r8188eu: drop redundant if check Date: Sun, 8 May 2022 23:54:01 +0530 Message-Id: <20220508182400.22433-1-makvihas@gmail.com> X-Mailer: git-send-email 2.30.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-0.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,NO_RDNS_DOTCOM_HELO, RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The check for ETH_P_IP is already performed in the outer if block and inner if check is redundant. So drop the check. Signed-off-by: Vihas Makwana --- drivers/staging/r8188eu/core/rtw_xmit.c | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/drivers/staging/r8188eu/core/rtw_xmit.c b/drivers/staging/r8188eu/core/rtw_xmit.c index d086812f8..9a99aa5e8 100644 --- a/drivers/staging/r8188eu/core/rtw_xmit.c +++ b/drivers/staging/r8188eu/core/rtw_xmit.c @@ -448,14 +448,12 @@ static s32 update_attrib(struct adapter *padapter, struct sk_buff *pkt, struct p _rtw_pktfile_read(&pktfile, &tmp[0], 24); pattrib->dhcp_pkt = 0; if (pktfile.pkt_len > 282) {/* MINIMUM_DHCP_PACKET_SIZE) { */ - if (ETH_P_IP == pattrib->ether_type) {/* IP header */ - if (((tmp[21] == 68) && (tmp[23] == 67)) || - ((tmp[21] == 67) && (tmp[23] == 68))) { - /* 68 : UDP BOOTP client */ - /* 67 : UDP BOOTP server */ - /* Use low rate to send DHCP packet. */ - pattrib->dhcp_pkt = 1; - } + if (((tmp[21] == 68) && (tmp[23] == 67)) || + ((tmp[21] == 67) && (tmp[23] == 68))) { + /* 68 : UDP BOOTP client */ + /* 67 : UDP BOOTP server */ + /* Use low rate to send DHCP packet. */ + pattrib->dhcp_pkt = 1; } } } -- 2.30.2