Re: [PATCH RESEND v2 00/30] proc: convert the fs, kernel and mm entries (Part 5/7)
From: Christian Brauner
Date: Mon Nov 09 2026 - 06:27:23 EST
On Fri, Nov 06, 2026 at 12:03:37PM -0800, Linus Torvalds wrote:
> "pos" should just be loff_t, and "size" and "cnt" should be "size_t".
> Those are the correct types for those things. Not "unsigned int" and
> certainly not "int".
Sounds good:
--- v2/drivers/pci/proc.c
+++ v3/drivers/pci/proc.c
@@ -32,7 +32,8 @@
size_t nbytes, loff_t *ppos)
{
struct pci_dev *dev = pde_data(file_inode(file));
- unsigned int pos, cnt, size;
+ loff_t pos;
+ size_t cnt, size;
/*
* Normal users can read only the standardized portion of the
@@ -119,8 +120,10 @@
{
struct inode *ino = file_inode(file);
struct pci_dev *dev = pde_data(ino);
- int size = dev->cfg_size;
- int pos, cnt, ret;
+ size_t size = dev->cfg_size;
+ loff_t pos;
+ size_t cnt;
+ int ret;
ret = security_locked_down(LOCKDOWN_PCI_ACCESS);
if (ret)
@@ -134,7 +137,7 @@
pos = *ppos;
if (resource_is_exclusive(&dev->driver_exclusive_resource, pos, nbytes)) {
- pci_warn_once(dev, "%s: Unexpected write to kernel-exclusive config offset %x",
+ pci_warn_once(dev, "%s: Unexpected write to kernel-exclusive config offset %llx",
current->comm, pos);
add_taint(TAINT_USER, LOCKDEP_STILL_OK);
}
cfg_size stays an int in struct pci_dev, that's a larger thing.
--