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 3B8D5C54E4A for ; Fri, 8 May 2020 12:50:22 +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 0F44B218AC for ; Fri, 8 May 2020 12:50:21 +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="NG2sgFXC" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 0F44B218AC 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 1jX2S3-0003SU-0l; Fri, 08 May 2020 12:50:03 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1jX2S2-0003N1-Jy for xen-devel@lists.xenproject.org; Fri, 08 May 2020 12:50:02 +0000 X-Inumbo-ID: 6e7bca80-912a-11ea-9887-bc764e2007e4 Received: from us-smtp-1.mimecast.com (unknown [207.211.31.120]) by us1-rack-iad1.inumbo.com (Halon) with ESMTP id 6e7bca80-912a-11ea-9887-bc764e2007e4; Fri, 08 May 2020 12:50:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1588942201; 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=mr4uqpTXg1sXYxmIwAO3pDUOz2ZcsDiSAVP7r/LI/bA=; b=NG2sgFXCVisgjvMMA+Mrl5ZJ9QmVS8CKnuUifi5RQgxfQ7hhA+EYmgaWJHvlw6lWtnJzGr qdooTjjn+MBVzKFZv/4X/b6ckO+7zoMou7K9+p1CzTIr9APTxK939BlRjka89s79lX3jK9 7HCyrTOintJAiG85/FqUcWkaaGWuKMM= 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-373-4YAIeqf8OaueleRfKAlSYA-1; Fri, 08 May 2020 08:50:00 -0400 X-MC-Unique: 4YAIeqf8OaueleRfKAlSYA-1 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id ABB70800688; Fri, 8 May 2020 12:49:56 +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 500E85D9CA; Fri, 8 May 2020 12:49:50 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id E80F711358BC; Fri, 8 May 2020 14:49:48 +0200 (CEST) From: Markus Armbruster To: Philippe =?utf-8?Q?Mathieu-Daud=C3=A9?= Subject: Re: [PATCH v2 2/3] various: Remove unnecessary OBJECT() cast References: <20200504100735.10269-1-f4bug@amsat.org> <20200504100735.10269-3-f4bug@amsat.org> Date: Fri, 08 May 2020 14:49:48 +0200 In-Reply-To: <20200504100735.10269-3-f4bug@amsat.org> ("Philippe =?utf-8?Q?Mathieu-Daud=C3=A9=22's?= message of "Mon, 4 May 2020 12:07:34 +0200") Message-ID: <87mu6iy4k3.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.14 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 , qemu-ppc@nongnu.org, John Snow , Richard Henderson , "Daniel P. =?utf-8?Q?Berrang=C3=A9?=" , Andrew Jeffery , Cornelia Huck , Laurent Vivier , Corey Minyard , Paolo Bonzini , Aurelien Jarno Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" Philippe Mathieu-Daud=C3=A9 writes: > The OBJECT() macro is defined as: > > #define OBJECT(obj) ((Object *)(obj)) > > which expands to: > > ((Object *)object_dynamic_cast_assert((Object *)(obj), (name), > __FILE__, __LINE__, __func__)) Nope :) > This assertion can only fail when @obj points to something other > than its stated type, i.e. when we're in undefined behavior country. There is no assertion. > Remove the unnecessary OBJECT() casts when we already know the > pointer is of Object type. > > Patch created mechanically using spatch with this script: > > @@ > typedef Object; > Object *o; > @@ > - OBJECT(o) > + o > > Acked-by: Cornelia Huck > Acked-by: Corey Minyard > Acked-by: John Snow > Reviewed-by: Richard Henderson > Signed-off-by: Philippe Mathieu-Daud=C3=A9 > --- > v2: Reword (Markus) My rewording suggestion applied to PATCH 3, not to this one. With v2's commit message; Reviewed-by: Markus Armbruster