From: "Allen Hubbe" <Allen.Hubbe@dell.com>
To: "'Serge Semin'" <fancer.lancer@gmail.com>, <jdmason@kudzu.us>,
<dave.jiang@intel.com>, <Xiangliang.Yu@amd.com>
Cc: <Sergey.Semin@t-platforms.ru>, <linux-ntb@googlegroups.com>,
<linux-kernel@vger.kernel.org>
Subject: RE: [PATCH] NTB: Add IDT 89HPESxNTx PCIe-switches support
Date: Thu, 2 Feb 2017 13:10:04 -0500 [thread overview]
Message-ID: <000001d27d7f$967711b0$c3653510$@dell.com> (raw)
In-Reply-To: <1485985051-29346-1-git-send-email-fancer.lancer@gmail.com>
From: Serge Semin
> +static void idt_nt_write(struct idt_ntb_dev *ndev,
> + const unsigned int reg, const u32 data)
> +{
> + /*
> + * It's obvious bug to request a register exceeding the maximum possible
> + * value as well as to have it unaligned.
> + */
> + BUG_ON(reg > IDT_REG_PCI_MAX || !IS_ALIGNED(reg, IDT_REG_ALIGN));
Avoid BUG_ON. Just warn and do nothing (at least, do nothing destructive) instead of crashing the system. Here, and throughout the driver.
> +#define to_dev_ndev(ndev) (&((ndev)->ntb.dev))
> +#define to_pci_ndev(ndev) ((ndev)->ntb.pdev)
See Logan's recent patches in "Style fixes: open code obfuscating macros."
next prev parent reply other threads:[~2017-02-02 18:21 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-02-01 21:37 [PATCH] NTB: Add IDT 89HPESxNTx PCIe-switches support Serge Semin
2017-02-02 18:10 ` Allen Hubbe [this message]
2017-02-20 21:33 ` [PATCH v2] " Serge Semin
2017-02-21 22:42 ` Allen Hubbe
2017-02-22 11:01 ` Serge Semin
2017-02-24 10:49 ` [PATCH v3] " Serge Semin
2017-02-24 16:01 ` Allen Hubbe
2017-02-27 9:22 ` [PATCH v4] " Serge Semin
2017-03-01 16:30 ` Jon Mason
2017-03-07 2:02 ` [PATCH v5] " Serge Semin
2017-03-08 18:01 ` Jon Mason
2017-03-08 20:29 ` [PATCH v6] " Serge Semin
2017-04-12 12:44 ` [PATCH v7] " Serge Semin
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='000001d27d7f$967711b0$c3653510$@dell.com' \
--to=allen.hubbe@dell.com \
--cc=Sergey.Semin@t-platforms.ru \
--cc=Xiangliang.Yu@amd.com \
--cc=dave.jiang@intel.com \
--cc=fancer.lancer@gmail.com \
--cc=jdmason@kudzu.us \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-ntb@googlegroups.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