Linux-Fsdevel Archive mirror
 help / color / mirror / Atom feed
From: Al Viro <viro@zeniv.linux.org.uk>
To: Jiasheng Jiang <jiashengjiangcool@outlook.com>
Cc: brauner@kernel.org, jack@suse.cz, arnd@arndb.de, gregkh@suse.de,
	linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] libfs: fix implicitly cast in simple_attr_write_xsigned()
Date: Wed, 15 May 2024 17:00:40 +0100	[thread overview]
Message-ID: <20240515160040.GL2118490@ZenIV> (raw)
In-Reply-To: <BYAPR03MB41685A92DCDD499A2B1369F0ADEC2@BYAPR03MB4168.namprd03.prod.outlook.com>

On Wed, May 15, 2024 at 03:17:25PM +0000, Jiasheng Jiang wrote:
> Return 0 to indicate failure and return "len" to indicate success.
> It was hard to distinguish success or failure if "len" equals the error
> code after the implicit cast.
> Moreover, eliminating implicit cast is a better practice.

According to whom?

Merits of your ex cathedra claims aside, you do realize that functions
have calling conventions because they are, well, called, right?
And changing the value returned in such and such case should be
accompanied with the corresponding change in the _callers_.

Al, wondering if somebody had decided to play with LLM...

  reply	other threads:[~2024-05-15 16:00 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-05-15 15:17 [PATCH] libfs: fix implicitly cast in simple_attr_write_xsigned() Jiasheng Jiang
2024-05-15 16:00 ` Al Viro [this message]
  -- strict thread matches above, loose matches on Subject: below --
2024-05-25 19:55 Jiasheng Jiang
2024-05-25 22:48 ` Al Viro

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=20240515160040.GL2118490@ZenIV \
    --to=viro@zeniv.linux.org.uk \
    --cc=arnd@arndb.de \
    --cc=brauner@kernel.org \
    --cc=gregkh@suse.de \
    --cc=jack@suse.cz \
    --cc=jiashengjiangcool@outlook.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).