Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1572584 > unrolled thread

RE: [PATCH] NTB: Add IDT 89HPESxNTx PCIe-switches support

Started by"Allen Hubbe" <Allen.Hubbe@dell.com>
First post2017-02-02 19:30 +0100
Last post2017-02-02 19:30 +0100
Articles 1 — 1 participant

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  RE: [PATCH] NTB: Add IDT 89HPESxNTx PCIe-switches support "Allen Hubbe" <Allen.Hubbe@dell.com> - 2017-02-02 19:30 +0100

#1572584 — RE: [PATCH] NTB: Add IDT 89HPESxNTx PCIe-switches support

From"Allen Hubbe" <Allen.Hubbe@dell.com>
Date2017-02-02 19:30 +0100
SubjectRE: [PATCH] NTB: Add IDT 89HPESxNTx PCIe-switches support
Message-ID<t6uiR-7xo-9@gated-at.bofh.it>
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."

[toc] | [standalone]


Back to top | Article view | linux.kernel


csiph-web