Linux Input/HID development
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Qianhui Xu" <xiaqinghuan@mail.ustc.edu.cn>
Cc: linux-input@vger.kernel.org, devicetree@vger.kernel.org,
	robh@kernel.org, conor+dt@kernel.org, dmitry.torokhov@gmail.com
Subject: Re: [PATCH v4 7/7] Input: novatek-nvt-ts - add no-flash firmware download
Date: Wed, 02 Dec 2026 06:21:11 +0000	[thread overview]
Message-ID: <sashiko-outbox-244954@kernel.org> (raw)
In-Reply-To: <20261202061414.548247-7-xiaqinghuan@mail.ustc.edu.cn>

Thank you for your contribution! Sashiko AI review found 1 potential
issue to consider:
- [Low] Input: novatek-nvt-ts - define and init __free() xfer in
  nvt_ts_fw_upload()
--

commit 37d2804e1f12997c5e5c4cc59ef2a593b658cd11
Author: Qianhui Xu <xiaqinghuan@mail.ustc.edu.cn>

Input: novatek-nvt-ts - add no-flash firmware download

This commit adds host-side SRAM firmware upload support for Novatek
touchscreen controllers without on-board flash.

> diff --git a/drivers/input/touchscreen/novatek-nvt-ts-core.c b/drivers/input/touchscreen/novatek-nvt-ts-core.c
> index 89e7f1eaf39c9..fb03ef3202622 100644
> --- a/drivers/input/touchscreen/novatek-nvt-ts-core.c
> +++ b/drivers/input/touchscreen/novatek-nvt-ts-core.c

[ ... ]

> @@ -160,6 +168,505 @@ static irqreturn_t nvt_ts_irq(int irq, void *dev_id)

[ ... ]

> +static int nvt_ts_fw_upload(struct nvt_ts_data *data,
> +			    const struct firmware *fw)
> +{
> +	u8 *xfer __free(kfree) = NULL;
> +	struct nvt_ts_fw_partition partitions[NVT_TS_FW_MAX_PARTITIONS] = {};
> +	unsigned int num_partitions, i;
> +	u8 reset_done[7] = { NVT_TS_FW_EVENT_RESET_DONE | BIT(7) };
> +	u8 host_cmd[] = { NVT_TS_FW_EVENT_HOST_CMD | BIT(7), 0xae, 0 };
> +	bool cascade;
> +	int error;
> +
> +	error = nvt_ts_fw_parse(fw, partitions, &num_partitions, &cascade);
> +	if (error)
> +		return error;
> +
> +	xfer = kmalloc(NVT_TS_FW_XFER_LEN + 1, GFP_KERNEL);
> +	if (!xfer)
> +		return -ENOMEM;

[Severity: Low]
This isn't a bug, but cleanup.h conventions prefer defining and initializing
__free() variables in a single statement at the allocation site rather than
declaring xfer = NULL at the top of nvt_ts_fw_upload() and assigning it later:

	u8 *xfer __free(kfree) = kmalloc(NVT_TS_FW_XFER_LEN + 1, GFP_KERNEL);

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261202061414.548247-1-xiaqinghuan@mail.ustc.edu.cn?part=7

      reply	other threads:[~2026-12-02  6:21 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-12-02  6:14 [PATCH v4 1/7] Input: novatek-nvt-ts - add transport ops abstraction Qianhui Xu
2026-12-02  6:14 ` [PATCH v4 2/7] Input: novatek-nvt-ts - split bus independent core out Qianhui Xu
2026-12-02  6:14 ` [PATCH v4 3/7] Input: novatek-nvt-ts - add SPI bus support Qianhui Xu
2026-12-02  6:21   ` sashiko-bot
2026-12-02  6:14 ` [PATCH v4 4/7] dt-bindings: input: novatek,nvt-ts - allow SPI wiring Qianhui Xu
2026-12-02  6:14 ` [PATCH v4 5/7] Input: novatek-nvt-ts - add NT36536 packet decoding Qianhui Xu
2026-12-02  6:14 ` [PATCH v4 6/7] dt-bindings: input: novatek,nvt-ts - add the NT36536 compatible Qianhui Xu
2026-12-02  6:14 ` [PATCH v4 7/7] Input: novatek-nvt-ts - add no-flash firmware download Qianhui Xu
2026-12-02  6:21   ` 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-244954@kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=dmitry.torokhov@gmail.com \
    --cc=linux-input@vger.kernel.org \
    --cc=robh@kernel.org \
    --cc=sashiko-reviews@lists.linux.dev \
    --cc=xiaqinghuan@mail.ustc.edu.cn \
    /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