Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.5 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE, SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id C2960C47254 for ; Fri, 8 May 2020 12:51:04 +0000 (UTC) Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 94FF924959 for ; Fri, 8 May 2020 12:51:04 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="GyG3gvoZ" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 94FF924959 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1jX2St-0003wr-Ar; Fri, 08 May 2020 12:50:55 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1jX2Ss-0003wh-HS for xen-devel@lists.xenproject.org; Fri, 08 May 2020 12:50:54 +0000 X-Inumbo-ID: 8db9f854-912a-11ea-b07b-bc764e2007e4 Received: from us-smtp-1.mimecast.com (unknown [205.139.110.61]) by us1-rack-iad1.inumbo.com (Halon) with ESMTP id 8db9f854-912a-11ea-b07b-bc764e2007e4; Fri, 08 May 2020 12:50:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1588942253; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=zudctO3EkR+8Y0s3mx6MbBIauAULqPgX14OPAMKsxPM=; b=GyG3gvoZIszpvvKVWhZ0elNqWCCN4vkybmpJiEVQscR5ZIa5exV7asPCw/XFbvpL1fDRlc GqolCWINcY3fyXorw/H3QG00EXRb60CwdLwgNTSXcoPiDXIslBHrY+87FPaYNXu/L1JYJX gmy6SSah2UEjEVkb8Qg+o4KOfW6Gx4o= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-76-1-TUPxSPMNaE1-cw9UJ2Pg-1; Fri, 08 May 2020 08:50:52 -0400 X-MC-Unique: 1-TUPxSPMNaE1-cw9UJ2Pg-1 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id DFAC2107ACCA; Fri, 8 May 2020 12:50:48 +0000 (UTC) Received: from blackfin.pond.sub.org (ovpn-113-6.ams2.redhat.com [10.36.113.6]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 8B92B5C1BE; Fri, 8 May 2020 12:50:42 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id 0D88F11358BC; Fri, 8 May 2020 14:50:41 +0200 (CEST) From: Markus Armbruster To: Philippe =?utf-8?Q?Mathieu-Daud=C3=A9?= Subject: Re: [PATCH v2 1/3] target: Remove unnecessary CPU() cast References: <20200504100735.10269-1-f4bug@amsat.org> <20200504100735.10269-2-f4bug@amsat.org> Date: Fri, 08 May 2020 14:50:41 +0200 In-Reply-To: <20200504100735.10269-2-f4bug@amsat.org> ("Philippe =?utf-8?Q?Mathieu-Daud=C3=A9=22's?= message of "Mon, 4 May 2020 12:07:33 +0200") Message-ID: <87imh6y4im.fsf@dusky.pond.sub.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.3 (gnu/linux) MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell , Paul Durrant , Jason Wang , Mark Cave-Ayland , qemu-devel@nongnu.org, Gerd Hoffmann , "Edgar E. Iglesias" , Stefano Stabellini , qemu-block@nongnu.org, David Hildenbrand , Halil Pasic , Christian Borntraeger , Aleksandar Markovic , Joel Stanley , Anthony Perard , xen-devel@lists.xenproject.org, David Gibson , Philippe =?utf-8?Q?Mathieu-Daud=C3=A9?= , Eduardo Habkost , Corey Minyard , Richard Henderson , "Dr. David Alan Gilbert" , qemu-s390x@nongnu.org, qemu-arm@nongnu.org, Peter Chubb , =?utf-8?Q?C=C3=A9dric?= Le Goater , John Snow , Richard Henderson , "Daniel P. =?utf-8?Q?Berrang=C3=A9?=" , Andrew Jeffery , Cornelia Huck , Laurent Vivier , qemu-ppc@nongnu.org, Paolo Bonzini , Aurelien Jarno Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" Philippe Mathieu-Daud=C3=A9 writes: > The CPU() macro is defined as: > > #define CPU(obj) ((CPUState *)(obj)) > > which expands to: > > ((CPUState *)object_dynamic_cast_assert((Object *)(obj), (name), > __FILE__, __LINE__, __func__)) > > This assertion can only fail when @obj points to something other > than its stated type, i.e. when we're in undefined behavior country. > > Remove the unnecessary CPU() casts when we already know the pointer > is of CPUState type. > > Patch created mechanically using spatch with this script: > > @@ > typedef CPUState; > CPUState *s; > @@ > - CPU(s) > + s > > Acked-by: David Gibson > Reviewed-by: C=C3=A9dric Le Goater > Reviewed-by: Richard Henderson > Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Markus Armbruster