All of lore.kernel.org
 help / color / mirror / Atom feed
From: Anshuman Gupta <anshuman.gupta@intel.com>
To: igt-dev@lists.freedesktop.org
Cc: badal.nilawar@intel.com
Subject: [igt-dev] [PATCH i-g-t 1/2] test/device_reset: Rename device_fds to device_data
Date: Mon,  9 Jan 2023 17:32:04 +0530	[thread overview]
Message-ID: <20230109120205.2259410-2-anshuman.gupta@intel.com> (raw)
In-Reply-To: <20230109120205.2259410-1-anshuman.gupta@intel.com>

We need to encapsulate the the struct pci_device to device_fds
structure, which is a general helper data structure.
Rename its accordingly to device_data.
It will be used to encapsulate root port to support
warm reset IGT Test.

Signed-off-by: Anshuman Gupta <anshuman.gupta@intel.com>
---
 tests/device_reset.c | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/tests/device_reset.c b/tests/device_reset.c
index 39ee8dca9f..fe26030783 100644
--- a/tests/device_reset.c
+++ b/tests/device_reset.c
@@ -30,7 +30,7 @@ enum reset {
  * Helper structure containing file descriptors
  * and bus address related to tested device
  */
-struct device_fds {
+struct device_data {
 	struct {
 		int dev;
 		int dev_dir;
@@ -157,7 +157,7 @@ static char *device_sysfs_path(int fd, char *path)
 	return realpath(sysfs, path);
 }
 
-static void init_device_fds(struct device_fds *dev)
+static void init_device_fds(struct device_data *dev)
 {
 	char dev_path[PATH_MAX];
 	char *addr_pos;
@@ -210,7 +210,7 @@ static int close_if_opened(int *fd)
 	return rc;
 }
 
-static void cleanup_device_fds(struct device_fds *dev)
+static void cleanup_device_fds(struct device_data *dev)
 {
 	igt_ignore_warn(close_if_opened(&dev->fds.dev));
 	igt_ignore_warn(close_if_opened(&dev->fds.dev_dir));
@@ -283,7 +283,7 @@ static bool is_sysfs_cold_reset_supported(int slot_fd)
 }
 
 /* Unbind the driver from the device */
-static void driver_unbind(struct device_fds *dev)
+static void driver_unbind(struct device_data *dev)
 {
 	/**
 	 * FIXME: Unbinding the i915 driver on affected platforms with
@@ -319,7 +319,7 @@ static void driver_unbind(struct device_fds *dev)
 }
 
 /* Re-bind the driver to the device */
-static void driver_bind(struct device_fds *dev)
+static void driver_bind(struct device_data *dev)
 {
 	igt_debug("rebind the driver to the device\n");
 	igt_abort_on_f(!igt_sysfs_set(dev->fds.drv_dir, "bind",
@@ -330,7 +330,7 @@ static void driver_bind(struct device_fds *dev)
 }
 
 /* Initiate device reset */
-static void initiate_device_reset(struct device_fds *dev, enum reset type)
+static void initiate_device_reset(struct device_data *dev, enum reset type)
 {
 	igt_debug("reset device\n");
 
@@ -358,7 +358,7 @@ static bool is_i915_wedged(int i915)
  * @dev: structure with device descriptor, if descriptor equals -1
  * 	 the device is reopened
  */
-static void healthcheck(struct device_fds *dev)
+static void healthcheck(struct device_data *dev)
 {
 	if (dev->fds.dev == -1) {
 		/* refresh device list */
@@ -390,7 +390,7 @@ static void set_device_filter(const char* dev_path)
 	igt_assert_eq(igt_device_filter_add(filter), 1);
 }
 
-static void unbind_reset_rebind(struct device_fds *dev, enum reset type)
+static void unbind_reset_rebind(struct device_data *dev, enum reset type)
 {
 	igt_debug("close the device\n");
 	close_if_opened(&dev->fds.dev);
@@ -404,7 +404,7 @@ static void unbind_reset_rebind(struct device_fds *dev, enum reset type)
 
 igt_main
 {
-	struct device_fds dev = { .fds = {-1, -1, -1}, .dev_bus_addr = {0}, };
+	struct device_data dev = { .fds = {-1, -1, -1}, .dev_bus_addr = {0}, };
 
 	igt_fixture {
 		char dev_path[PATH_MAX];
-- 
2.25.1

  reply	other threads:[~2023-01-09 12:02 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-09 12:02 [igt-dev] [PATCH i-g-t 0/2] PCI WARM_RESET IGT Anshuman Gupta
2023-01-09 12:02 ` Anshuman Gupta [this message]
2023-01-09 12:02 ` [igt-dev] [PATCH i-g-t 2/2] tests/device_reset: Add warm_reset test Anshuman Gupta
2023-01-10 13:05   ` Tauro, Riana
2023-01-10 14:14     ` Gupta, Anshuman
2023-01-10 21:14       ` Dixit, Ashutosh
2023-01-11  7:39         ` Nilawar, Badal
2023-01-25 12:18         ` Gupta, Anshuman
2023-01-09 12:43 ` [igt-dev] ✓ Fi.CI.BAT: success for PCI WARM_RESET IGT Patchwork
2023-01-09 14:18 ` [igt-dev] ✓ Fi.CI.IGT: " Patchwork

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230109120205.2259410-2-anshuman.gupta@intel.com \
    --to=anshuman.gupta@intel.com \
    --cc=badal.nilawar@intel.com \
    --cc=igt-dev@lists.freedesktop.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.