From nobody Mon May 25 08:12:02 2026 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) (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 0BE873DC856 for ; Fri, 15 May 2026 18:34:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.133.124 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778870101; cv=none; b=SX4h9ViRPMzCmqH9OK9UGGW+cm9E0X8i5Wi7tcaRehlIr8ZlgJUuturJURwxF7i2gc4N5FO7jv4rZXfm7KQu0y0ShYLQXYO3faRBz79EoeIDP86EFtWTaRUlHTr7iNEqJN7WW/3ZDB+4wpis+aDjhkN0jxWG2bYe70aSMALYfsA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778870101; c=relaxed/simple; bh=zvBnzklS3nPXZ0X6Rn3CwrpovUEonxYW/EYAMvy7waY=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=lyr1i/tiuGTSWhiC23Nh9hcqCpftZRVPvvbfPocIan+C4u0Mc3xViKq6uxJx9T8+2nASaCQ4vJzbmKqcTUOIG1D3L/4po90dLOMMGFdyBcZbdz4Vz9SZmNC9ndu3OSg7Gbm4rq0kji6sjU/rMINygcbd+ctgcivHJRmThsdblWc= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=jWltJFBK; dkim=pass (2048-bit key) header.d=redhat.com header.i=@redhat.com header.b=OhAy5zJH; arc=none smtp.client-ip=170.10.133.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="jWltJFBK"; dkim=pass (2048-bit key) header.d=redhat.com header.i=@redhat.com header.b="OhAy5zJH" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1778870096; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=GsP229H76J3sjOJ/aTPAhVau62lkt0C7NIxpmxi0Kc8=; b=jWltJFBKsf2IC9u9cZ3h6LaFupXlmKMnI6Lold3kFqiDFqaALHt5diNmj1O5c/kEWBY00C qdR9XZ4Of4AXvX2KMxV/RW1Jm3WEdwMVw+JycsTN/KtTKNAY3xZlAxGp7tkuIsvmYF/1xD roD7CKA0r8NIgFdA6ijT3+cPFmB1pKs= Received: from mail-wm1-f69.google.com (mail-wm1-f69.google.com [209.85.128.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-388-4jbdTtT7OJ2jKELOJnr6gQ-1; Fri, 15 May 2026 14:34:55 -0400 X-MC-Unique: 4jbdTtT7OJ2jKELOJnr6gQ-1 X-Mimecast-MFC-AGG-ID: 4jbdTtT7OJ2jKELOJnr6gQ_1778870094 Received: by mail-wm1-f69.google.com with SMTP id 5b1f17b1804b1-48fe3e73da6so498835e9.2 for ; Fri, 15 May 2026 11:34:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=google; t=1778870094; x=1779474894; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=GsP229H76J3sjOJ/aTPAhVau62lkt0C7NIxpmxi0Kc8=; b=OhAy5zJHpkE0mJIJ+7pTWS2yEwZ7IKLmKW/uUrWou0FWMa6aHaVchILfb6dDyZjEiq A2GqBTwnvNwSN3KpgBlnGrq24gcf37bJvar+6XhO6hkohodEUAfFuXaqQfnp+6iJRlim Blg2TBpSc/CvijYFdN7dSfc+CuMiZ5MEEaRVFW0Jui35mAZjNwfBp1xIc+Hm8QTtSCRs nfFfmWiVoTGuR6B3/pjckvWCCl79jc7AvPrzhEe33Z7O7rL8fwzpbr1JQa5m3wdmuqjh JAvei42mt8VPfZVUi6OyVa2iIUqXbbgfrhQFSXZImDrSlgXJZciFO2UkCUc2n4Rb2naR q5Wg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1778870094; x=1779474894; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=GsP229H76J3sjOJ/aTPAhVau62lkt0C7NIxpmxi0Kc8=; b=PWzxLe1gJO3pRaL+ES/J2zx0uWP0iaK5ZRHWybbDM3DOTwKfOMldVkfSIeVXrKi0iE L8VonGFChmLv4UYwf2sNYgvdF06jjxWcje81fzy0AF/AyrEYYRUDac5kLERwk+sSsavn dua58QzWCFyeBGu6e9JYIz4dcY9ysD89EU8ThtTtnFos5edqEpuNjmu7NDwJP7Zls/xR 5w2X/D1AdhVEkESD4UzDYldzr8FUhngf5wQ893V2joDHAbHDqAihKbrrU+BMlKEBbFwa 4jTU57ZEXd9UXVEBZ4t4ncbFSW/SGGebzHQotGcRH7OOMwRNvAkc/vISHN8jTuqEy8ZT 7gzg== X-Forwarded-Encrypted: i=1; AFNElJ/M2Lqxj0KVtjOONPdvHjs+ra8zA8G4ethOZLLL8q9r4Ez6bCIr4DCecrRvjdXTDWecRHDTpD30TJFQe+U=@vger.kernel.org X-Gm-Message-State: AOJu0Ywqu73vWF+FCbRLf72zjDbUwcjDw+G1t2P+hMj03VoLxnChVmaC g1s4u0whm71NsSL/QWh8vquez3DKjwcJWXOVIvgKhh/y/s6Knc0hLorCynnS47pg/Jf4BW8iRp7 sUPw0r0RVQr68aQXgsb/sbC2qJlBE+NuZTrkqiNiG38v/CLaTkeftTh1fKsk0JSChFQ== X-Gm-Gg: Acq92OG/qfeLa/TXZ7701a7IlUS5Thf9vjKA7F86Cec7arggAfZAZK/CPvgRLabf9sy B7i6nwdZobGIDamQtJvQui9R3+36YOyACDJnIDSKJFyjoqQMgpQglzE5kACwFTIDVJcu9dQXxLR mQLpQLAOv8cxDGTBqLCss2bc7nPQJKOAlIiIc8THkNtU/uqw4QA+RgLrkeH5g79jBMmy3YBj8o9 DF81STFIHGmBJpYa3PVdEr8/s3puoxC2SNUkTxCCXcONyrcrUkE52kr2elb9Zo54yJYgbP/vtHa uRYAvg/W5n3iwJgpNe3NbRFugjHoe6wPfBD0x86jtOD2EnjUbgIebaWtAMxdUn1YomoiW9J4hIN HFgjkNWfjOLkyIDMz9A45Lc5LogFyNbvBBSM= X-Received: by 2002:a05:600c:6995:b0:489:1f97:6b1d with SMTP id 5b1f17b1804b1-48fe6322219mr73762715e9.28.1778870093919; Fri, 15 May 2026 11:34:53 -0700 (PDT) X-Received: by 2002:a05:600c:6995:b0:489:1f97:6b1d with SMTP id 5b1f17b1804b1-48fe6322219mr73762375e9.28.1778870093481; Fri, 15 May 2026 11:34:53 -0700 (PDT) Received: from costa-tp.bos2.lab ([2a00:a041:e223:1b00:fe51:8bb:7986:c897]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-48febe5bc94sm42427305e9.4.2026.05.15.11.34.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 May 2026 11:34:52 -0700 (PDT) From: Costa Shulyupin To: Nicolas Pitre , Andrew Morton , linux-kernel@vger.kernel.org Cc: Costa Shulyupin Subject: [PATCH v1] include: Remove unused cnt32_to_63.h Date: Fri, 15 May 2026 21:34:24 +0300 Message-ID: <20260515183429.1503740-1-costa.shul@redhat.com> X-Mailer: git-send-email 2.53.0 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 Content-Type: text/plain; charset="utf-8" All users have been removed over time as ARM and other architectures switched to generic sched_clock. The last user was microblaze, removed in commit 839396ab88e4 ("microblaze: timer: Use generic sched_clock implementation"). Assisted-by: Claude:claude-opus-4-6 Signed-off-by: Costa Shulyupin --- include/linux/cnt32_to_63.h | 104 ------------------------------------ 1 file changed, 104 deletions(-) delete mode 100644 include/linux/cnt32_to_63.h diff --git a/include/linux/cnt32_to_63.h b/include/linux/cnt32_to_63.h deleted file mode 100644 index 064428479f2d..000000000000 --- a/include/linux/cnt32_to_63.h +++ /dev/null @@ -1,104 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0-only */ -/* - * Extend a 32-bit counter to 63 bits - * - * Author: Nicolas Pitre - * Created: December 3, 2006 - * Copyright: MontaVista Software, Inc. - */ - -#ifndef __LINUX_CNT32_TO_63_H__ -#define __LINUX_CNT32_TO_63_H__ - -#include -#include -#include - -/* this is used only to give gcc a clue about good code generation */ -union cnt32_to_63 { - struct { -#if defined(__LITTLE_ENDIAN) - u32 lo, hi; -#elif defined(__BIG_ENDIAN) - u32 hi, lo; -#endif - }; - u64 val; -}; - - -/** - * cnt32_to_63 - Expand a 32-bit counter to a 63-bit counter - * @cnt_lo: The low part of the counter - * - * Many hardware clock counters are only 32 bits wide and therefore have - * a relatively short period making wrap-arounds rather frequent. This - * is a problem when implementing sched_clock() for example, where a 64-bit - * non-wrapping monotonic value is expected to be returned. - * - * To overcome that limitation, let's extend a 32-bit counter to 63 bits - * in a completely lock free fashion. Bits 0 to 31 of the clock are provid= ed - * by the hardware while bits 32 to 62 are stored in memory. The top bit = in - * memory is used to synchronize with the hardware clock half-period. When - * the top bit of both counters (hardware and in memory) differ then the - * memory is updated with a new value, incrementing it when the hardware - * counter wraps around. - * - * Because a word store in memory is atomic then the incremented value will - * always be in synch with the top bit indicating to any potential concurr= ent - * reader if the value in memory is up to date or not with regards to the - * needed increment. And any race in updating the value in memory is harm= less - * as the same value would simply be stored more than once. - * - * The restrictions for the algorithm to work properly are: - * - * 1) this code must be called at least once per each half period of the - * 32-bit counter; - * - * 2) this code must not be preempted for a duration longer than the - * 32-bit counter half period minus the longest period between two - * calls to this code; - * - * Those requirements ensure proper update to the state bit in memory. - * This is usually not a problem in practice, but if it is then a kernel - * timer should be scheduled to manage for this code to be executed often - * enough. - * - * And finally: - * - * 3) the cnt_lo argument must be seen as a globally incrementing value, - * meaning that it should be a direct reference to the counter data whi= ch - * can be evaluated according to a specific ordering within the macro, - * and not the result of a previous evaluation stored in a variable. - * - * For example, this is wrong: - * - * u32 partial =3D get_hw_count(); - * u64 full =3D cnt32_to_63(partial); - * return full; - * - * This is fine: - * - * u64 full =3D cnt32_to_63(get_hw_count()); - * return full; - * - * Note that the top bit (bit 63) in the returned value should be consider= ed - * as garbage. It is not cleared here because callers are likely to use a - * multiplier on the returned value which can get rid of the top bit - * implicitly by making the multiplier even, therefore saving on a runtime - * clear-bit instruction. Otherwise caller must remember to clear the top - * bit explicitly. - */ -#define cnt32_to_63(cnt_lo) \ -({ \ - static u32 __m_cnt_hi; \ - union cnt32_to_63 __x; \ - __x.hi =3D __m_cnt_hi; \ - smp_rmb(); \ - __x.lo =3D (cnt_lo); \ - if (unlikely((s32)(__x.hi ^ __x.lo) < 0)) \ - __m_cnt_hi =3D __x.hi =3D (__x.hi ^ 0x80000000) + (__x.hi >> 31); \ - __x.val; \ -}) - -#endif --=20 2.53.0