Message ID | 20230926163911.66114-2-marpagan@redhat.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:cae8:0:b0:403:3b70:6f57 with SMTP id r8csp2112107vqu; Tue, 26 Sep 2023 11:26:54 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEeY+7DGlNPDhp5iawJMxEKSNNJrkxtqD4E/QP/ZjDAQ9OfPJp3NMnh3EGKJ85kytf6WWH7 X-Received: by 2002:aa7:8886:0:b0:68c:1004:1feb with SMTP id z6-20020aa78886000000b0068c10041febmr13733064pfe.32.1695752814229; Tue, 26 Sep 2023 11:26:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695752814; cv=none; d=google.com; s=arc-20160816; b=Labrx6utcRpmQDFDc0U8QX3Sji2OUjN9FlSl8owDkb2paPy+osOTxnGJ59JX+k9L9o 1YzvEiJGW4yHvnzs/WigKHVkaN2gMinMfQYwJqtZbugF/FmBivqyj1IIwrRy/OEglwgN 2CCHZnRODV17ZlL38RPKwM7+Gk9qJ9dqspxSzj5ZY0/KXzW4iDb+/Ru5j60+oE6CIjQF ZQXvhGr4W692KoTtK1WQ/XR2knrbldXybKG4s/Bt9eMEzluxgd5jMLvcq4CFWzYR5od9 jzdshY4TMfxEGApObAJelXwOvUaeYX3t3SOBYfxsfSbCSPwYnqGZSnxUVmcx23Jat2eT 5fNQ== 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=av4Q5tr0bnozwSJldJa/tKMZzYdZGmoPuhbGkeCDqlg=; fh=vL6Moim7ujQ71QOBXYMaaPnG1N9WYgskJqrZSTruGY4=; b=Lk509njIoAXH6CsCnuEcFU1pZdDCuVELU5ZgQbgtuIYQHeG3U6CuOEaaRW90GhIxUA O0B0wynMKXZj5OVR5HLv63TbH5OkJydymi73NcSXvnxyE1lhPhyVb7gk2h997K1ydwmO OY5+X4lAXIDSBunr8b+0EgnBPtJb8m8Ph2PbJxgVxpKGc4oYeFE2VJ7kk4MGF0HPCRyc MIAL2MXUtFC2Q0HjM4yW9cVgIxsdRM1Z9+4tApOm581NvYA3YzrBJcFmsGJ+Uv0p6xJx bFHd9ah7wDAa35Aj65m/j5RZOerf2og9ZCA1+htyVYy8EPE9B3qv9iAgvag/S/IKi8+5 p+sw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=iqTAIiHu; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from howler.vger.email (howler.vger.email. [2620:137:e000::3:4]) by mx.google.com with ESMTPS id h63-20020a638342000000b00584b7f082bdsi2226966pge.449.2023.09.26.11.26.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 26 Sep 2023 11:26:54 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) client-ip=2620:137:e000::3:4; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=iqTAIiHu; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by howler.vger.email (Postfix) with ESMTP id 83D56840B7FD; Tue, 26 Sep 2023 09:40:13 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235325AbjIZQkQ (ORCPT <rfc822;pwkd43@gmail.com> + 28 others); Tue, 26 Sep 2023 12:40:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48766 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235319AbjIZQkM (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Tue, 26 Sep 2023 12:40:12 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EF99A13A for <linux-kernel@vger.kernel.org>; Tue, 26 Sep 2023 09:39:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1695746365; 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=av4Q5tr0bnozwSJldJa/tKMZzYdZGmoPuhbGkeCDqlg=; b=iqTAIiHu1L5lsyMuMYmLo9rlkzA14940/mL6uHrTALweAdGUiFBpyUscoySoYDu6TD1YZq 5/twkDvqivabkP23XEWqHJSpERcPjN//x4x9RgszEAry2aehAwx8IfovaFyvZIYjwf3oag xkGRQN3kRkN+Tm/FC3x2Bh2c05y/QLE= Received: from mail-wr1-f70.google.com (mail-wr1-f70.google.com [209.85.221.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-275-QQJJ75rdNhuIs1BMOT2tiQ-1; Tue, 26 Sep 2023 12:39:23 -0400 X-MC-Unique: QQJJ75rdNhuIs1BMOT2tiQ-1 Received: by mail-wr1-f70.google.com with SMTP id ffacd0b85a97d-32006e08483so7257776f8f.0 for <linux-kernel@vger.kernel.org>; Tue, 26 Sep 2023 09:39:23 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1695746362; x=1696351162; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=av4Q5tr0bnozwSJldJa/tKMZzYdZGmoPuhbGkeCDqlg=; b=qBbcqzKNrFF0f/Xqwmg+1v2r22YWrun666/WejoyckccvjPuQTs1iYJO7d4MUyQpGb DvxrJo5aM9JS892yf1emryzA3hkovxAP112hG8L4amuPixnpUUWtZMbpyHzfPdGb07Ym iXwIwJtI8j5pWyiPX4NCwdqMQcT9KDzXuHgeeChj63GCgSYzdgoGRKE7Tep7CP9tHnN9 3BYSVWuCfOGzUhg0tTD9PbAN2QYHMCglW7kg4wt5hNCCOqpJDHrwQHMZrD2+7t0XnNl4 66r9j3YCD3+WmxgTbgHQsPUMEdqR9fD9kmkqUc2/Osyc3Wrg+jy9s8VFAcHjF700sEj8 QfXw== X-Gm-Message-State: AOJu0Yy2SimQBK557IRW/2tzY4t3HqmHfgf5DUvh3s6P082J+pQd3Rz+ Fjpt2ze9WERUolsyuElSumyaB45vMUGZsf5maWDsmQrektGK/RtauGTYFa/qS6PZLCW9XqfW504 jMFn31RiqSk2RUrILBOdAzNY= X-Received: by 2002:adf:f891:0:b0:320:66:cf67 with SMTP id u17-20020adff891000000b003200066cf67mr8551634wrp.18.1695746362264; Tue, 26 Sep 2023 09:39:22 -0700 (PDT) X-Received: by 2002:adf:f891:0:b0:320:66:cf67 with SMTP id u17-20020adff891000000b003200066cf67mr8551628wrp.18.1695746362039; Tue, 26 Sep 2023 09:39:22 -0700 (PDT) Received: from klayman.redhat.com (net-2-34-30-58.cust.vodafonedsl.it. [2.34.30.58]) by smtp.gmail.com with ESMTPSA id w10-20020adfde8a000000b0031fba0a746bsm15171803wrl.9.2023.09.26.09.39.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 26 Sep 2023 09:39:21 -0700 (PDT) From: Marco Pagani <marpagan@redhat.com> To: Moritz Fischer <mdf@kernel.org>, Wu Hao <hao.wu@intel.com>, Xu Yilun <yilun.xu@intel.com>, Tom Rix <trix@redhat.com> Cc: Marco Pagani <marpagan@redhat.com>, linux-kernel@vger.kernel.org, linux-fpga@vger.kernel.org Subject: [PATCH 1/4] fpga: add helpers for the FPGA KUnit test suites. Date: Tue, 26 Sep 2023 18:39:08 +0200 Message-ID: <20230926163911.66114-2-marpagan@redhat.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230926163911.66114-1-marpagan@redhat.com> References: <20230926163911.66114-1-marpagan@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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_H4,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_NONE autolearn=unavailable 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: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (howler.vger.email [0.0.0.0]); Tue, 26 Sep 2023 09:40:13 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1778125703096826402 X-GMAIL-MSGID: 1778125703096826402 |
Series |
fpga: add platform drivers to the FPGA KUnit test suites
|
|
Commit Message
Marco Pagani
Sept. 26, 2023, 4:39 p.m. UTC
Add helpers to facilitate the registration of minimal platform drivers
to support the parent platform devices used for testing.
Signed-off-by: Marco Pagani <marpagan@redhat.com>
---
drivers/fpga/tests/fpga-test-helpers.h | 29 ++++++++++++++++++++++++++
1 file changed, 29 insertions(+)
create mode 100644 drivers/fpga/tests/fpga-test-helpers.h
Comments
On 2023-09-26 at 18:39:08 +0200, Marco Pagani wrote: > Add helpers to facilitate the registration of minimal platform drivers > to support the parent platform devices used for testing. > > Signed-off-by: Marco Pagani <marpagan@redhat.com> > --- > drivers/fpga/tests/fpga-test-helpers.h | 29 ++++++++++++++++++++++++++ > 1 file changed, 29 insertions(+) > create mode 100644 drivers/fpga/tests/fpga-test-helpers.h > > diff --git a/drivers/fpga/tests/fpga-test-helpers.h b/drivers/fpga/tests/fpga-test-helpers.h > new file mode 100644 > index 000000000000..fcad3249be68 > --- /dev/null > +++ b/drivers/fpga/tests/fpga-test-helpers.h > @@ -0,0 +1,29 @@ > +/* SPDX-License-Identifier: GPL-2.0 */ > +/* > + * KUnit test for the FPGA Manager > + * > + * Copyright (C) 2023 Red Hat, Inc. > + * > + * Author: Marco Pagani <marpagan@redhat.com> > + */ > + > +#ifndef FPGA_KUNIT_HELPERS_ > +#define FPGA_KUNIT_HELPERS_ How about _FPGA_KUNIT_HELPERS_H Others LGTM for this series. Thanks, Yilun > + > +#define TEST_PDEV_NAME "fpga-test-pdev" > + > +#define TEST_PLATFORM_DRIVER(__drv_name) \ > + __TEST_PLATFORM_DRIVER(__drv_name, TEST_PDEV_NAME) > +/* > + * Helper macro for defining a minimal platform driver that can > + * be registered to support the parent platform devices used for > + * testing. > + */ > +#define __TEST_PLATFORM_DRIVER(__drv_name, __dev_name) \ > +static struct platform_driver __drv_name = { \ > + .driver = { \ > + .name = __dev_name, \ > + }, \ > +} > + > +#endif /* FPGA_KUNIT_HELPERS_ */ > -- > 2.41.0 >
On 2023-09-28 18:01, Xu Yilun wrote: > On 2023-09-26 at 18:39:08 +0200, Marco Pagani wrote: >> Add helpers to facilitate the registration of minimal platform drivers >> to support the parent platform devices used for testing. >> >> Signed-off-by: Marco Pagani <marpagan@redhat.com> >> --- >> drivers/fpga/tests/fpga-test-helpers.h | 29 ++++++++++++++++++++++++++ >> 1 file changed, 29 insertions(+) >> create mode 100644 drivers/fpga/tests/fpga-test-helpers.h >> >> diff --git a/drivers/fpga/tests/fpga-test-helpers.h b/drivers/fpga/tests/fpga-test-helpers.h >> new file mode 100644 >> index 000000000000..fcad3249be68 >> --- /dev/null >> +++ b/drivers/fpga/tests/fpga-test-helpers.h >> @@ -0,0 +1,29 @@ >> +/* SPDX-License-Identifier: GPL-2.0 */ >> +/* >> + * KUnit test for the FPGA Manager >> + * >> + * Copyright (C) 2023 Red Hat, Inc. >> + * >> + * Author: Marco Pagani <marpagan@redhat.com> >> + */ >> + >> +#ifndef FPGA_KUNIT_HELPERS_ >> +#define FPGA_KUNIT_HELPERS_ > > How about _FPGA_KUNIT_HELPERS_H That's fine with me. I will change it in v2. > Others LGTM for this series. > > Thanks, > Yilun > >> + >> +#define TEST_PDEV_NAME "fpga-test-pdev" >> + >> +#define TEST_PLATFORM_DRIVER(__drv_name) \ >> + __TEST_PLATFORM_DRIVER(__drv_name, TEST_PDEV_NAME) >> +/* >> + * Helper macro for defining a minimal platform driver that can >> + * be registered to support the parent platform devices used for >> + * testing. >> + */ >> +#define __TEST_PLATFORM_DRIVER(__drv_name, __dev_name) \ >> +static struct platform_driver __drv_name = { \ >> + .driver = { \ >> + .name = __dev_name, \ >> + }, \ >> +} >> + >> +#endif /* FPGA_KUNIT_HELPERS_ */ >> -- >> 2.41.0 >> > Thanks, Marco
diff --git a/drivers/fpga/tests/fpga-test-helpers.h b/drivers/fpga/tests/fpga-test-helpers.h new file mode 100644 index 000000000000..fcad3249be68 --- /dev/null +++ b/drivers/fpga/tests/fpga-test-helpers.h @@ -0,0 +1,29 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +/* + * KUnit test for the FPGA Manager + * + * Copyright (C) 2023 Red Hat, Inc. + * + * Author: Marco Pagani <marpagan@redhat.com> + */ + +#ifndef FPGA_KUNIT_HELPERS_ +#define FPGA_KUNIT_HELPERS_ + +#define TEST_PDEV_NAME "fpga-test-pdev" + +#define TEST_PLATFORM_DRIVER(__drv_name) \ + __TEST_PLATFORM_DRIVER(__drv_name, TEST_PDEV_NAME) +/* + * Helper macro for defining a minimal platform driver that can + * be registered to support the parent platform devices used for + * testing. + */ +#define __TEST_PLATFORM_DRIVER(__drv_name, __dev_name) \ +static struct platform_driver __drv_name = { \ + .driver = { \ + .name = __dev_name, \ + }, \ +} + +#endif /* FPGA_KUNIT_HELPERS_ */