[PATCH 3/5] Rename pci_access::fd_rw to fd_flags to allow for expansion

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Signed-off-by: Ben Hutchings <bhutchings@xxxxxxxxxxxxxx>
---
 lib/pci.h   |    2 +-
 lib/proc.c  |    6 +++---
 lib/sysfs.c |    6 +++---
 3 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/lib/pci.h b/lib/pci.h
index deef985..103fd7c 100644
--- a/lib/pci.h
+++ b/lib/pci.h
@@ -73,7 +73,7 @@ struct pci_access {
   int id_load_failed;
   int id_cache_status;			/* 0=not read, 1=read, 2=dirty */
   int fd;				/* proc: fd */
-  int fd_rw;				/* proc: fd opened read-write */
+  int fd_flags;				/* proc: fd status flags */
   struct pci_dev *cached_dev;		/* proc: device the fd is for */
   int fd_pos;				/* proc: current position */
 };
diff --git a/lib/proc.c b/lib/proc.c
index 4226004..da01553 100644
--- a/lib/proc.c
+++ b/lib/proc.c
@@ -117,7 +117,7 @@ proc_setup(struct pci_dev *d, int rw)
 {
   struct pci_access *a = d->access;
 
-  if (a->cached_dev != d || a->fd_rw < rw)
+  if (a->cached_dev != d || a->fd_flags < rw)
     {
       char buf[1024];
       int e;
@@ -128,8 +128,8 @@ proc_setup(struct pci_dev *d, int rw)
 		   d->bus, d->dev, d->func);
       if (e < 0 || e >= (int) sizeof(buf))
 	a->error("File name too long");
-      a->fd_rw = a->writeable || rw;
-      a->fd = open(buf, a->fd_rw ? O_RDWR : O_RDONLY);
+      a->fd_flags = a->writeable || rw;
+      a->fd = open(buf, a->fd_flags ? O_RDWR : O_RDONLY);
       if (a->fd < 0)
 	a->warning("Cannot open %s", buf);
       a->cached_dev = d;
diff --git a/lib/sysfs.c b/lib/sysfs.c
index 6a48e51..671fc25 100644
--- a/lib/sysfs.c
+++ b/lib/sysfs.c
@@ -182,14 +182,14 @@ sysfs_setup(struct pci_dev *d, int rw)
 {
   struct pci_access *a = d->access;
 
-  if (a->cached_dev != d || a->fd_rw < rw)
+  if (a->cached_dev != d || a->fd_flags < rw)
     {
       char namebuf[OBJNAMELEN];
       if (a->fd >= 0)
 	close(a->fd);
       sysfs_obj_name(d, "config", namebuf);
-      a->fd_rw = a->writeable || rw;
-      a->fd = open(namebuf, a->fd_rw ? O_RDWR : O_RDONLY);
+      a->fd_flags = a->writeable || rw;
+      a->fd = open(namebuf, a->fd_flags ? O_RDWR : O_RDONLY);
       if (a->fd < 0)
 	a->warning("Cannot open %s", namebuf);
       a->cached_dev = d;
-- 
Ben Hutchings, Senior Software Engineer, Solarflare Communications
Not speaking for my employer; that's the marketing department's job.
They asked us to note that Solarflare product names are trademarked.
--
To unsubscribe from this list: send the line "unsubscribe linux-pci" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [DMA Engine]     [Linux Coverity]     [Linux USB]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Greybus]

  Powered by Linux