All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Russell King (Oracle)" <linux@armlinux.org.uk>
To: Haotian Zhang <vulab@iscas.ac.cn>
Cc: viro@zeniv.linux.org.uk, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] adfs: Fix incorrect unsigned return type in adfs_f_getnext()
Date: Wed, 3 Dec 2025 09:13:21 +0000	[thread overview]
Message-ID: <aS__MV40Vh7cXjw5@shell.armlinux.org.uk> (raw)
In-Reply-To: <20251203065120.652-1-vulab@iscas.ac.cn>

On Wed, Dec 03, 2025 at 02:51:20PM +0800, Haotian Zhang wrote:
> adfs_f_getnext() stores the return value of __adfs_dir_get() into an
> unsigned int. Since __adfs_dir_get() may return negative error codes
> such as -ENOENT, these values are converted into large positive numbers.
> 
> Change the return variable to type int to correctly preserve and return
> negative error codes.
> 
> Signed-off-by: Haotian Zhang <vulab@iscas.ac.cn>

The real problem here is the unsigned int -> int conversion, which is
implementation defined in C. int -> unsigned int itself is well
defined.

Reviewed-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>

Thanks!

-- 
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
FTTP is here! 80Mbps down 10Mbps up. Decent connectivity at last!

      reply	other threads:[~2025-12-03  9:13 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-12-03  6:51 [PATCH] adfs: Fix incorrect unsigned return type in adfs_f_getnext() Haotian Zhang
2025-12-03  9:13 ` Russell King (Oracle) [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=aS__MV40Vh7cXjw5@shell.armlinux.org.uk \
    --to=linux@armlinux.org.uk \
    --cc=linux-kernel@vger.kernel.org \
    --cc=viro@zeniv.linux.org.uk \
    --cc=vulab@iscas.ac.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 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.