All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mariusz Tkaczyk <mariusz.tkaczyk@linux.intel.com>
To: Coly Li <colyli@suse.de>
Cc: Kinga Tanska <kinga.tanska@intel.com>,
	jes@trained-monkey.org, linux-raid@vger.kernel.org
Subject: Re: [PATCH] Assemble: check if device is container before scheduling force-clean update
Date: Mon, 21 Mar 2022 14:52:26 +0100	[thread overview]
Message-ID: <20220321145226.00003e01@linux.intel.com> (raw)
In-Reply-To: <da2d2717-c278-62bc-d1e5-e0d371b66f9b@suse.de>

On Sat, 19 Mar 2022 23:12:36 +0800
Coly Li <colyli@suse.de> wrote:

> Hi Kinga,
> 
> 
> I am fine with the above idea, except the extra is_container(). IMHO 
> comparing directly with LEVEL_CONTAINER is fine, adding
> is_container() doesn't help too much.
> 
> 

Hi Coly,

It is used in many places and is long. This is the main reason we
changed that. As you can see, some ifs was simplified and readability
is improved.
Generally, if something is repeated two or more times, it should be
gathered inside function. This simplifies future changes (for example
if we decide to add other level check here). Also it simplifies code
analysis (IDE will show us all usages) and it gives basic description.
In this case it could be redundant but IMO it is a design we should
follow.

We already proposed similar inline for raid456 in other patch.

Thanks,
Mariusz

  reply	other threads:[~2022-03-21 13:53 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-09  9:09 [PATCH] Assemble: check if device is container before scheduling force-clean update Kinga Tanska
2022-03-19 15:12 ` Coly Li
2022-03-21 13:52   ` Mariusz Tkaczyk [this message]
2022-03-21 14:27     ` Coly Li

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=20220321145226.00003e01@linux.intel.com \
    --to=mariusz.tkaczyk@linux.intel.com \
    --cc=colyli@suse.de \
    --cc=jes@trained-monkey.org \
    --cc=kinga.tanska@intel.com \
    --cc=linux-raid@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 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.