The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@linaro.org>
To: Qianfeng Rong <rongqianfeng@vivo.com>
Cc: Dave Penkler <dpenkler@gmail.com>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Michael Rubin <matchstick@neverthere.org>,
	Arnd Bergmann <arnd@arndb.de>,
	linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] staging: gpib: use int instead of u32 to store error codes
Date: Tue, 26 Aug 2025 13:19:10 +0300	[thread overview]
Message-ID: <aK2KHhaFqWbd5S_O@stanley.mountain> (raw)
In-Reply-To: <20250826095907.239992-1-rongqianfeng@vivo.com>

On Tue, Aug 26, 2025 at 05:58:59PM +0800, Qianfeng Rong wrote:
> Use int instead of size_t for 'ret' variable to store negative error codes
> returned by bb_write().
> 

The commit message needs to give a motivation.  I would have assumed from
reading the patch that this caused a signedness bug but it doesn't.
The commit has no effect on runtime but fixing the type is a nice
cleanup.  My commit message would say:

The "ret" variable is used to store the return from bb_write() returns
either zero on success or negative error codes on failure.  Storing the
error codes in size_t which is an unsigned long, doesn't cause an issue
at runtime but it's ugly as pants.  Change "ret" from size_t to int
type.  No effect on runtime.

regards,
dan carpenter


  reply	other threads:[~2025-08-26 10:19 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-08-26  9:58 [PATCH] staging: gpib: use int instead of u32 to store error codes Qianfeng Rong
2025-08-26 10:19 ` Dan Carpenter [this message]
2025-08-26 11:49   ` Qianfeng Rong

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=aK2KHhaFqWbd5S_O@stanley.mountain \
    --to=dan.carpenter@linaro.org \
    --cc=arnd@arndb.de \
    --cc=dpenkler@gmail.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-staging@lists.linux.dev \
    --cc=matchstick@neverthere.org \
    --cc=rongqianfeng@vivo.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox