{"id":2231216,"url":"http://patchwork.ozlabs.org/api/patches/2231216/?format=json","web_url":"http://patchwork.ozlabs.org/project/uboot/patch/20260430113937.1274693-2-sjg@chromium.org/","project":{"id":18,"url":"http://patchwork.ozlabs.org/api/projects/18/?format=json","name":"U-Boot","link_name":"uboot","list_id":"u-boot.lists.denx.de","list_email":"u-boot@lists.denx.de","web_url":null,"scm_url":null,"webscm_url":null,"list_archive_url":"","list_archive_url_format":"","commit_url_format":""},"msgid":"<20260430113937.1274693-2-sjg@chromium.org>","list_archive_url":null,"date":"2026-04-30T11:38:33","name":"[1/2] bitops: Guard GENMASK and GENMASK_ULL against prior defines","commit_ref":null,"pull_url":null,"state":"new","archived":false,"hash":"a16481f9ff8d3053f28a8bc264da8b3c23af73ef","submitter":{"id":6170,"url":"http://patchwork.ozlabs.org/api/people/6170/?format=json","name":"Simon Glass","email":"sjg@chromium.org"},"delegate":{"id":3651,"url":"http://patchwork.ozlabs.org/api/users/3651/?format=json","username":"trini","first_name":"Tom","last_name":"Rini","email":"trini@ti.com"},"mbox":"http://patchwork.ozlabs.org/project/uboot/patch/20260430113937.1274693-2-sjg@chromium.org/mbox/","series":[{"id":502283,"url":"http://patchwork.ozlabs.org/api/series/502283/?format=json","web_url":"http://patchwork.ozlabs.org/project/uboot/list/?series=502283","date":"2026-04-30T11:38:32","name":"cros_ec: Sync with upstream Chrome OS EC","version":1,"mbox":"http://patchwork.ozlabs.org/series/502283/mbox/"}],"comments":"http://patchwork.ozlabs.org/api/patches/2231216/comments/","check":"pending","checks":"http://patchwork.ozlabs.org/api/patches/2231216/checks/","tags":{},"related":[],"headers":{"Return-Path":"<u-boot-bounces@lists.denx.de>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming@legolas.ozlabs.org","Authentication-Results":["legolas.ozlabs.org;\n\tdkim=pass (1024-bit key;\n unprotected) header.d=chromium.org header.i=@chromium.org header.a=rsa-sha256\n header.s=google header.b=mba1ADDn;\n\tdkim-atps=neutral","legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de\n (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de;\n envelope-from=u-boot-bounces@lists.denx.de; receiver=patchwork.ozlabs.org)","phobos.denx.de;\n dmarc=pass (p=none dis=none) header.from=chromium.org","phobos.denx.de;\n spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de","phobos.denx.de;\n\tdkim=pass (1024-bit key;\n unprotected) header.d=chromium.org header.i=@chromium.org\n header.b=\"mba1ADDn\";\n\tdkim-atps=neutral","phobos.denx.de;\n dmarc=pass (p=none dis=none) header.from=chromium.org","phobos.denx.de;\n spf=pass smtp.mailfrom=sjg@chromium.org"],"Received":["from phobos.denx.de (unknown\n [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange x25519 server-signature ECDSA (secp384r1) server-digest SHA384)\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4g5sgX4Dd9z1xqf\n\tfor <incoming@patchwork.ozlabs.org>; Thu, 30 Apr 2026 21:40:55 +1000 (AEST)","from h2850616.stratoserver.net (localhost [IPv6:::1])\n\tby phobos.denx.de (Postfix) with ESMTP id CD8E78460D;\n\tThu, 30 Apr 2026 13:39:57 +0200 (CEST)","by phobos.denx.de (Postfix, from userid 109)\n id D0BEE84653; Thu, 30 Apr 2026 13:39:55 +0200 (CEST)","from mail-oi1-x233.google.com (mail-oi1-x233.google.com\n [IPv6:2607:f8b0:4864:20::233])\n (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits))\n (No client certificate requested)\n by phobos.denx.de (Postfix) with ESMTPS id 591D8845E9\n for <u-boot@lists.denx.de>; Thu, 30 Apr 2026 13:39:53 +0200 (CEST)","by mail-oi1-x233.google.com with SMTP id\n 5614622812f47-4645dde00a7so1332548b6e.1\n for <u-boot@lists.denx.de>; Thu, 30 Apr 2026 04:39:53 -0700 (PDT)","from chromium.org ([174.51.25.52]) by smtp.gmail.com with ESMTPSA id\n 5614622812f47-47c43ee0400sm2715523b6e.7.2026.04.30.04.39.48\n (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n Thu, 30 Apr 2026 04:39:49 -0700 (PDT)"],"X-Spam-Checker-Version":"SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de","X-Spam-Level":"","X-Spam-Status":"No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,\n DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,\n RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS autolearn=ham\n autolearn_force=no version=3.4.2","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=chromium.org; s=google; t=1777549191; x=1778153991; darn=lists.denx.de;\n h=content-transfer-encoding:mime-version:references:in-reply-to\n :message-id:date:subject:cc:to:from:from:to:cc:subject:date\n :message-id:reply-to;\n bh=OrRYGTdyq7s0A31ABfvjf4Ro2tkXeUzCc7DLYN9Tp98=;\n b=mba1ADDnzCjkTFOiSJ1Tg6MRsCeG60kuUFydmK57UXSu0QmBW8jox+3neEbP7BEY2W\n b25B/Gd80Y+j18rMEpHK6NyJRKOG0HDubGABBuek9ltblYQxYx5jxZICSW1OWM4wnuQ9\n 8jcXukySQK+O1E4gz1q4iyp0mNvm+bSbwywMs=","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=1e100.net; s=20251104; t=1777549191; x=1778153991;\n h=content-transfer-encoding:mime-version:references:in-reply-to\n :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from\n :to:cc:subject:date:message-id:reply-to;\n bh=OrRYGTdyq7s0A31ABfvjf4Ro2tkXeUzCc7DLYN9Tp98=;\n b=onEW+AK+bJm1/Vmd1+Tw9mGsgLfuSA6TzHLyPMqFW2GP5eGrQvU0ZIVV4DVZaMxVqH\n EYAf/SWohZ+07aFnASckQnADeZX7N7iASMKnpYQThu+A3x+6N8QnytvMJiuspGw3Fka+\n SHOVdNCAJCU7r9LWRrXaSlUnv3oc9kZybYT6Rbi1BjoTTJ/UbQVdEvt2vBk6/2lsxEAm\n Z+H9YQe5TgLh2elZcmwQxR1A1JjmJkDlDPm1lkiiExsUw0To9xBv0/s4VMv1mWCogLlL\n O4okdlVeSrxKx1wNfTWb3Z/pHGbEyzm/DehFi4s2Nq+VlcuTiSxh5KlKBKYX0qizzRjd\n M7uw==","X-Gm-Message-State":"AOJu0YwS3XTCJZq+nDPmPHSuHB+fV8z3t8t3Kg6ipsgovGXXor7lmOvc\n LDRQeY+0rJeM08eKmp67HNEeYawjw+BfektbrBFsTYRJQ4HspgKHmtJAqJf47EgX+a+CgJRSY/k\n zmoLDwg==","X-Gm-Gg":"AeBDiev+UmlQPDvDm16/4YbI40wNeA5KiC2tisC++FdT/GIwJ9CZpuZkKlwXdJuQDA9\n V9m5jjb+KHcc5Z5cjf8Ex9KHGpUliRjtwRyLD7ipj3GTxs3UF6TY13FFl2yldi0s3bR50mes8wN\n 3Q4LhJQQOFbi6wtXNTBGZREceSZv0dSkxRUAK9LBIvsscwA89mLmtGB7GjNVMkRkPdFJ2wURe2q\n k29iL8Xh4I+L+w7kOjBNm0j5yJtKqzgEFjXM1Fk3vyCIm1lZW+53wMXCq9XXUsfQN72f/GUnpIN\n Pk03rOEUlzonnJOd2BVTj8hym6RgcVAjjYQ1MEBX9dHsxP0gnUm1/G2V9HshZGmgW1JOaLJLxLR\n LucFR/tUmRIkbwHoV//k53EO6GRwPpw5LsQE1XvpENxKLHWPzj0sxdP4YEHlM/XEyffvXO4JQ/T\n yaqvyAi2sop2IO8cc6pYS0MV+VHg/N","X-Received":"by 2002:a05:6808:8489:b0:47b:d07b:ec9a with SMTP id\n 5614622812f47-47c6208140bmr583516b6e.15.1777549191433;\n Thu, 30 Apr 2026 04:39:51 -0700 (PDT)","From":"Simon Glass <sjg@chromium.org>","To":"u-boot@lists.denx.de","Cc":"Quentin Schulz <quentin.schulz@cherry.de>, Simon Glass <sjg@chromium.org>,\n Heiko Schocher <hs@nabladev.com>,\n Ilias Apalodimas <ilias.apalodimas@linaro.org>,\n Tom Rini <trini@konsulko.com>","Subject":"[PATCH 1/2] bitops: Guard GENMASK and GENMASK_ULL against prior\n defines","Date":"Thu, 30 Apr 2026 05:38:33 -0600","Message-ID":"<20260430113937.1274693-2-sjg@chromium.org>","X-Mailer":"git-send-email 2.43.0","In-Reply-To":"<20260430113937.1274693-1-sjg@chromium.org>","References":"<20260430113937.1274693-1-sjg@chromium.org>","MIME-Version":"1.0","Content-Transfer-Encoding":"8bit","X-BeenThere":"u-boot@lists.denx.de","X-Mailman-Version":"2.1.39","Precedence":"list","List-Id":"U-Boot discussion <u-boot.lists.denx.de>","List-Unsubscribe":"<https://lists.denx.de/options/u-boot>,\n <mailto:u-boot-request@lists.denx.de?subject=unsubscribe>","List-Archive":"<https://lists.denx.de/pipermail/u-boot/>","List-Post":"<mailto:u-boot@lists.denx.de>","List-Help":"<mailto:u-boot-request@lists.denx.de?subject=help>","List-Subscribe":"<https://lists.denx.de/listinfo/u-boot>,\n <mailto:u-boot-request@lists.denx.de?subject=subscribe>","Errors-To":"u-boot-bounces@lists.denx.de","Sender":"\"U-Boot\" <u-boot-bounces@lists.denx.de>","X-Virus-Scanned":"clamav-milter 0.103.8 at phobos.denx.de","X-Virus-Status":"Clean"},"content":"Some headers - notably the ec_commands.h synced from upstream\nChrome OS EC - define GENMASK and GENMASK_ULL themselves before\nlinux/bitops.h is pulled in. The unguarded definitions here then trigger\na 'redefined' warning at the second site, even though both spellings\nproduce the same mask.\n\nWrap the two macros in '#ifndef' guards so a pre-existing definition\nwins. The U-Boot expressions are unchanged.\n\nSigned-off-by: Simon Glass <sjg@chromium.org>\n---\n\n include/linux/bitops.h | 4 ++++\n 1 file changed, 4 insertions(+)","diff":"diff --git a/include/linux/bitops.h b/include/linux/bitops.h\nindex 29e0da48de8..8b381c916cf 100644\n--- a/include/linux/bitops.h\n+++ b/include/linux/bitops.h\n@@ -26,6 +26,7 @@\n  * position @h. For example\n  * GENMASK_ULL(39, 21) gives us the 64bit vector 0x000000ffffe00000.\n  */\n+#ifndef GENMASK\n #ifdef CONFIG_SANDBOX\n #define GENMASK(h, l) \\\n \t(((~0UL) << (l)) & (~0UL >> (CONFIG_SANDBOX_BITS_PER_LONG - 1 - (h))))\n@@ -33,9 +34,12 @@\n #define GENMASK(h, l) \\\n \t(((~0UL) << (l)) & (~0UL >> (BITS_PER_LONG - 1 - (h))))\n #endif\n+#endif\n \n+#ifndef GENMASK_ULL\n #define GENMASK_ULL(h, l) \\\n \t(((~0ULL) << (l)) & (~0ULL >> (BITS_PER_LONG_LONG - 1 - (h))))\n+#endif\n \n /*\n  * ffs: find first bit set. This is defined the same way as\n","prefixes":["1/2"]}