[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <YBu8bRth+4wyvql/@hirez.programming.kicks-ass.net>
Date: Thu, 4 Feb 2021 10:20:45 +0100
From: Peter Zijlstra <peterz@...radead.org>
To: Shuah Khan <skhan@...uxfoundation.org>
Cc: corbet@....net, gregkh@...uxfoundation.org, keescook@...omium.org,
rafael@...nel.org, lenb@...nel.org, james.morse@....com,
tony.luck@...el.com, bp@...en8.de, linux-kernel@...r.kernel.org,
linux-doc@...r.kernel.org, linux-acpi@...r.kernel.org,
linux-kselftest@...r.kernel.org, devel@...verdev.osuosl.org
Subject: Re: [PATCH v3 1/7] seqnum_ops: Introduce Sequence Number Ops
On Wed, Feb 03, 2021 at 11:11:57AM -0700, Shuah Khan wrote:
> +static inline u32 seqnum32_inc(struct seqnum32 *seq)
> +{
> + atomic_t val = ATOMIC_INIT(seq->seqnum);
> +
> + seq->seqnum = (u32) atomic_inc_return(&val);
> + if (seq->seqnum >= UINT_MAX)
> + pr_info("Sequence Number overflow %u detected\n",
> + seq->seqnum);
> + return seq->seqnum;
> +}
What kind of broken garbage is that?
Powered by blists - more mailing lists