From: "Tkaczyk, Mariusz" <mariusz.tkaczyk@linux.intel.com>
To: Nigel Croxon <ncroxon@redhat.com>,
jes@trained-monkey.org, linux-raid@vger.kernel.org,
xni@redhat.com
Subject: Re: [PATCH V2] Fix return value from fstat calls
Date: Thu, 12 Aug 2021 08:49:23 +0200 [thread overview]
Message-ID: <0506adac-d237-c03f-fbf3-12bd862598da@linux.intel.com> (raw)
In-Reply-To: <20210811190930.1822317-1-ncroxon@redhat.com>
Hi Nigel,
On 11.08.2021 21:09, Nigel Croxon wrote:
> + pr_err("fstat failed for %s: %s\n",devname, strerror(errno));
> + pr_err("fstat failed from %s: %s\n",fname, strerror(errno));
Typo, I guess that you want to use "for".
> + pr_err("fstat failed for %s: %s\n",dev, strerror(errno));
> + pr_err("fstat failed for %s: %s\n",devname, strerror(errno));
> + pr_err("fstat failed for %s: %s\n",devname, strerror(errno));
> + pr_err("fstat failed: %s\n", strerror(errno));
> + pr_err("fstat failed: %s\n", strerror(errno));
> + pr_err("fstat failed for %s: %s\n",devname, strerror(errno));
> + pr_err("fstat failed for %s: %s\n",devname, strerror(errno));
> + pr_err("fstat failed for %s: %s\n",devname, strerror(errno));
> + pr_err("fstat failed for %s: %s\n",devname, strerror(errno));
You are using similar error message across code. If you think that printing
error in this case is worth to be added then please define wrapper for fstat
with error message and use that.
Current solution is typo friendly (and I found one) and breaks DNRY rule.
Any modern C IDE is able to find references- result is same as in search via
string in case of error.
Mariusz
prev parent reply other threads:[~2021-08-12 6:49 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-08-10 15:15 [PATCH] Fix return value from fstat calls Nigel Croxon
[not found] ` <ed1b0603-e523-6ca6-12ce-d30a85afe885@linux.intel.com>
2021-08-11 13:06 ` Tkaczyk, Mariusz
2021-08-11 19:09 ` [PATCH V2] " Nigel Croxon
2021-08-11 22:52 ` NeilBrown
[not found] ` <346e8651-d861-45c7-9058-68008e691b93@Canary>
2021-08-12 23:23 ` NeilBrown
2021-08-13 7:00 ` Tkaczyk, Mariusz
2021-08-13 7:19 ` NeilBrown
2021-08-13 7:45 ` Tkaczyk, Mariusz
2021-08-13 19:19 ` Jes Sorensen
2021-08-12 6:49 ` Tkaczyk, Mariusz [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=0506adac-d237-c03f-fbf3-12bd862598da@linux.intel.com \
--to=mariusz.tkaczyk@linux.intel.com \
--cc=jes@trained-monkey.org \
--cc=linux-raid@vger.kernel.org \
--cc=ncroxon@redhat.com \
--cc=xni@redhat.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