From: sashiko-bot@kernel.org
To: 兰涛 <tao.lan@d-robotics.cc>,
miquel.raynal@bootlin.com, linux-mtd@lists.infradead.org
Cc: richard@nod.at, vigneshr@ti.com, broonie@kernel.org,
vikrantyadav4802@gmail.com
Subject: Re: [PATCH] mtd: spinand: Avoid encoding the plane select bit twice
Date: Fri, 04 Dec 2026 08:02:53 +0000 [thread overview]
Message-ID: <sashiko-outbox-249358@kernel.org> (raw)
In-Reply-To: <20261204074839.3822300-1-tao.lan@d-robotics.cc>
Thank you for your contribution! Sashiko AI review found 1 potential
issue to consider:
- [Low] mtd: spinand: unused plane-select flags left in spinand.h and
macronix.c
--
commit dee6d9d83747207bf94a0171dd2e3e69a66c20de
Author: tao.lan <tao.lan@d-robotics.cc>
mtd: spinand: Avoid encoding the plane select bit twice
This commit removes the plane-select bit encoding from
spinand_read_from_cache_op() and spinand_write_to_cache_op(), leaving
plane addressing solely to the dirmap descriptor base offset set by
spinand_create_dirmap().
> diff --git a/drivers/mtd/nand/spi/core.c b/drivers/mtd/nand/spi/core.c
> index e883745299a4e..176fd8bcf689e 100644
> --- a/drivers/mtd/nand/spi/core.c
> +++ b/drivers/mtd/nand/spi/core.c
> @@ -531,9 +531,6 @@ static int spinand_read_from_cache_op(struct spinand_device *spinand,
> else
> rdesc->info.op_tmpl->data.ecc = false;
>
> - if (spinand->flags & SPINAND_HAS_READ_PLANE_SELECT_BIT)
> - column |= req->pos.plane << fls(nanddev_page_size(nand));
> -
> while (nbytes) {
> ret = spi_mem_dirmap_read(rdesc, column, nbytes, buf);
> if (ret < 0)
> @@ -625,9 +622,6 @@ static int spinand_write_to_cache_op(struct spinand_device *spinand,
> else
> wdesc->info.op_tmpl->data.ecc = false;
>
> - if (spinand->flags & SPINAND_HAS_PROG_PLANE_SELECT_BIT)
> - column |= req->pos.plane << fls(nanddev_page_size(nand));
> -
> while (nbytes) {
> ret = spi_mem_dirmap_write(wdesc, column, nbytes, buf);
> if (ret < 0)
[Severity: Low]
Should SPINAND_HAS_READ_PLANE_SELECT_BIT and SPINAND_HAS_PROG_PLANE_SELECT_BIT
also be removed from include/linux/mtd/spinand.h and
drivers/mtd/nand/spi/macronix.c?
Deleting these two checks removes the only readers of both flags in the tree,
since spinand_create_dirmap() already encodes the plane unconditionally.
Leaving the unused definitions and macronix_spinand_table entries behind makes
it look like those flags still control column plane addressing.
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261204074839.3822300-1-tao.lan@d-robotics.cc?part=1
______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/
prev parent reply other threads:[~2026-12-04 8:03 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-12-04 7:48 [PATCH] mtd: spinand: Avoid encoding the plane select bit twice 兰涛
2026-12-04 7:48 ` 兰涛
2026-12-04 8:02 ` sashiko-bot [this message]
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=sashiko-outbox-249358@kernel.org \
--to=sashiko-bot@kernel.org \
--cc=broonie@kernel.org \
--cc=linux-mtd@lists.infradead.org \
--cc=miquel.raynal@bootlin.com \
--cc=richard@nod.at \
--cc=sashiko-reviews@lists.linux.dev \
--cc=tao.lan@d-robotics.cc \
--cc=vigneshr@ti.com \
--cc=vikrantyadav4802@gmail.com \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.