Received: by 2002:a05:6358:16cc:b0:ea:6187:17c9 with SMTP id r12csp2156335rwl; Fri, 6 Jan 2023 02:40:13 -0800 (PST) X-Google-Smtp-Source: AMrXdXs/dVCrGr6m70pl/+QhUoLP8HrxKmErVgXXCY7L0lax0eZHlXhx1yD44K87IeOWqvTn3GZa X-Received: by 2002:a17:907:d681:b0:7c0:eb38:f8af with SMTP id wf1-20020a170907d68100b007c0eb38f8afmr46155534ejc.2.1673001612851; Fri, 06 Jan 2023 02:40:12 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673001612; cv=none; d=google.com; s=arc-20160816; b=Mz2FZ1T0ftVbTutwM85bPj4CtU03yBg9aagMnR2JNAo4mKoRj8OeVTXMUIuNSUVdck rW6abFFNllI9YPAMUMnWj3qnS3cS30edgB8BJHwNLsuNnJSCR4nIX8s1/L43QZSQrUz+ TTjHcqz1L3poba3EW6Z3rJjkE0O4LJoarfE3iJhTTWLKG9hf5l3y+bhr7u6b5NsYZ2Ri 9rIP9xPlMeH5ew7T6FJ4AnoyM1/1XpCTagPYcROabziQpDAsF0M8QMkjrkTWW1FMGZbz +XRl2Fl/8ywYc/WLuWpXyVt6lsg8oKcxWrNW0bPFGTIefrJSmXYvX/7X+Ag8C1VYkQ+I MXjQ== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=JAV1mEJ1RePKSiP31eA7Zb3huEWrI68yI1mkY2joYvU=; b=ChnE5AONYgj+16tgsY1GnL9TAbV+wEfL8xPHrngLO8QRT0EHR5XBSKrt7RS4pJzU6L +/IlOWu6J0OihhKjuUr5B7zJI8bDzrFltO8rDSA25NXur7koJQK7fHFiowWd/HmJI43k 2jM5+iOzCtpp1f47rQexBn0/IdstDeUhVh8xDWQdygIgyqGprHKz76qDJRm+ZXsCLyiU k/jL0BLVATojAR/yZ8HSofij25OHOJCw6DlQwaIi42Bf0s+n5teU5EMF5CkmcoQfzAtq RfS41T4f6iI9zASePyaMijVr/Q/bGKkNQajOnW3E6+xbhUpi8f7I85PP3ctZuEbQcX8m MZ/g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=PadLZRSH; 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=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id wz8-20020a170906fe4800b007c08bfea548si1135685ejb.382.2023.01.06.02.40.00; Fri, 06 Jan 2023 02:40:12 -0800 (PST) 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=@redhat.com header.s=mimecast20190719 header.b=PadLZRSH; 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=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233100AbjAFKZc (ORCPT + 54 others); Fri, 6 Jan 2023 05:25:32 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60564 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232544AbjAFKYp (ORCPT ); Fri, 6 Jan 2023 05:24:45 -0500 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 710786C299 for ; Fri, 6 Jan 2023 02:23:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1673000638; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=JAV1mEJ1RePKSiP31eA7Zb3huEWrI68yI1mkY2joYvU=; b=PadLZRSHAWD6E6ScQMDPuhk91xKGjucXVUvcR2hhpolDOPFs9MAsjeUjuhi/CbqyL3WbDR iDZbdEm4sP6wqB2bbbIuUAnjV8DEDoFgXD2wWI/XKucFxEVu+Or8tCtluGnUg6jFd6JP8B Rm2/y2No++x+eio+a2AvBiuuzB89Y3Y= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-354-Wk7HD-MSOPaFh-Au9Y_ciQ-1; Fri, 06 Jan 2023 05:23:56 -0500 X-MC-Unique: Wk7HD-MSOPaFh-Au9Y_ciQ-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.rdu2.redhat.com [10.11.54.8]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id C41A21871D9A; Fri, 6 Jan 2023 10:23:55 +0000 (UTC) Received: from plouf.redhat.com (unknown [10.39.192.97]) by smtp.corp.redhat.com (Postfix) with ESMTP id D17C5C15BAD; Fri, 6 Jan 2023 10:23:53 +0000 (UTC) From: Benjamin Tissoires To: Greg KH , Jiri Kosina , Alexei Starovoitov , Daniel Borkmann , Andrii Nakryiko , Dmitry Torokhov Cc: Tero Kristo , linux-kernel@vger.kernel.org, linux-input@vger.kernel.org, netdev@vger.kernel.org, bpf@vger.kernel.org, linux-kselftest@vger.kernel.org, Benjamin Tissoires Subject: [PATCH HID for-next v1 7/9] selftests: hid: enforce new attach API Date: Fri, 6 Jan 2023 11:23:30 +0100 Message-Id: <20230106102332.1019632-8-benjamin.tissoires@redhat.com> In-Reply-To: <20230106102332.1019632-1-benjamin.tissoires@redhat.com> References: <20230106102332.1019632-1-benjamin.tissoires@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 3.1 on 10.11.54.8 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_NONE 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 Now that the new API for hid_bpf_attach_prog() is in place, ensure we get an fd when calling this function. And remove the fallback code. Signed-off-by: Benjamin Tissoires --- tools/testing/selftests/hid/hid_bpf.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/tools/testing/selftests/hid/hid_bpf.c b/tools/testing/selftests/hid/hid_bpf.c index 9a262fe99b32..2cf96f818f25 100644 --- a/tools/testing/selftests/hid/hid_bpf.c +++ b/tools/testing/selftests/hid/hid_bpf.c @@ -638,11 +638,7 @@ TEST_F(hid_bpf, test_attach_detach) LOAD_PROGRAMS(progs); link = self->hid_links[0]; - /* we might not be using the new code path where hid_bpf_attach_prog() - * returns a link. - */ - if (!link) - link = bpf_program__fd(self->skel->progs.hid_first_event); + ASSERT_GT(link, 0) TH_LOG("HID-BPF link not created"); /* inject one event */ buf[0] = 1; -- 2.38.1