From: Chaitanya Kulkarni <Chaitanya.Kulkarni@wdc.com>
To: l00293085 <liuzhouhua@huawei.com>,
"kbusch@kernel.org" <kbusch@kernel.org>,
"linux-nvme@lists.infradead.org" <linux-nvme@lists.infradead.org>
Cc: "wangzan@huawei.com" <wangzan@huawei.com>,
"kangwenhong@huawei.com" <kangwenhong@huawei.com>,
"Michael.wangchong@huawei.com" <Michael.wangchong@huawei.com>
Subject: Re: [PATCH nvme-cli] edit huawei ssd filter
Date: Wed, 20 May 2020 08:04:14 +0000 [thread overview]
Message-ID: <BYAPR04MB496503E2EB0863F2C69CB2AC86B60@BYAPR04MB4965.namprd04.prod.outlook.com> (raw)
In-Reply-To: 20200520013922.101374-1-liuzhouhua@huawei.com
On 5/19/20 6:47 PM, l00293085 wrote:
> Hi, I'd like to modify command: nvme huawei list, add huawei vendor id as filter
>
Please modify the subject line and patch description as per the style
present in the tree.
> Signed-off-by: Andy Liu <liuzhouhua@huawei.com>
> Reviewed-by: Wang Zan <wangzan@huawei.com>
> ---
> plugins/huawei/huawei-nvme.c | 10 +++++-----
> 1 file changed, 5 insertions(+), 5 deletions(-)
>
> diff --git a/plugins/huawei/huawei-nvme.c b/plugins/huawei/huawei-nvme.c
> index c935f47..c7f3307 100644
> --- a/plugins/huawei/huawei-nvme.c
> +++ b/plugins/huawei/huawei-nvme.c
> @@ -41,6 +41,7 @@
> #define CREATE_CMD
> #include "huawei-nvme.h"
>
> +#define HW_SSD_PCI_VENDOR_ID 0x19E5
> #define ARRAY_NAME_LEN 80
> #define NS_NAME_LEN 40
>
> @@ -80,16 +81,15 @@ static int huawei_get_nvme_info(int fd, struct huawei_list_item *item, const cha
> return err;
>
> /*identify huawei device*/
> - if (strstr(item->ctrl.mn, "Huawei") == NULL) {
> + if ((strstr(item->ctrl.mn, "Huawei") == NULL) \
> + && (le16_to_cpu(item->ctrl.vid) != HW_SSD_PCI_VENDOR_ID)) {
>
Consider following coding style to avoid \ in the code and break at the
&&.
if (err)
return err;
- /*identify huawei device*/
- if ((strstr(item->ctrl.mn, "Huawei") == NULL) \
- && (le16_to_cpu(item->ctrl.vid) != HW_SSD_PCI_VENDOR_ID)) {
+ /* identify huawei device */
+ if ((strstr(item->ctrl.mn, "Huawei") == NULL) &&
+ (le16_to_cpu(item->ctrl.vid) != HW_SSD_PCI_VENDOR_ID)) {
item->huawei_device = false;
return 0;
}
item->huawei_device = false;
> return 0;
> }
> - else
> - item->huawei_device = true;
>
> + item->huawei_device = true;
> item->nsid = nvme_get_nsid(fd);
> - err = nvme_identify_ns(fd, item->nsid,
> - 0, &item->ns);
> + err = nvme_identify_ns(fd, item->nsid, 0, &item->ns);
> if (err)
> return err;
>
>
_______________________________________________
linux-nvme mailing list
linux-nvme@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-nvme
next prev parent reply other threads:[~2020-05-20 8:04 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-05-20 1:39 [PATCH nvme-cli] edit huawei ssd filter l00293085
2020-05-20 8:04 ` Chaitanya Kulkarni [this message]
2020-05-21 9:34 ` Zhouhua Liu
2020-05-22 0:58 ` Chaitanya Kulkarni
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=BYAPR04MB496503E2EB0863F2C69CB2AC86B60@BYAPR04MB4965.namprd04.prod.outlook.com \
--to=chaitanya.kulkarni@wdc.com \
--cc=Michael.wangchong@huawei.com \
--cc=kangwenhong@huawei.com \
--cc=kbusch@kernel.org \
--cc=linux-nvme@lists.infradead.org \
--cc=liuzhouhua@huawei.com \
--cc=wangzan@huawei.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;
as well as URLs for NNTP newsgroup(s).