[PATCH v2] staging/rdma/hfi1: set Gen3 half-swing for integrated devices

Dan Carpenter dan.carpenter at oracle.com
Tue Nov 10 09:59:29 UTC 2015


Gar...  No.  Please please get rid of the PC() macro.  It makes the code
impossible to understand because instead of hitting CTRL-[ you have
decode it and then manually type out

:cs find g CCE_PCIE_CTRL_XMT_MARGIN_GEN1_GEN2_OVERWRITE_ENABLE_SHIFT

which is the length of a typical college essay.  I meant just put a
comment like this:

/*
 * In the hardware spec these are prefixed with:
 * CCE_PCIE_CTRL_...
 * But it is too long to use in code.
 */
#define XMT_MARGIN_GEN1_GEN2_OVERWRITE_ENABLE_MASK 0x1ull

Or probably even better:

#define CCE_PCIE_CTRL (CCE + 0x0000000000C0)
#define LANE_BUNDLE_MASK	0x3ull /* CCE_PCIE_CTRL_PCIE_LANE_BUNDLE_MASK */
#define LANE_BUNDLE_SHIFT	0      /* CCE_PCIE_CTRL_PCIE_LANE_BUNDLE_SHIFT */
#define LANE_DELAY_MASK		0xFull /* CCE_PCIE_CTRL_PCIE_LANE_DELAY_MASK */
#define LANE_DELAY_SHIFT	2      /* CCE_PCIE_CTRL_PCIE_LANE_DELAY_SHIFT */
#define MARGIN_OVERWRITE_SHIFT	8      /* CCE_PCIE_CTRL_XMT_MARGIN_OVERWRITE_ENABLE_SHIFT */
#define MARGIN_SHIFT		9      /* CCE_PCIE_CTRL_XMT_MARGIN_SHIFT */
#define MARGIN_G1G2_OVERWRITE_MASK 0x1ull /* CCE_PCIE_CTRL_XMT_MARGIN_GEN1_GEN2_OVERWRITE_ENABLE_MASK */
#define MARGIN_G1G2_OVERWRITE_SHIFT 12    /* CCE_PCIE_CTRL_XMT_MARGIN_GEN1_GEN2_OVERWRITE_ENABLE_SHIFT */
#define MARGIN_G1G2_MASK	0x7ull /* CCE_PCIE_CTRL_XMT_MARGIN_GEN1_GEN2_MASK */
#define MARGIN_G1G2_SHIFT	13     /* CCE_PCIE_CTRL_XMT_MARGIN_GEN1_GEN2_SHIFT */

Those lines go over the 80 character limit but it's fine.

regards,
dan carpenter



More information about the devel mailing list