Received: by 2002:a05:6358:489b:b0:bb:da1:e618 with SMTP id x27csp8450271rwn; Wed, 14 Sep 2022 14:47:51 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7j0gYynpvxwuvOpyrHMLeX11Qf/zr2IfMSWaUmkbMSgvUHuqhNposVwXVEwQ0MjU4yFtNY X-Received: by 2002:a17:902:904b:b0:172:cd04:a3d3 with SMTP id w11-20020a170902904b00b00172cd04a3d3mr1027858plz.173.1663192071076; Wed, 14 Sep 2022 14:47:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1663192071; cv=none; d=google.com; s=arc-20160816; b=DAhC5nQtMMy1Y7oYeV9/FUenHPFQPc86RXjYjG2aPsRAXNIHD6KxChLmSQEYl+bxba knjTg7vjcvPvwvL4yCuEB/2gvGgqRd9J5xP1U3mOythes3RSZq7UFO5k97WqyZfasLrk yp9MHZuJXKFgvL9mDXmZa1e74FylhQLAFHDg9bUPXQkuquxtKI5L6e3iGv9xUcrd0ZFu p9KNT/bIJIHnquUYIoVHfpMx2faGNqnB0L0ENxYQsskyXIbbdGxL9fGvyx5+XfSw4BKy Y7x6WsKBolgCjGyL6Fuic0h3dVmV9tsys9mtzQ4lTQwSDboFFzPWGBzLsjKrmYy7sEtd EYNg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:from:subject:message-id:references :mime-version:in-reply-to:date:dkim-signature; bh=1qTbf9AeneJ+E0vsQj505sbaD/8VFWq9P44uV39tt6g=; b=RJeECn4x5Sm5/jfSX9yBOzG8I1tv6p+FoXNnd1xILQ/yHjjd2MMSKYUW9WzyqpsD9+ 65Blbk73FFesTBhG6AMrtX6IQElgOFIbHt9G1Xc8fQCbkrExz3HbKN1adm4n0GKwXUvr VCW5umqH5tCcTsTJ4Pp2enqt5HGTWQx8TUJccmrcMjYScXvmmBsRo1vq2dxi0oEKO/5S +cvLHiJTuuGhhzClQsVY4aAZYhpGLOFVx16KSwf02LbbMbWfV2scz5QZhxUiKCIoGdBc tYfE0H6xbH/wwD6BavCVsu/Cqw8MWxV1Gxzy8zAN/c6P75zcdHt3EpmKv60/9MWiK8lf pnTA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=NaoShQX0; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id cp8-20020a056a00348800b0053f6f9b00b7si3112782pfb.81.2022.09.14.14.47.18; Wed, 14 Sep 2022 14:47:51 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=NaoShQX0; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229777AbiINVQl (ORCPT + 99 others); Wed, 14 Sep 2022 17:16:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41522 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229847AbiINVQX (ORCPT ); Wed, 14 Sep 2022 17:16:23 -0400 Received: from mail-yb1-xb49.google.com (mail-yb1-xb49.google.com [IPv6:2607:f8b0:4864:20::b49]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9C91086B45 for ; Wed, 14 Sep 2022 14:16:12 -0700 (PDT) Received: by mail-yb1-xb49.google.com with SMTP id x5-20020a056902102500b006af1376b813so9275085ybt.16 for ; Wed, 14 Sep 2022 14:16:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:from:to:cc:subject:date; bh=1qTbf9AeneJ+E0vsQj505sbaD/8VFWq9P44uV39tt6g=; b=NaoShQX0xB6ZSD3s/l2l8lUJHV8OlhoUIRJXBx9XMzxO4ISYASBDDL+6bgaKRwxwGa f0dKG1vN81GPaYIKzGTRwdvFnlg5Km7/n4zRahhCho5X3top90R1dU5MZW6Un6ipWHM6 yPTWv97B07QcOxRYuD26rtbqzGKOGjOpUYchjTCoQOY5zRGGVYsC0ElnKF9W+Y//wTda eJcrs9jpvWVgK0EoHh0DjjUFjav87D7emCFvhb/qMorPp5CYB2HG4saqeQGxIAGjoqaj wacEa68UMGcSfzwqlpDYx1CAE7j3D3HnwVqG9s0wfTS2LsqvzXjeaPZntWOJ6cKkg6cM 4MpQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:x-gm-message-state:from:to:cc:subject:date; bh=1qTbf9AeneJ+E0vsQj505sbaD/8VFWq9P44uV39tt6g=; b=KhN5FfRRwWPf87fsuB3nAEq6HAo0kbJA6mOW47A2jDn5P0HPR2Fi8MjmxOav2DrUoF mVxzM6VhKig8v948pnh6pcgF4PFS2AtOz45pYd5rzAfTsHeqv2A04qelJw5RRfNt7sNn 6ZuQc7ncM4tgx+X94Z4ardn2xKtKMf0pFm3mWogw9bxlTxFIN0RdGRr/97a+RyxOg717 lmqly0alDntJ0dEfgj/AUfDqGrdQC9VBot4QOIzgqTRO3hcqIo+F7ENPe5N+0ZWikS84 xkaWKcU+O954HZPIdZwV2aP2AJ+Or7PHXgSlpafCkNX4OupK5N/h+eyweNGAep+fM291 Ou+A== X-Gm-Message-State: ACgBeo0DENRjfiiReFZSpqPHdbkdif20l8h/O06J9jv3v0xbhz3xgPko zIfEC/Kp1SCDWJLiR92aUOS3VKZ5lg== X-Received: from nhuck.c.googlers.com ([fda3:e722:ac3:cc00:14:4d90:c0a8:39cc]) (user=nhuck job=sendgmr) by 2002:a05:6902:150d:b0:6ad:2399:eaa7 with SMTP id q13-20020a056902150d00b006ad2399eaa7mr32621218ybu.413.1663190171406; Wed, 14 Sep 2022 14:16:11 -0700 (PDT) Date: Wed, 14 Sep 2022 14:16:06 -0700 In-Reply-To: Mime-Version: 1.0 References: X-Mailer: git-send-email 2.37.2.789.g6183377224-goog Message-ID: <20220914211606.423959-1-nhuck@google.com> Subject: [PATCH v3] staging: r8188eu: Fix return type of rtw_xmit_entry From: Nathan Huckleberry To: nathan@kernel.org Cc: Larry.Finger@lwfinger.net, error27@gmail.com, gregkh@linuxfoundation.org, insafonov@gmail.com, linux-kernel@vger.kernel.org, linux-staging@lists.linux.dev, llvm@lists.linux.dev, makvihas@gmail.com, namcaov@gmail.com, ndesaulniers@google.com, nhuck@google.com, paskripkin@gmail.com, phil@philpotter.co.uk, saurav.girepunje@gmail.com, trix@redhat.com Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-9.6 required=5.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE,USER_IN_DEF_DKIM_WL autolearn=ham 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 ndo_start_xmit field in net_device_ops is expected to be of type netdev_tx_t (*ndo_start_xmit)(struct sk_buff *skb, struct net_device *dev). The mismatched return type breaks forward edge kCFI since the underlying function definition does not match the function hook definition. The return type of rtw_xmit_entry should be changed from int to netdev_tx_t. Reported-by: Dan Carpenter Link: https://github.com/ClangBuiltLinux/linux/issues/1703 Cc: llvm@lists.linux.dev Signed-off-by: Nathan Huckleberry Reviewed-by: Nathan Chancellor --- Changes v1 -> v2: - Rebased onto linux-next/master Changes v2 -> v3: - Updated header file - Add reviewed-by tag drivers/staging/r8188eu/core/rtw_xmit.c | 4 ++-- drivers/staging/r8188eu/include/rtw_xmit.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/staging/r8188eu/core/rtw_xmit.c b/drivers/staging/r8188eu/core/rtw_xmit.c index 98864fc55b25..ea13f11b231b 100644 --- a/drivers/staging/r8188eu/core/rtw_xmit.c +++ b/drivers/staging/r8188eu/core/rtw_xmit.c @@ -2289,7 +2289,7 @@ static int rtw_mlcst2unicst(struct adapter *padapter, struct sk_buff *skb) return true; } -int rtw_xmit_entry(struct sk_buff *pkt, struct net_device *pnetdev) +netdev_tx_t rtw_xmit_entry(struct sk_buff *pkt, struct net_device *pnetdev) { struct adapter *padapter = (struct adapter *)rtw_netdev_priv(pnetdev); struct xmit_priv *pxmitpriv = &padapter->xmitpriv; @@ -2323,5 +2323,5 @@ int rtw_xmit_entry(struct sk_buff *pkt, struct net_device *pnetdev) dev_kfree_skb_any(pkt); exit: - return 0; + return NETDEV_TX_OK; } diff --git a/drivers/staging/r8188eu/include/rtw_xmit.h b/drivers/staging/r8188eu/include/rtw_xmit.h index 8f54c41ba927..82efcd54af3f 100644 --- a/drivers/staging/r8188eu/include/rtw_xmit.h +++ b/drivers/staging/r8188eu/include/rtw_xmit.h @@ -368,6 +368,6 @@ int rtw_ack_tx_wait(struct xmit_priv *pxmitpriv, u32 timeout_ms); void rtw_ack_tx_done(struct xmit_priv *pxmitpriv, int status); void rtw_xmit_complete(struct adapter *padapter, struct xmit_frame *pxframe); -int rtw_xmit_entry(struct sk_buff *pkt, struct net_device *pnetdev); +netdev_tx_t rtw_xmit_entry(struct sk_buff *pkt, struct net_device *pnetdev); #endif /* _RTL871X_XMIT_H_ */ -- 2.37.2.789.g6183377224-goog