LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
* [PATCH] vfio/pci: use "ssize_t" as a return value instead of "size_t"
@ 2021-07-27 3:24 Cai Huoqing
2021-07-27 11:55 ` Jason Gunthorpe
0 siblings, 1 reply; 2+ messages in thread
From: Cai Huoqing @ 2021-07-27 3:24 UTC (permalink / raw)
To: alex.williamson, cohuck, zhenyuw, swee.yee.fonn, hkallweit1,
fred.gao, mjrosato, jgg, yi.l.liu, mgurtovoy
Cc: kvm, linux-kernel, Cai Huoqing
should use ssize_t when it returns error code and size_t
Signed-off-by: Cai Huoqing <caihuoqing@baidu.com>
---
drivers/vfio/pci/vfio_pci_igd.c | 4 ++--
drivers/vfio/pci/vfio_pci_private.h | 2 +-
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/vfio/pci/vfio_pci_igd.c b/drivers/vfio/pci/vfio_pci_igd.c
index 228df565e9bc..3377ba379bfd 100644
--- a/drivers/vfio/pci/vfio_pci_igd.c
+++ b/drivers/vfio/pci/vfio_pci_igd.c
@@ -25,7 +25,7 @@
#define OPREGION_RVDS 0x3c2
#define OPREGION_VERSION 0x16
-static size_t vfio_pci_igd_rw(struct vfio_pci_device *vdev, char __user *buf,
+static ssize_t vfio_pci_igd_rw(struct vfio_pci_device *vdev, char __user *buf,
size_t count, loff_t *ppos, bool iswrite)
{
unsigned int i = VFIO_PCI_OFFSET_TO_INDEX(*ppos) - VFIO_PCI_NUM_REGIONS;
@@ -160,7 +160,7 @@ static int vfio_pci_igd_opregion_init(struct vfio_pci_device *vdev)
return ret;
}
-static size_t vfio_pci_igd_cfg_rw(struct vfio_pci_device *vdev,
+static ssize_t vfio_pci_igd_cfg_rw(struct vfio_pci_device *vdev,
char __user *buf, size_t count, loff_t *ppos,
bool iswrite)
{
diff --git a/drivers/vfio/pci/vfio_pci_private.h b/drivers/vfio/pci/vfio_pci_private.h
index 5a36272cecbf..bbc56c857ef0 100644
--- a/drivers/vfio/pci/vfio_pci_private.h
+++ b/drivers/vfio/pci/vfio_pci_private.h
@@ -56,7 +56,7 @@ struct vfio_pci_device;
struct vfio_pci_region;
struct vfio_pci_regops {
- size_t (*rw)(struct vfio_pci_device *vdev, char __user *buf,
+ ssize_t (*rw)(struct vfio_pci_device *vdev, char __user *buf,
size_t count, loff_t *ppos, bool iswrite);
void (*release)(struct vfio_pci_device *vdev,
struct vfio_pci_region *region);
--
2.25.1
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] vfio/pci: use "ssize_t" as a return value instead of "size_t"
2021-07-27 3:24 [PATCH] vfio/pci: use "ssize_t" as a return value instead of "size_t" Cai Huoqing
@ 2021-07-27 11:55 ` Jason Gunthorpe
0 siblings, 0 replies; 2+ messages in thread
From: Jason Gunthorpe @ 2021-07-27 11:55 UTC (permalink / raw)
To: Cai Huoqing
Cc: alex.williamson, cohuck, zhenyuw, swee.yee.fonn, hkallweit1,
fred.gao, mjrosato, yi.l.liu, mgurtovoy, kvm, linux-kernel
On Tue, Jul 27, 2021 at 11:24:33AM +0800, Cai Huoqing wrote:
> should use ssize_t when it returns error code and size_t
>
> Signed-off-by: Cai Huoqing <caihuoqing@baidu.com>
> ---
> drivers/vfio/pci/vfio_pci_igd.c | 4 ++--
> drivers/vfio/pci/vfio_pci_private.h | 2 +-
> 2 files changed, 3 insertions(+), 3 deletions(-)
This is a dup of this patch:
https://lore.kernel.org/kvm/0-v3-5db12d1bf576+c910-vfio_rw_jgg@nvidia.com/
Jason
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2021-07-27 11:55 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-07-27 3:24 [PATCH] vfio/pci: use "ssize_t" as a return value instead of "size_t" Cai Huoqing
2021-07-27 11:55 ` Jason Gunthorpe
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).