Received: by 2002:a05:6a10:1287:0:0:0:0 with SMTP id d7csp4068966pxv; Mon, 26 Jul 2021 20:26:46 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyxvllUiDedxPvWxh2YqIdcalBqY4Bjwoo/t5aOSppY+sH3i8PEVo12k9thRmTEFUemvVMN X-Received: by 2002:a5e:8402:: with SMTP id h2mr8625218ioj.46.1627356406111; Mon, 26 Jul 2021 20:26:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1627356406; cv=none; d=google.com; s=arc-20160816; b=M7jafjfWrtvBrBVogoYoBFyIdFUEbFpjZeP+bIVtOrtnJUC0T/J88L+dqMCOrzi5mv o32r1Z9wrHuST3rhXShoqdnwckibAPDed/W63yR2wHC2VN8Fafah+ofb1Qa4uZ4+45Nw J8pgNZtw3/skpva1TgjXNZMkGNi5e+IeMXDzCcMSAgGgRCQFL1qFyd1H9XH7AuecVHYf scDVUda468/ceTdo0RkWiALGjkU1XPf8t+tbVvkrxzWLRzYrqJ+HnpWug+4MGAQDfoGY IfIyFg0Q8gUTIo/hx62UTiFqJO9whQVGLiju47/mbWsZ/6bZ1TOeYoWOb9xKdqd5tiy3 vQJA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:subject:cc:to:from; bh=rfxsG+o5V70oWjEaHZOiF0zqPSYhHtdYfaIvGc/KF/w=; b=c1uma3+L5mkmpqYd8i2IARhtbmzjx9SO0hp4Hc9+2HKX07vOU/AU+P7pUkR1vGPNgD EEqho5eBRaDx+v8S0SiiFsDVvCE2nn2Elb+crv21JKD5H+/z9SHdORLx7RHjweCcA0RG J6d5jBC+RX4DKOCLgQzojrznkR1W7RmapG22IY6uPEXA3Htsy1ndCmXjB0xP61dV6BYp BimTKGkcJzm1Igt48l6WRF/u+fBUSLfzBCJ1qN1i9BV+M5FHVif6f3Qs28PNCw00+vqJ 34rI37da/1/zRMb6zUC9HIrwpoWrqqjqOf06f8GjlXl7LwdWthVGEYTSBXZ+lKyj5Vk2 zfYw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id x14si1830821jab.2.2021.07.26.20.26.34; Mon, 26 Jul 2021 20:26:46 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234749AbhG0CoW (ORCPT + 99 others); Mon, 26 Jul 2021 22:44:22 -0400 Received: from mx21.baidu.com ([220.181.3.85]:54774 "EHLO baidu.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S234588AbhG0CoV (ORCPT ); Mon, 26 Jul 2021 22:44:21 -0400 Received: from BC-Mail-Ex26.internal.baidu.com (unknown [172.31.51.20]) by Forcepoint Email with ESMTPS id 6EC72F514E7116C36CA5; Tue, 27 Jul 2021 11:24:41 +0800 (CST) Received: from BJHW-MAIL-EX27.internal.baidu.com (10.127.64.42) by BC-Mail-Ex26.internal.baidu.com (172.31.51.20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2176.2; Tue, 27 Jul 2021 11:24:41 +0800 Received: from LAPTOP-UKSR4ENP.internal.baidu.com (172.31.63.8) by BJHW-MAIL-EX27.internal.baidu.com (10.127.64.42) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2308.14; Tue, 27 Jul 2021 11:24:40 +0800 From: Cai Huoqing To: , , , , , , , , , CC: , , Cai Huoqing Subject: [PATCH] vfio/pci: use "ssize_t" as a return value instead of "size_t" Date: Tue, 27 Jul 2021 11:24:33 +0800 Message-ID: <20210727032433.457-1-caihuoqing@baidu.com> X-Mailer: git-send-email 2.17.1 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [172.31.63.8] X-ClientProxiedBy: BJHW-Mail-Ex09.internal.baidu.com (10.127.64.32) To BJHW-MAIL-EX27.internal.baidu.com (10.127.64.42) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org should use ssize_t when it returns error code and size_t Signed-off-by: Cai Huoqing --- 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