From: Li kunyu <kunyu@nfschina.com>
To: pbonzini@redhat.com
Cc: kvm@vger.kernel.org, linux-kernel@vger.kernel.org,
Li kunyu <kunyu@nfschina.com>
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 [thread overview]
Message-ID: <20220812101523.8066-1-kunyu@nfschina.com> (raw)
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 <kunyu@nfschina.com>
---
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)
--
2.18.2
next reply other threads:[~2022-08-12 10:15 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-08-12 10:15 Li kunyu [this message]
2022-08-12 10:22 ` [PATCH 2/5] kvm/kvm_main: remove unnecessary (void*) conversions Li kunyu
2022-08-12 10:24 ` [PATCH 3/5] kvm/kvm_main: The ops pointer variable does not need to be initialized and assigned, it is first allocated a memory address Li kunyu
2022-08-18 23:55 ` Sean Christopherson
2022-08-12 10:30 ` [PATCH 4/5] kvm/kvm_main: The npages variable does not need to be initialized and assigned, it is used after assignment Li kunyu
2022-08-18 23:51 ` Sean Christopherson
2022-08-19 1:32 ` Li kunyu
2022-08-12 10:31 ` [PATCH 5/5] kvm/kvm_main: remove unnecessary (const void*) conversions Li kunyu
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=20220812101523.8066-1-kunyu@nfschina.com \
--to=kunyu@nfschina.com \
--cc=kvm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=pbonzini@redhat.com \
/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
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®