From nobody Thu Apr 25 17:11:51 2024 Delivered-To: importer@patchew.org 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; Authentication-Results: mx.zohomail.com; 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=fail(p=none dis=none) header.from=de.ibm.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1581603780386385.45791477167097; Thu, 13 Feb 2020 06:23:00 -0800 (PST) Received: from localhost ([::1]:53072 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j2FOL-0005tF-P1 for importer@patchew.org; Thu, 13 Feb 2020 09:22:57 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:56185) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j2FNQ-00052U-VZ for qemu-devel@nongnu.org; Thu, 13 Feb 2020 09:22:02 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1j2FNO-0005xK-Ol for qemu-devel@nongnu.org; Thu, 13 Feb 2020 09:22:00 -0500 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:23850) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1j2FNO-0005oo-Gc for qemu-devel@nongnu.org; Thu, 13 Feb 2020 09:21:58 -0500 Received: from pps.filterd (m0098396.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 01DEJ8KA104754 for ; Thu, 13 Feb 2020 09:21:55 -0500 Received: from e06smtp03.uk.ibm.com (e06smtp03.uk.ibm.com [195.75.94.99]) by mx0a-001b2d01.pphosted.com with ESMTP id 2y57as9ysp-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Thu, 13 Feb 2020 09:21:54 -0500 Received: from localhost by e06smtp03.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Thu, 13 Feb 2020 14:21:52 -0000 Received: from b06avi18626390.portsmouth.uk.ibm.com (9.149.26.192) by e06smtp03.uk.ibm.com (192.168.101.133) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256/256) Thu, 13 Feb 2020 14:21:49 -0000 Received: from d06av26.portsmouth.uk.ibm.com (d06av26.portsmouth.uk.ibm.com [9.149.105.62]) by b06avi18626390.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 01DEKsB640173906 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 13 Feb 2020 14:20:54 GMT Received: from d06av26.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id B306DAE055; Thu, 13 Feb 2020 14:21:48 +0000 (GMT) Received: from d06av26.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 9E73AAE05A; Thu, 13 Feb 2020 14:21:48 +0000 (GMT) Received: from tuxmaker.boeblingen.de.ibm.com (unknown [9.152.85.9]) by d06av26.portsmouth.uk.ibm.com (Postfix) with ESMTPS; Thu, 13 Feb 2020 14:21:48 +0000 (GMT) Received: by tuxmaker.boeblingen.de.ibm.com (Postfix, from userid 25651) id 2AF32E03C5; Thu, 13 Feb 2020 15:21:48 +0100 (CET) From: Christian Borntraeger To: Andrew Morton Subject: [PATCH] uapi: fix userspace breakage, use __BITS_PER_LONG for swap Date: Thu, 13 Feb 2020 15:21:47 +0100 X-Mailer: git-send-email 2.24.1 MIME-Version: 1.0 X-TM-AS-GCONF: 00 x-cbid: 20021314-0012-0000-0000-000003868148 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 20021314-0013-0000-0000-000021C304CC Message-Id: <20200213142147.17604-1-borntraeger@de.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.138, 18.0.572 definitions=2020-02-13_04:2020-02-12, 2020-02-13 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 bulkscore=0 adultscore=0 malwarescore=0 priorityscore=1501 suspectscore=0 mlxscore=0 spamscore=0 phishscore=0 lowpriorityscore=0 mlxlogscore=975 impostorscore=0 clxscore=1015 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2001150001 definitions=main-2002130114 Content-Transfer-Encoding: quoted-printable X-MIME-Autoconverted: from 8bit to quoted-printable by mx0a-001b2d01.pphosted.com id 01DEJ8KA104754 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [generic] X-Received-From: 148.163.156.1 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Yury Norov , linux-kernel@vger.kernel.org, qemu-devel , Christian Borntraeger , William Breathitt Gray , Joe Perches , Thomas Gleixner , Allison Randal Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" QEMU has a funny new build error message when I use the upstream kernel hea= ders: CC block/file-posix.o In file included from /home/cborntra/REPOS/qemu/include/qemu/timer.h:4, from /home/cborntra/REPOS/qemu/include/qemu/timed-average.= h:29, from /home/cborntra/REPOS/qemu/include/block/accounting.h:= 28, from /home/cborntra/REPOS/qemu/include/block/block_int.h:2= 7, from /home/cborntra/REPOS/qemu/block/file-posix.c:30: /usr/include/linux/swab.h: In function =E2=80=98__swab=E2=80=99: /home/cborntra/REPOS/qemu/include/qemu/bitops.h:20:34: error: "sizeof" is n= ot defined, evaluates to 0 [-Werror=3Dundef] 20 | #define BITS_PER_LONG (sizeof (unsigned long) * BITS_PER_= BYTE) | ^~~~~~ /home/cborntra/REPOS/qemu/include/qemu/bitops.h:20:41: error: missing binar= y operator before token "(" 20 | #define BITS_PER_LONG (sizeof (unsigned long) * BITS_PER_= BYTE) | ^ cc1: all warnings being treated as errors make: *** [/home/cborntra/REPOS/qemu/rules.mak:69: block/file-posix.o] Erro= r 1 rm tests/qemu-iotests/socket_scm_helper.o This was triggered by commit d5767057c9a ("uapi: rename ext2_swab() to swab= () and share globally in swab.h") This patch is doing +#include but it uses BITS_PER_LONG. The kernel file asm/bitsperlong.h provide only __BITS_PER_LONG. Let us use the __ variant in swap.h Fixes: d5767057c9a ("uapi: rename ext2_swab() to swab() and share globally = in swab.h") Cc: Yury Norov Cc: Allison Randal Cc: Joe Perches Cc: Thomas Gleixner Cc: William Breathitt Gray Signed-off-by: Christian Borntraeger --- include/uapi/linux/swab.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/uapi/linux/swab.h b/include/uapi/linux/swab.h index fa7f97da5b76..7272f85d6d6a 100644 --- a/include/uapi/linux/swab.h +++ b/include/uapi/linux/swab.h @@ -135,9 +135,9 @@ static inline __attribute_const__ __u32 __fswahb32(__u3= 2 val) =20 static __always_inline unsigned long __swab(const unsigned long y) { -#if BITS_PER_LONG =3D=3D 64 +#if __BITS_PER_LONG =3D=3D 64 return __swab64(y); -#else /* BITS_PER_LONG =3D=3D 32 */ +#else /* __BITS_PER_LONG =3D=3D 32 */ return __swab32(y); #endif } --=20 2.24.1