Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1572584
| From | "Allen Hubbe" <Allen.Hubbe@dell.com> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | RE: [PATCH] NTB: Add IDT 89HPESxNTx PCIe-switches support |
| Date | 2017-02-02 19:30 +0100 |
| Message-ID | <t6uiR-7xo-9@gated-at.bofh.it> (permalink) |
| References | <t6aNb-37z-1@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
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."
Back to linux.kernel | Previous | Next | Find similar | Unroll thread
RE: [PATCH] NTB: Add IDT 89HPESxNTx PCIe-switches support "Allen Hubbe" <Allen.Hubbe@dell.com> - 2017-02-02 19:30 +0100
csiph-web