Received: by 2002:a17:505:a60a:b0:1be9:327d:8ee3 with SMTP id qv10csp2545737njc; Mon, 18 Nov 2024 04:37:52 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCVlHuw8ZjqwBWv1dsoHpwJlcvSQiI9DKHoEwloe7I/tMiM+DyWWuVbq1MLvCR422AXWaYHIMikVjwiKxw==@linaro.org X-Google-Smtp-Source: AGHT+IH7O3AmSP8h5f/GWvn+L9mxUJx8FRS0VJ6xV3vmdkNXAtJdDo30HwwkOErQkIW0voo3iLWE X-Received: by 2002:a05:690c:46c7:b0:6ee:6ab5:8599 with SMTP id 00721157ae682-6ee6ab5896dmr93658527b3.27.1731933472045; Mon, 18 Nov 2024 04:37:52 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1731933472; cv=none; d=google.com; s=arc-20240605; b=lQXLHa2YJYnXSPP5ELixEnJqIhO+2mV2vGY/dHD1cNALlLaruKVGNAgSmljc/cySRJ BFnkHLAxZF3L+HKEi3p+MkrgvBQyIQTnR+5LsMgvnPHTIQ+Yxb3VVWYzKXLAJgGi3S6x dyXFbmPbYuuTdzzhl9nKOxGbYZxpbQpdiX0i0zL+RZYj7zzY+uODxhY3RkTL8tRxfiEr phs4B6bB0XqApahEL4EE8sXElY60lRkJMKUPbauKP9VPk1ZkWPdAhflHcMD0a41OtIVx fVsIqS+0giRBPyFCpoEvb0+P2Byw/xU3IzGqse8OjQU04lW5VrJ9HJsZp8TAP1d95skP ubSA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :in-reply-to:from:content-language:references:cc:to:subject :user-agent:mime-version:date:message-id:dkim-signature; bh=Vd7pbdXii55017LG60srcuEq1aqp17J3bfINrh/lbU0=; fh=A9aZ+ZOe4A6M85kao9F1DJ1kfYKBJLJ7u7uHAa6qyWA=; b=Jw+wbEbwABTghyeUHdiLDiwV02njWBmUUh1B2hZYONNiGThlk+F3A6R6Q3LmVJh9xN PbURaZFzNAyl7vwznolV0wJJZ8HljlWtDCDDH0ArWAkXrabo/FurBVV7HjDaTS40PK80 5R7UAAJ8Mx8naPKJjeWRF+D0pHunDNThSz6qXd3ZVb02vo1QpdFcPXWMARRjH/v5aLSG YCRNgQdH61fdGmcWQQmFF5ASZv/GhfvpV6DiTBfHWTX2gy4YZcvTNfbxdEMMNxPrgogG UAG+sO9Kq1UclSlnC7N1fmcD1eqS/PyQWLQaLh1i6qhCWU3J8pvFEHwJVwPao16kZVzQ /WRA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=lVMoJQyf; spf=pass (google.com: domain of qemu-devel-bounces+alex.bennee=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+alex.bennee=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id 6a1803df08f44-6d40dc40193si62967526d6.191.2024.11.18.04.37.51 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 18 Nov 2024 04:37:52 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+alex.bennee=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=lVMoJQyf; spf=pass (google.com: domain of qemu-devel-bounces+alex.bennee=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+alex.bennee=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tD10g-0003Bm-QE; Mon, 18 Nov 2024 07:37:43 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tD10Z-00031x-TO for qemu-devel@nongnu.org; Mon, 18 Nov 2024 07:37:36 -0500 Received: from mail-wm1-x32b.google.com ([2a00:1450:4864:20::32b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tD10X-0003yy-6r for qemu-devel@nongnu.org; Mon, 18 Nov 2024 07:37:35 -0500 Received: by mail-wm1-x32b.google.com with SMTP id 5b1f17b1804b1-43169902057so34189985e9.0 for ; Mon, 18 Nov 2024 04:37:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1731933451; x=1732538251; darn=nongnu.org; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=Vd7pbdXii55017LG60srcuEq1aqp17J3bfINrh/lbU0=; b=lVMoJQyf4ozuGvQFMU37r+6zgYepvw1jM76XWklKJhP+FWaW+QlcHNfg0ibz4vMAQC /tTYw2MztRcVcxzgaLtFHbVFV7j/ts2c6oWSpsk4q6StiPTpkEJw43Tx+ZF4gq3Ex/ch ex+yZYehrns6XvDjVjCE+/9/A/56c0bf4CEqbR6cu5z0AaukywblMoLnO/+hzzipVHgl FJ3ysQ9z9qXU2Wi0iBTaSytaUo//mls42wCgD/jZyULPKc2gFS63EQ1r4r7z0IdwGlHi RAavavVAUSWqOMNTao48YxVVVtrPKOpCwJGuB6rbzmv1etUCarTmvXVYAqmn5dJdBCV/ zhcQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1731933451; x=1732538251; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=Vd7pbdXii55017LG60srcuEq1aqp17J3bfINrh/lbU0=; b=kOwfL0mKAIqHOOsNc/DOnQzsnRTUS4TsSWoxwcoEMblOJ5x2IP3t6eyv3QVax6ORJu 7jw7RfV4Iet6Xjv36TzUUBe7kZFMR62nuZOk46/kC8649W9hOcNmH8ZOvZ3ZvxhU2EmN mDLkV2UjIZMwRZEDGWHAU0S+K2gw1kWKIKxAEeCJEgoOGqQmU7Z3qyjaKW9+DtiYFTko 8IZz8EGV/gns8wHBYBl+CT5KAOf1Eleu8YyRhJFBmoO9NJHOnhJIoLwo/BcP2/W0Keqb WqeCWCznysu0fRz4ktj+Lip5naOKuL0tqM/li+Uwu1Ll5kzxFceJLq5xB34LdxFwMIuS 5O9g== X-Forwarded-Encrypted: i=1; AJvYcCWnuwP3fbDJdBG2dMsmr+jmp6nINbBp0TUamVGldtqX+NlFlVDrUOmyea3kYQ0eM1wICTb81C6oVj/b@nongnu.org X-Gm-Message-State: AOJu0YzcybYo7CI47Ze8IS9JcRSzaTjgAQn6y2JB+mLxK9K/WluZEnA/ 17m+0jmvdVHB3FUZfJszxBchkQhVMd3LtdGUpadaep3IwCTLjGj77EsDz81ZtTNbUldBNEfw21s o X-Received: by 2002:a05:600c:1c98:b0:431:60ec:7a91 with SMTP id 5b1f17b1804b1-432df71c4bamr109259245e9.2.1731933450947; Mon, 18 Nov 2024 04:37:30 -0800 (PST) Received: from [192.168.69.197] ([176.187.198.1]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-3821ae313a8sm12507385f8f.105.2024.11.18.04.37.29 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 18 Nov 2024 04:37:30 -0800 (PST) Message-ID: Date: Mon, 18 Nov 2024 13:37:29 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH] hw/misc/nrf51_rng: Don't use BIT_MASK() when we mean BIT() To: Peter Maydell , qemu-arm@nongnu.org, qemu-devel@nongnu.org Cc: Joel Stanley References: <20241108135644.4007151-1-peter.maydell@linaro.org> Content-Language: en-US From: =?UTF-8?Q?Philippe_Mathieu-Daud=C3=A9?= In-Reply-To: <20241108135644.4007151-1-peter.maydell@linaro.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Received-SPF: pass client-ip=2a00:1450:4864:20::32b; envelope-from=philmd@linaro.org; helo=mail-wm1-x32b.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+alex.bennee=linaro.org@nongnu.org Sender: qemu-devel-bounces+alex.bennee=linaro.org@nongnu.org X-TUID: jsuwARqjyaFw On 8/11/24 13:56, Peter Maydell wrote: > The BIT_MASK() macro from bitops.h provides the mask of a bit > within a particular word of a multi-word bit array; it is intended > to be used with its counterpart BIT_WORD() that gives the index > of the word in the array. > > In nrf51_rng we are using it for cases where we have a bit number > that we know is the index of a bit within a single word (in fact, it > happens that all the bit numbers we pass to it are zero). This > happens to give the right answer, but the macro that actually > does the job we want here is BIT(). > > Use BIT() instead of BIT_MASK(). > > Signed-off-by: Peter Maydell > --- > hw/misc/nrf51_rng.c | 10 +++++----- > 1 file changed, 5 insertions(+), 5 deletions(-) Patch queued to hw-misc, thanks.