Received: by 2002:a05:6a10:6d10:0:0:0:0 with SMTP id gq16csp2617477pxb; Sun, 24 Apr 2022 21:06:46 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxRGZpRdt/FcBP/naAiyZwuARBJVdzBrz56m3VUD7XiDbM4SqNJOiDHk2L7xjR/kWc0lai5 X-Received: by 2002:a17:907:9805:b0:6db:4c33:7883 with SMTP id ji5-20020a170907980500b006db4c337883mr14943733ejc.555.1650859606327; Sun, 24 Apr 2022 21:06:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1650859606; cv=none; d=google.com; s=arc-20160816; b=if/enntUl72vm0hdDHbaJpWWPyP/1Wa7O1Xc3M2nAHPuaTlwK3obgl1bfZ93OSad44 qv0Bh3Cab4e6cLKA3N3VgTe5wfmK2+D40IauSJpZ46OdjndnR8FJjnbwPjv5JwCH6YKh 8OeDPjzD1drnm97Fzu1ty+MEXMp3FIXKnK+8zhavInN0pO77ENyoXGFgGZd96EjmK2RW raON+kx1jeMQ8d2+r8l1NaFoiVozWcRzQY/oRbgZ0grdAt8oDqzfiA1i2vVnSd1cHf9O AXy3f6zDc787+bBPduNu9IcspglG1fO04Dpl8uh8N71KTSKLkk/cATAspC0nrO/QXgxe wQTQ== 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=TraAa9qxjleDjcKSV6cdBET+ximOcYjIqFdHiJLXCNQ=; b=aOcm9IYeXBvC5Ehpv5k7jQOHvge8cE66Lkpe4TUJbBbqqPtiykPbqKiYwMLV5rEIxQ AkNgkJJnDfXK7hphVbs+J0Vx9H94mkUjzAIXYWD5WUF7zMZ+UrcJxv+ouyUMildWPmVR 1cBGajEn3sOB6p5Qq4/owyi6YWKBEZxwxoED2FwFmyvgcVJbnViz3BhMQ7BIcxj7DB8m oaOe9gKtoD4reGBlRW5iyCAmKyb9nNPplLcvE/3LRLTuRqZr3Bczt9eyR9GPo7ExV1Qz 6TGpC0SzZhqDZTQ/f/uh5JRLbueuwxsbFKFuNicEQdFqfBeiJHJ93UqVfD5Dltemj2nm Cqog== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=d42AiVW5; 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=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id j26-20020a50d01a000000b00420fff231a3si11849818edf.160.2022.04.24.21.06.22; Sun, 24 Apr 2022 21:06:46 -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=@gmail.com header.s=20210112 header.b=d42AiVW5; 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=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238959AbiDXOhw (ORCPT + 99 others); Sun, 24 Apr 2022 10:37:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39050 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239412AbiDXOho (ORCPT ); Sun, 24 Apr 2022 10:37:44 -0400 Received: from mail-pl1-x631.google.com (mail-pl1-x631.google.com [IPv6:2607:f8b0:4864:20::631]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AB54B338A9; Sun, 24 Apr 2022 07:34:43 -0700 (PDT) Received: by mail-pl1-x631.google.com with SMTP id n8so21552375plh.1; Sun, 24 Apr 2022 07:34:43 -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=TraAa9qxjleDjcKSV6cdBET+ximOcYjIqFdHiJLXCNQ=; b=d42AiVW50s9TABrjm13XKqTRuodcUHYC6ylnEacp7SaTKcZQ5YklbmqLVJEgRUkeZ+ OBeikygE/Ma1lpsB3lIymZrourtRKOLjmMvUstuwB7qev2+BQQryYsRE/f8imrv5NmBA 2+nJ/ZO2yvMVfPq8k650+ce/lwDGp6XuZYdwOYBKBbtRl80uniIZ5baC4/9LLdOEGTMu VDwkgZ7d1k7mqBSccztD29kt9v9YAWd2mPl4o4wdrRAh1FjvhT+vf3ACl8OC0PXag828 ftIC/UFPZ6ZFGXAr5CLVaufPBfiJzZOq9MQCPogN/a4ISyhPHnuEec+iVXfos9X2JMh4 G5+A== 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=TraAa9qxjleDjcKSV6cdBET+ximOcYjIqFdHiJLXCNQ=; b=UIrNp61sCj2+PoJBLQLGXeZpfc8oT7g/08uWPxQBZIxnec+o/kII0ivJWi5LM78Blq 3IpgLT9//s5MZ2BYZ2fpfFGULszlavKPj3l+NHADGQ6j3h9tBQrwVWV0TCpF7kYTjkJa rmU6w14bs3mgoHV44pROcU+i8V9RA0ISvuiUC1BEM0TBaVh9Tdl7ZwqzTFzaAc54yj+l CjwZhobNu5CFt7cn3rxKPypnjX5DHErQV9p2JouX5/Sd0YhruISdxiChuwe4XwnPWrSW 6qqIQLhVR7m3mCgnacCKmwXLdBsF6FPE52iQNfXnsUfTRa0owM74gNqlzjAD5LvWBKLX oaug== X-Gm-Message-State: AOAM531DCK+yDu80tfuDgfeCU4esjBHkwKMbbD7fmToVc6if/Ff0TSqI X9/aHTpA75neYz/z3xQbot7baFvzgoG52w== X-Received: by 2002:a17:902:f605:b0:154:aa89:bd13 with SMTP id n5-20020a170902f60500b00154aa89bd13mr13819802plg.112.1650810883135; Sun, 24 Apr 2022 07:34:43 -0700 (PDT) Received: from localhost.localdomain ([223.212.58.71]) by smtp.gmail.com with ESMTPSA id n16-20020a17090a091000b001d2bff34228sm5659369pjn.9.2022.04.24.07.34.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 24 Apr 2022 07:34:42 -0700 (PDT) From: Yuntao Wang To: Alexei Starovoitov , Daniel Borkmann , Andrii Nakryiko Cc: Martin KaFai Lau , Song Liu , Yonghong Song , John Fastabend , KP Singh , netdev@vger.kernel.org, bpf@vger.kernel.org, linux-kernel@vger.kernel.org, Yuntao Wang Subject: [PATCH bpf-next] libbpf: Remove unnecessary type cast Date: Sun, 24 Apr 2022 22:34:20 +0800 Message-Id: <20220424143420.457082-1-ytcoode@gmail.com> X-Mailer: git-send-email 2.35.3 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS 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 link variable is already of type 'struct bpf_link *', casting it to 'struct bpf_link *' is redundant, drop it. Signed-off-by: Yuntao Wang --- tools/lib/bpf/libbpf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/lib/bpf/libbpf.c b/tools/lib/bpf/libbpf.c index 9a213aaaac8a..cc1a8fc47f72 100644 --- a/tools/lib/bpf/libbpf.c +++ b/tools/lib/bpf/libbpf.c @@ -11270,7 +11270,7 @@ static struct bpf_link *bpf_program__attach_btf_id(const struct bpf_program *pro return libbpf_err_ptr(pfd); } link->fd = pfd; - return (struct bpf_link *)link; + return link; } struct bpf_link *bpf_program__attach_trace(const struct bpf_program *prog) -- 2.35.3