From: Vinicius Pedrosa <vinicius.eduardo.pedrosa@gmail.com>
To: ilpo.jarvinen@linux.intel.com
Cc: andriy.shevchenko@linux.intel.com, jirislaby@kernel.org,
linux-serial@vger.kernel.org, gregkh@linuxfoundation.org,
robh@kernel.org, krzk+dt@kernel.org, conor+dt@kernel.org,
devicetree@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-sunxi@lists.linux.dev, andre.przywara@arm.com,
wens@kernel.org, jernej.skrabec@gmail.com, samuel@sholland.org,
enzo.adriano.code@gmail.com
Subject: Re: [PATCH v2 2/4] serial: 8250_dw: Only accept a contiguous DLF readback
Date: Tue, 20 Oct 2026 09:27:46 -0300 [thread overview]
Message-ID: <20261020122746.41699-1-vinicius.eduardo.pedrosa@gmail.com> (raw)
In-Reply-To: <09812a6a-dd0d-9c47-e1ad-5220f1954648@linux.intel.com>
Hi Ilpo,
On Tue, 20 Oct 2026, Ilpo Järvinen wrote:
> For is_power_of_2(), 0 is not a power of two. And it also wouldn't make
> sense to have zero bits in the bit field as it's same as no bit field so
> using just is_power_of_2() should be enough.
I think the reg != 0 check still needs to stay here, since the test is
is_power_of_2(reg + 1), rather than is_power_of_2(reg).
For reg == 0, reg + 1 is 1, and is_power_of_2(1) is true. So without
the explicit reg check, a zero readback, meaning no DLF, would be
accepted as a valid DLF.
I'll keep it as:
reg && is_power_of_2(reg + 1)
in v3.
Thanks,
Vinicius
next prev parent reply other threads:[~2026-10-20 12:28 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-19 20:06 [PATCH v2 0/4] serial: 8250_dw: Allwinner A733 UART support Vinicius Pedrosa
2026-10-19 20:06 ` [PATCH v2 1/4] serial: 8250_dw: Keep the BUSY-safe divisor hook when DLF is present Vinicius Pedrosa
2026-10-20 8:30 ` Andy Shevchenko
2026-10-20 8:51 ` Andy Shevchenko
2026-10-20 10:47 ` Vinicius Pedrosa
2026-10-19 20:06 ` [PATCH v2 2/4] serial: 8250_dw: Only accept a contiguous DLF readback Vinicius Pedrosa
2026-10-20 6:11 ` Jiri Slaby
2026-10-20 8:31 ` Andy Shevchenko
2026-10-20 11:50 ` Ilpo Järvinen
2026-10-20 12:27 ` Vinicius Pedrosa [this message]
2026-10-20 10:47 ` Vinicius Pedrosa
2026-10-19 20:06 ` [PATCH v2 3/4] dt-bindings: serial: snps-dw-apb-uart: Add Allwinner A733 Vinicius Pedrosa
2026-10-19 20:06 ` [PATCH v2 4/4] serial: 8250_dw: Add Allwinner A733 UART Vinicius Pedrosa
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20261020122746.41699-1-vinicius.eduardo.pedrosa@gmail.com \
--to=vinicius.eduardo.pedrosa@gmail.com \
--cc=andre.przywara@arm.com \
--cc=andriy.shevchenko@linux.intel.com \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=enzo.adriano.code@gmail.com \
--cc=gregkh@linuxfoundation.org \
--cc=ilpo.jarvinen@linux.intel.com \
--cc=jernej.skrabec@gmail.com \
--cc=jirislaby@kernel.org \
--cc=krzk+dt@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-serial@vger.kernel.org \
--cc=linux-sunxi@lists.linux.dev \
--cc=robh@kernel.org \
--cc=samuel@sholland.org \
--cc=wens@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®