LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Cai Huoqing <caihuoqing@baidu.com>
To: <alex.williamson@redhat.com>, <cohuck@redhat.com>,
<zhenyuw@linux.intel.com>, <swee.yee.fonn@intel.com>,
<hkallweit1@gmail.com>, <fred.gao@intel.com>,
<mjrosato@linux.ibm.com>, <jgg@ziepe.ca>, <yi.l.liu@intel.com>,
<mgurtovoy@nvidia.com>
Cc: <kvm@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
Cai Huoqing <caihuoqing@baidu.com>
Subject: [PATCH] vfio/pci: use "ssize_t" as a return value instead of "size_t"
Date: Tue, 27 Jul 2021 11:24:33 +0800 [thread overview]
Message-ID: <20210727032433.457-1-caihuoqing@baidu.com> (raw)
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
next reply other threads:[~2021-07-27 3:24 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-07-27 3:24 Cai Huoqing [this message]
2021-07-27 11:55 ` Jason Gunthorpe
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20210727032433.457-1-caihuoqing@baidu.com \
--to=caihuoqing@baidu.com \
--cc=alex.williamson@redhat.com \
--cc=cohuck@redhat.com \
--cc=fred.gao@intel.com \
--cc=hkallweit1@gmail.com \
--cc=jgg@ziepe.ca \
--cc=kvm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mgurtovoy@nvidia.com \
--cc=mjrosato@linux.ibm.com \
--cc=swee.yee.fonn@intel.com \
--cc=yi.l.liu@intel.com \
--cc=zhenyuw@linux.intel.com \
--subject='Re: [PATCH] vfio/pci: use "ssize_t" as a return value instead of "size_t"' \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
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).