From patchwork Fri Aug 12 10:15:23 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Li kunyu X-Patchwork-Id: 12942109 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 72433C00140 for ; Fri, 12 Aug 2022 10:15:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238165AbiHLKPz (ORCPT ); Fri, 12 Aug 2022 06:15:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34738 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238434AbiHLKPl (ORCPT ); Fri, 12 Aug 2022 06:15:41 -0400 Received: from mail.nfschina.com (unknown [IPv6:2400:dd01:100f:2:72e2:84ff:fe10:5f45]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 9212A61DA6; Fri, 12 Aug 2022 03:15:29 -0700 (PDT) Received: from localhost (unknown [127.0.0.1]) by mail.nfschina.com (Postfix) with ESMTP id 5E0D91E80D95; Fri, 12 Aug 2022 18:13:16 +0800 (CST) X-Virus-Scanned: amavisd-new at test.com Received: from mail.nfschina.com ([127.0.0.1]) by localhost (mail.nfschina.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id sr5tHa-edn_L; Fri, 12 Aug 2022 18:13:13 +0800 (CST) Received: from localhost.localdomain (unknown [219.141.250.2]) (Authenticated sender: kunyu@nfschina.com) by mail.nfschina.com (Postfix) with ESMTPA id 9BC111E80D77; Fri, 12 Aug 2022 18:13:13 +0800 (CST) From: Li kunyu To: pbonzini@redhat.com Cc: kvm@vger.kernel.org, linux-kernel@vger.kernel.org, Li kunyu Subject: [PATCH 1/5] kvm/kvm_main: Modify the offset type to size_t, which is consistent with the calling function Date: Fri, 12 Aug 2022 18:15:23 +0800 Message-Id: <20220812101523.8066-1-kunyu@nfschina.com> X-Mailer: git-send-email 2.18.2 Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org The offset variable is called size_t in the calling function. Considering the number of bits in different architectures (32 and 64 represent different types), change it to a consistent variable. Signed-off-by: Li kunyu --- virt/kvm/kvm_main.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c index 515dfe9d3bcf..1b9700160eb1 100644 --- a/virt/kvm/kvm_main.c +++ b/virt/kvm/kvm_main.c @@ -5526,7 +5526,7 @@ static const struct file_operations stat_fops_per_vm = { static int vm_stat_get(void *_offset, u64 *val) { - unsigned offset = (long)_offset; + size_t offset = (size_t)_offset; struct kvm *kvm; u64 tmp_val; @@ -5542,7 +5542,7 @@ static int vm_stat_get(void *_offset, u64 *val) static int vm_stat_clear(void *_offset, u64 val) { - unsigned offset = (long)_offset; + size_t offset = (size_t)_offset; struct kvm *kvm; if (val) @@ -5562,7 +5562,7 @@ DEFINE_SIMPLE_ATTRIBUTE(vm_stat_readonly_fops, vm_stat_get, NULL, "%llu\n"); static int vcpu_stat_get(void *_offset, u64 *val) { - unsigned offset = (long)_offset; + size_t offset = (size_t)_offset; struct kvm *kvm; u64 tmp_val; @@ -5578,7 +5578,7 @@ static int vcpu_stat_get(void *_offset, u64 *val) static int vcpu_stat_clear(void *_offset, u64 val) { - unsigned offset = (long)_offset; + size_t offset = (size_t)_offset; struct kvm *kvm; if (val)