Re: [PATCH 4/5] Add implementation of read_vpd() method for sysfs

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

 



Hello!

> +enum {
> +  FD_RW = 1,	/* opened read-write, else read-only */
> +  FD_VPD = 2,	/* opened VPD, else config */
> +};

This deserves a comment explaining where are the values used.

>  static int
> -sysfs_setup(struct pci_dev *d, int rw)
> +sysfs_setup(struct pci_dev *d, int flags)
>  {
>    struct pci_access *a = d->access;
>  
> -  if (a->cached_dev != d || a->fd_flags < rw)
> +  if (a->cached_dev != d ||
> +      (flags ^ a->fd_flags) & FD_VPD ||
> +      (flags & FD_RW) && !(a->fd_flags & FD_RW))

Sharing a->fd for both file descriptors is ugly and it causes the sysfs file
with configuration space to be reopened during a single run of lspci. Could
you please add another member to struct pci_dev?

				Have a nice fortnight
-- 
Martin `MJ' Mares                          <mj@xxxxxx>   http://mj.ucw.cz/
Faculty of Math and Physics, Charles University, Prague, Czech Rep., Earth
Hex dump:  Where witches put used curses...
--
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