diff mbox

[3/8] PCI: Reduce size of ATS structure elements

Message ID 20150717213208.18379.24197.stgit@bhelgaas-glaptop2.roam.corp.google.com
State Superseded
Headers show

Commit Message

Bjorn Helgaas July 17, 2015, 9:32 p.m. UTC
The extended capabilities list is linked with 12-bit pointers, and the ATS
Smallest Translation Unit and Invalidate Queue Depth fields are both 5
bits.

Use u16 and u8 to hold the extended capability address and the stu and qdep
values.  No functional change.

Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
---
 include/linux/pci.h |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)


--
To unsubscribe from this list: send the line "unsubscribe linux-pci" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Comments

Joerg Roedel July 20, 2015, 2:27 p.m. UTC | #1
On Fri, Jul 17, 2015 at 04:32:08PM -0500, Bjorn Helgaas wrote:
> The extended capabilities list is linked with 12-bit pointers, and the ATS
> Smallest Translation Unit and Invalidate Queue Depth fields are both 5
> bits.
> 
> Use u16 and u8 to hold the extended capability address and the stu and qdep
> values.  No functional change.
> 
> Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
> ---
>  include/linux/pci.h |    6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/include/linux/pci.h b/include/linux/pci.h
> index ba4a23b..1997853 100644
> --- a/include/linux/pci.h
> +++ b/include/linux/pci.h
> @@ -376,9 +376,9 @@ struct pci_dev {
>  		struct pci_sriov *sriov;	/* SR-IOV capability related */
>  		struct pci_dev *physfn;	/* the PF this VF is associated with */
>  	};
> -	int		ats_cap;	/* ATS Capability offset */
> -	int		ats_stu;	/* ATS Smallest Translation Unit */
> -	int		ats_qdep;	/* ATS Invalidate Queue Depth */
> +	u16		ats_cap;	/* ATS Capability offset */
> +	u8		ats_stu;	/* ATS Smallest Translation Unit */
> +	u8		ats_qdep;	/* ATS Invalidate Queue Depth */
>  #endif
>  	phys_addr_t rom; /* Physical address of ROM if it's not from the BAR */
>  	size_t romlen; /* Length of ROM if it's not from the BAR */

I was about to suggest to fold this into the previous patch. But since
the elements in the old ats-struct were also ints, it makes sense to
have this as a seperate patch :)


Reviewed-by: Joerg Roedel <jroedel@suse.de>

--
To unsubscribe from this list: send the line "unsubscribe linux-pci" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/include/linux/pci.h b/include/linux/pci.h
index ba4a23b..1997853 100644
--- a/include/linux/pci.h
+++ b/include/linux/pci.h
@@ -376,9 +376,9 @@  struct pci_dev {
 		struct pci_sriov *sriov;	/* SR-IOV capability related */
 		struct pci_dev *physfn;	/* the PF this VF is associated with */
 	};
-	int		ats_cap;	/* ATS Capability offset */
-	int		ats_stu;	/* ATS Smallest Translation Unit */
-	int		ats_qdep;	/* ATS Invalidate Queue Depth */
+	u16		ats_cap;	/* ATS Capability offset */
+	u8		ats_stu;	/* ATS Smallest Translation Unit */
+	u8		ats_qdep;	/* ATS Invalidate Queue Depth */
 #endif
 	phys_addr_t rom; /* Physical address of ROM if it's not from the BAR */
 	size_t romlen; /* Length of ROM if it's not from the BAR */