From nobody Fri May 17 11:05:30 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 63.128.21.124 as permitted sender) client-ip=63.128.21.124; envelope-from=philmd@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 63.128.21.124 as permitted sender) smtp.mailfrom=philmd@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1607692432; cv=none; d=zohomail.com; s=zohoarc; b=d+pSeCBk/A3M+TNuWwxrEnc8PId30CQ5EqZRoE/05o3XIHK8my34YCScpwcXsisJ2pZGl3UEmgPGmkMj/HKOuuxeMPKGvuVFv6qmS/ozDxuDtmYxRTf6lKzek1096f/MgBKB7mpJKwxxaArWhBOyUc9StctJgIYsHO+WZ+K/mgw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1607692432; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:MIME-Version:Message-ID:Subject:To; bh=m4eDFvApzfbJJcbdarI5iOjS3Wx+qUzMuAEg7SKkpTE=; b=Z5fivOo/TsnJY1Ab+NH1VyskRp6Sd+GVppib5BEJWG7JiMq0X2w0RDXoAFczaUomp/3bp/57n9ahCmSE1D/KRRsxT4nMWip3lvMbA6ZM52C9+xT2O0bhjEU8fYxwh0HjLhXSiHwA63PRJv/fqCHBTbowFuN2wbbaiYLLGs49/Xo= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 63.128.21.124 as permitted sender) smtp.mailfrom=philmd@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [63.128.21.124]) by mx.zohomail.com with SMTPS id 1607692432713862.2083178452858; Fri, 11 Dec 2020 05:13:52 -0800 (PST) Received: from mail-ej1-f71.google.com (mail-ej1-f71.google.com [209.85.218.71]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-238-EMC2m5GMO-mjxkQdiQyiyQ-1; Fri, 11 Dec 2020 08:13:49 -0500 Received: by mail-ej1-f71.google.com with SMTP id f12so2745956ejk.2 for ; Fri, 11 Dec 2020 05:13:49 -0800 (PST) Return-Path: Return-Path: Received: from x1w.redhat.com (101.red-88-21-206.staticip.rima-tde.net. [88.21.206.101]) by smtp.gmail.com with ESMTPSA id v24sm7939371edw.23.2020.12.11.05.13.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 11 Dec 2020 05:13:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1607692431; 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; bh=m4eDFvApzfbJJcbdarI5iOjS3Wx+qUzMuAEg7SKkpTE=; b=H1SBq3+sOqU6vR7xtEEGI6HuKrRrCmZQvS7kboju7qgC1rS8sNnDBGr4ZSAS1kylevh9iK MfxTVPWOSQtlUoAnLKqWokb1wuRBB2QngYusPMeNEOkP7+aHdY0HiwDMhixGRXzjvdS+Oe h8uVl70fgrRjU8ePhbccpgxqeyWHLJg= X-MC-Unique: EMC2m5GMO-mjxkQdiQyiyQ-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=m4eDFvApzfbJJcbdarI5iOjS3Wx+qUzMuAEg7SKkpTE=; b=hQbI/9k7hswr7qmavgTcn7/Q1mPTUDm0hc+WeSCmIFXhFcNWqw+jBfEDkQB2HcuVKe WMk5t8RS2Tgv+dIJ/rSpZq47p/3YkTdJuPSU1SU+5AEWsHXYidUuXnTeEC6JhBI0WfEQ 5hFq9UKHrP1g5a47JJIwySi7TTbfI9+Zyb8cYrodWqch10o5J2B41kL9f6b8kIe1P7Tp 6ngwQLy9HqbGRDfYtdii0tP80PE7nNVs9hM7fyzlPU8JW6F4yVc45nafp2BfnGXqyFvS y2et4aaM/MqO1EmledCDiK6NiIrowrInEI036LJALT+Geq4RzA/el/OSIvReQFqrzqtf HFaA== X-Gm-Message-State: AOAM533vCHJyxrxozpLvyWJL0Rwl7EB4d85zwXBsa9XMpKDvm/QYikwZ AlJe86+SQCjxb/wiSAttsf4YEO/UAjmXpNcSe6E85Xsk/aAzLmDnH2mKr2NJ+NfgyHyIHozk0VB LkbN57xKhIevyfg== X-Received: by 2002:a17:906:6c94:: with SMTP id s20mr10912749ejr.0.1607692428681; Fri, 11 Dec 2020 05:13:48 -0800 (PST) X-Google-Smtp-Source: ABdhPJzmy6jk/2x4HiAExG9AtfEFyO9uctDhpd8cojDzChvyMtTVMUVpi/Z3oFnBAbZqfk/EQuSkiQ== X-Received: by 2002:a17:906:6c94:: with SMTP id s20mr10912729ejr.0.1607692428481; Fri, 11 Dec 2020 05:13:48 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Eric Blake , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , Peter Maydell , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [RFC PATCH v4] compiler.h: remove GCC < 3 __builtin_expect fallback Date: Fri, 11 Dec 2020 14:13:46 +0100 Message-Id: <20201211131346.473882-1-philmd@redhat.com> X-Mailer: git-send-email 2.26.2 MIME-Version: 1.0 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=philmd@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Since commit efc6c07 ("configure: Add a test for the minimum compiler version"), QEMU explicitely depends on GCC >=3D 4.8. (clang >=3D 3.4 advertizes itself as GCC >=3D 4.2 compatible and supports __builtin_expect too) Signed-off-by: Marc-Andr=C3=A9 Lureau [PMD: #error if likely/unlikely already defined] Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Claudio Fontana --- Supersedes: <20201210134752.780923-4-marcandre.lureau@redhat.com> --- include/qemu/compiler.h | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/include/qemu/compiler.h b/include/qemu/compiler.h index c76281f3540..ae1aee79c8d 100644 --- a/include/qemu/compiler.h +++ b/include/qemu/compiler.h @@ -43,14 +43,11 @@ #define tostring(s) #s #endif =20 -#ifndef likely -#if __GNUC__ < 3 -#define __builtin_expect(x, n) (x) +#if defined(likely) || defined(unlikely) +#error building with likely/unlikely is not supported #endif - #define likely(x) __builtin_expect(!!(x), 1) #define unlikely(x) __builtin_expect(!!(x), 0) -#endif =20 #ifndef container_of #define container_of(ptr, type, member) ({ \ --=20 2.26.2