From nobody Fri Dec 19 10:35:53 2025 Received: from szxga03-in.huawei.com (szxga03-in.huawei.com [45.249.212.189]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 29FCD18EBF for ; Tue, 3 Sep 2024 03:45:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=45.249.212.189 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725335137; cv=none; b=iGNjlOOL2boImxnyk3eN8agvMOwQS2IL3c6kwEq7voTtUOEP3bbVXL6yiDZimKSrCkRoAH+KYoojPwHbfRPGfq+NTX50vvHXWl+pOdQrtpgJ/JYzB2XBuwgYZb89Bw1oZEKZ1hKijoS34HjlCgTQs3sxZT6wxlsJcoXTmTy/J0o= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725335137; c=relaxed/simple; bh=DR3kwa3/bIos73yr5KF/QcBGcUaNM7F9rCDjs0fwhCM=; h=From:To:CC:Subject:Date:Message-ID:MIME-Version:Content-Type; b=BnBzE73iUh3lNCsKh1rHXUziUXoLuNBWlsykGVfYs0OAJ1M7IMajeFuz+WIJanhyPSWXucEZNwVaFJ+VjKolnVve8K/n89h0ImK94JWVFfEMkhNzctLmMZpNV5U+4dZiclGg7lo5a+MFU3u+HdOrq6oaz0+Qp5A4vwCYGyCbyes= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com; spf=pass smtp.mailfrom=huawei.com; arc=none smtp.client-ip=45.249.212.189 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=huawei.com Received: from mail.maildlp.com (unknown [172.19.162.254]) by szxga03-in.huawei.com (SkyGuard) with ESMTP id 4WyWc50Yksz69RJ; Tue, 3 Sep 2024 11:40:37 +0800 (CST) Received: from kwepemh500013.china.huawei.com (unknown [7.202.181.146]) by mail.maildlp.com (Postfix) with ESMTPS id 28A9A18010B; Tue, 3 Sep 2024 11:45:33 +0800 (CST) Received: from huawei.com (10.90.53.73) by kwepemh500013.china.huawei.com (7.202.181.146) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.11; Tue, 3 Sep 2024 11:45:32 +0800 From: Jinjie Ruan To: , , , , CC: Subject: [PATCH -next v2 RESEND] printk: Use the BITS_PER_LONG macro Date: Tue, 3 Sep 2024 11:53:58 +0800 Message-ID: <20240903035358.308482-1-ruanjinjie@huawei.com> X-Mailer: git-send-email 2.34.1 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-ClientProxiedBy: dggems702-chm.china.huawei.com (10.3.19.179) To kwepemh500013.china.huawei.com (7.202.181.146) Content-Type: text/plain; charset="utf-8" sizeof(unsigned long) * 8 is the number of bits in an unsigned long variable, replace it with BITS_PER_LONG macro to make it simpler. Signed-off-by: Jinjie Ruan Reviewed-by: John Ogness Reviewed-by: Petr Mladek --- v2: - Add include. --- kernel/printk/printk_ringbuffer.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/kernel/printk/printk_ringbuffer.h b/kernel/printk/printk_ringb= uffer.h index bd2a892deac1..8de6c495cf2b 100644 --- a/kernel/printk/printk_ringbuffer.h +++ b/kernel/printk/printk_ringbuffer.h @@ -4,6 +4,7 @@ #define _KERNEL_PRINTK_RINGBUFFER_H =20 #include +#include #include #include #include @@ -122,7 +123,7 @@ enum desc_state { =20 #define _DATA_SIZE(sz_bits) (1UL << (sz_bits)) #define _DESCS_COUNT(ct_bits) (1U << (ct_bits)) -#define DESC_SV_BITS (sizeof(unsigned long) * 8) +#define DESC_SV_BITS BITS_PER_LONG #define DESC_FLAGS_SHIFT (DESC_SV_BITS - 2) #define DESC_FLAGS_MASK (3UL << DESC_FLAGS_SHIFT) #define DESC_STATE(sv) (3UL & (sv >> DESC_FLAGS_SHIFT)) --=20 2.34.1