From nobody Thu Nov 14 06:54:56 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1705580864; cv=none; d=zohomail.com; s=zohoarc; b=ZwiasTuh33peSY6ytd0JuBJnIte6qN0qetSr3A4eRKPS4UAbrTrCqJsaP/v2g7BrYZriRNMubCRj5xoPlZJRfA4NWHDJpn1uU/chlVtyyevUPuPY8lP9IhSdWragzIfGinUFyYPqh54mwxoo1kO0wTCQMnuY4w1MaogqSRBvKGQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1705580864; h=Content-Type:Content-Transfer-Encoding:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To:Cc; bh=hDmH0xb0KJF83JwWFiZmZr7xbAbQMZGA9xbRqzRDHkU=; b=Zy4ncue0AHhe7abBd0sl/nC5XT7eI1VV1vT2trmIJJPVwpbXaNEww4toQbxZa8EqwFRIXXIFImbXX7hEKhOvPhoD5LmOejYyxFBZJwPs9iu4/M8z0vqH79YFuPYFrhzGFZayG0nPfUP6XpjCSGov5r0MaQIGlipk/53c/oV6IDE= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1705580864702924.0660230598984; Thu, 18 Jan 2024 04:27:44 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rQRS3-0004C9-SV; Thu, 18 Jan 2024 07:24:55 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rQRRy-0003hk-6p for qemu-devel@nongnu.org; Thu, 18 Jan 2024 07:24:50 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rQRRw-0006QY-AP for qemu-devel@nongnu.org; Thu, 18 Jan 2024 07:24:49 -0500 Received: from mail-lf1-f69.google.com (mail-lf1-f69.google.com [209.85.167.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-554-4SFreF_UORqOoeLVxV-uJg-1; Thu, 18 Jan 2024 07:24:45 -0500 Received: by mail-lf1-f69.google.com with SMTP id 2adb3069b0e04-50e5aa11579so10481342e87.1 for ; Thu, 18 Jan 2024 04:24:45 -0800 (PST) Received: from [192.168.10.118] ([2001:b07:6468:f312:4783:a68:c1ee:15c5]) by smtp.gmail.com with ESMTPSA id g16-20020a17090670d000b00a28f51adc39sm8999556ejk.61.2024.01.18.04.24.41 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 18 Jan 2024 04:24:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1705580687; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=hDmH0xb0KJF83JwWFiZmZr7xbAbQMZGA9xbRqzRDHkU=; b=N0HYJU5VDoRrpJpjT2vKf/0v/oF/+J/YtdwXmf0EdQFmXUDOQpJi/kE7JEslc1RNKwGtnC 8scpT6k0xcgpyNxjN1spgW7ROxnHf+igzBM5UVjaZHTdGoQs72tuq8cVCW0qO6tukTiJp9 VEfDx3FVY0QwYY/6ibC4ZSJuDm6wRuU= X-MC-Unique: 4SFreF_UORqOoeLVxV-uJg-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1705580683; x=1706185483; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=hDmH0xb0KJF83JwWFiZmZr7xbAbQMZGA9xbRqzRDHkU=; b=t7xzmLTCO90UaQtOaI+mUhdqSJZgi+o8tlzgESeSkdl9zHjem4Mib8kgnjO4EN6Swh qaUfMBPVY4p0Ex/mpFaQX2/jNS1k7Fdb/3kkwg17DWSSilFsd6h6a11olhgvLJgt2nfq Ryu1fIaez74l0Ceutm/rn3Qx4+wTuzGyui83cRSTDy8kAqsUpE4uSgn8ZXOv6wVZR06O 5KxERLVfk4+lA0YZk1Z94a1dkh7LQ7g3WDwy1WUaaWCSDJqyYLOwycZ7zX0DyEQf63vY FL9dmC8TGBEuUyZnuQQIhGEVpSj47FGh12HPbvytgh6II3UKT1NwU4NZWh5aqBIt0oVm 0dWw== X-Gm-Message-State: AOJu0YxkY67wHgaK6+nZJU7GRwd7ACJ05YK++T9IagjJ6GGvohtMIj+D +x2Q2NvovW/A5T5Ei96TZ9QkAR644Q73775VpGPA8aGHvnPEcN6HzwOToq5YO5iF5tTgjV8xPcf Og4LEWyqOM/oo3lUjQcqfi9rqapmBDSF/O+a1IrCQ7EQRaidGTRXAlqqP2/028imF2uNDKBu5xH DjPLzfhwgmYGzYTAO7rFJ2CWirgu+LNXnpuzsV X-Received: by 2002:ac2:5184:0:b0:50f:5e2:d50 with SMTP id u4-20020ac25184000000b0050f05e20d50mr360302lfi.51.1705580683529; Thu, 18 Jan 2024 04:24:43 -0800 (PST) X-Google-Smtp-Source: AGHT+IH/xUDldOgfmRW0Kh3OnJlfRkyf61+sFNEht8bXaYgz9UIa8vi6ryuOk+QZ2N9LEASX5fTW7Q== X-Received: by 2002:ac2:5184:0:b0:50f:5e2:d50 with SMTP id u4-20020ac25184000000b0050f05e20d50mr360300lfi.51.1705580683234; Thu, 18 Jan 2024 04:24:43 -0800 (PST) From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 14/16] remove unnecessary casts from uintptr_t Date: Thu, 18 Jan 2024 13:24:14 +0100 Message-ID: <20240118122416.9209-15-pbonzini@redhat.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240118122416.9209-1-pbonzini@redhat.com> References: <20240118122416.9209-1-pbonzini@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=pbonzini@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -38 X-Spam_score: -3.9 X-Spam_bar: --- X-Spam_report: (-3.9 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-1.806, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1705580866377100005 Content-Type: text/plain; charset="utf-8" uintptr_t, or unsigned long which is equivalent on Linux I32LP64 systems, is an unsigned type and there is no need to further cast to __u64 which is another unsigned integer type; widening casts from unsigned integers zero-extend the value. Signed-off-by: Paolo Bonzini --- block/io_uring.c | 2 +- hw/vfio/common.c | 4 ++-- target/i386/sev.c | 8 ++++---- util/fdmon-io_uring.c | 2 +- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/block/io_uring.c b/block/io_uring.c index 1e5886c30be..d77ae55745a 100644 --- a/block/io_uring.c +++ b/block/io_uring.c @@ -102,7 +102,7 @@ static void luring_resubmit_short_read(LuringState *s, = LuringAIOCB *luringcb, =20 /* Update sqe */ luringcb->sqeq.off +=3D nread; - luringcb->sqeq.addr =3D (__u64)(uintptr_t)luringcb->resubmit_qiov.iov; + luringcb->sqeq.addr =3D (uintptr_t)luringcb->resubmit_qiov.iov; luringcb->sqeq.len =3D luringcb->resubmit_qiov.niov; =20 luring_resubmit(s, luringcb); diff --git a/hw/vfio/common.c b/hw/vfio/common.c index 0b3352f2a9d..4aa86f563c6 100644 --- a/hw/vfio/common.c +++ b/hw/vfio/common.c @@ -1000,7 +1000,7 @@ vfio_device_feature_dma_logging_start_create(VFIOCont= ainerBase *bcontainer, return NULL; } =20 - control->ranges =3D (__u64)(uintptr_t)ranges; + control->ranges =3D (uintptr_t)ranges; if (tracking->max32) { ranges->iova =3D tracking->min32; ranges->length =3D (tracking->max32 - tracking->min32) + 1; @@ -1126,7 +1126,7 @@ static int vfio_device_dma_logging_report(VFIODevice = *vbasedev, hwaddr iova, report->iova =3D iova; report->length =3D size; report->page_size =3D qemu_real_host_page_size(); - report->bitmap =3D (__u64)(uintptr_t)bitmap; + report->bitmap =3D (uintptr_t)bitmap; =20 feature->argsz =3D sizeof(buf); feature->flags =3D VFIO_DEVICE_FEATURE_GET | diff --git a/target/i386/sev.c b/target/i386/sev.c index 9a712466825..173de91afe7 100644 --- a/target/i386/sev.c +++ b/target/i386/sev.c @@ -167,7 +167,7 @@ sev_ioctl(int fd, int cmd, void *data, int *error) =20 input.id =3D cmd; input.sev_fd =3D fd; - input.data =3D (__u64)(unsigned long)data; + input.data =3D (uintptr_t)data; =20 r =3D kvm_vm_ioctl(kvm_state, KVM_MEMORY_ENCRYPT_OP, &input); =20 @@ -240,7 +240,7 @@ sev_ram_block_added(RAMBlockNotifier *n, void *host, si= ze_t size, return; } =20 - range.addr =3D (__u64)(unsigned long)host; + range.addr =3D (uintptr_t)host; range.size =3D max_size; =20 trace_kvm_memcrypt_register_region(host, max_size); @@ -270,7 +270,7 @@ sev_ram_block_removed(RAMBlockNotifier *n, void *host, = size_t size, return; } =20 - range.addr =3D (__u64)(unsigned long)host; + range.addr =3D (uintptr_t)host; range.size =3D max_size; =20 trace_kvm_memcrypt_unregister_region(host, max_size); @@ -767,7 +767,7 @@ sev_launch_update_data(SevGuestState *sev, uint8_t *add= r, uint64_t len) return 1; } =20 - update.uaddr =3D (__u64)(unsigned long)addr; + update.uaddr =3D (uintptr_t)addr; update.len =3D len; trace_kvm_sev_launch_update_data(addr, len); ret =3D sev_ioctl(sev->sev_fd, KVM_SEV_LAUNCH_UPDATE_DATA, diff --git a/util/fdmon-io_uring.c b/util/fdmon-io_uring.c index 16054c5ede3..b0d68bdc44d 100644 --- a/util/fdmon-io_uring.c +++ b/util/fdmon-io_uring.c @@ -180,7 +180,7 @@ static void add_poll_remove_sqe(AioContext *ctx, AioHan= dler *node) struct io_uring_sqe *sqe =3D get_sqe(ctx); =20 #ifdef LIBURING_HAVE_DATA64 - io_uring_prep_poll_remove(sqe, (__u64)(uintptr_t)node); + io_uring_prep_poll_remove(sqe, (uintptr_t)node); #else io_uring_prep_poll_remove(sqe, node); #endif --=20 2.43.0