Commit 53ca4fea authored by Jon Mason's avatar Jon Mason

NTB: Code Style Clean-up

Some white space and 80 char overruns corrected.
Signed-off-by: default avatarJon Mason <jon.mason@intel.com>
parent 403c63cb
...@@ -91,7 +91,7 @@ static struct dentry *debugfs_dir; ...@@ -91,7 +91,7 @@ static struct dentry *debugfs_dir;
/* Translate memory window 0,1 to BAR 2,4 */ /* Translate memory window 0,1 to BAR 2,4 */
#define MW_TO_BAR(mw) (mw * NTB_MAX_NUM_MW + 2) #define MW_TO_BAR(mw) (mw * NTB_MAX_NUM_MW + 2)
static DEFINE_PCI_DEVICE_TABLE(ntb_pci_tbl) = { static const struct pci_device_id ntb_pci_tbl[] = {
{PCI_VDEVICE(INTEL, PCI_DEVICE_ID_INTEL_NTB_B2B_BWD)}, {PCI_VDEVICE(INTEL, PCI_DEVICE_ID_INTEL_NTB_B2B_BWD)},
{PCI_VDEVICE(INTEL, PCI_DEVICE_ID_INTEL_NTB_B2B_JSF)}, {PCI_VDEVICE(INTEL, PCI_DEVICE_ID_INTEL_NTB_B2B_JSF)},
{PCI_VDEVICE(INTEL, PCI_DEVICE_ID_INTEL_NTB_B2B_SNB)}, {PCI_VDEVICE(INTEL, PCI_DEVICE_ID_INTEL_NTB_B2B_SNB)},
...@@ -120,7 +120,8 @@ MODULE_DEVICE_TABLE(pci, ntb_pci_tbl); ...@@ -120,7 +120,8 @@ MODULE_DEVICE_TABLE(pci, ntb_pci_tbl);
* RETURNS: An appropriate -ERRNO error value on error, or zero for success. * RETURNS: An appropriate -ERRNO error value on error, or zero for success.
*/ */
int ntb_register_event_callback(struct ntb_device *ndev, int ntb_register_event_callback(struct ntb_device *ndev,
void (*func)(void *handle, enum ntb_hw_event event)) void (*func)(void *handle,
enum ntb_hw_event event))
{ {
if (ndev->event_cb) if (ndev->event_cb)
return -EINVAL; return -EINVAL;
...@@ -715,9 +716,9 @@ static int ntb_xeon_setup(struct ntb_device *ndev) ...@@ -715,9 +716,9 @@ static int ntb_xeon_setup(struct ntb_device *ndev)
SNB_PBAR4LMT_OFFSET); SNB_PBAR4LMT_OFFSET);
/* HW errata on the Limit registers. They can only be /* HW errata on the Limit registers. They can only be
* written when the base register is 4GB aligned and * written when the base register is 4GB aligned and
* < 32bit. This should already be the case based on the * < 32bit. This should already be the case based on
* driver defaults, but write the Limit registers first * the driver defaults, but write the Limit registers
* just in case. * first just in case.
*/ */
} else { } else {
ndev->limits.max_mw = SNB_MAX_MW; ndev->limits.max_mw = SNB_MAX_MW;
...@@ -739,9 +740,9 @@ static int ntb_xeon_setup(struct ntb_device *ndev) ...@@ -739,9 +740,9 @@ static int ntb_xeon_setup(struct ntb_device *ndev)
writeq(0, ndev->reg_base + SNB_PBAR4LMT_OFFSET); writeq(0, ndev->reg_base + SNB_PBAR4LMT_OFFSET);
/* HW errata on the Limit registers. They can only be /* HW errata on the Limit registers. They can only be
* written when the base register is 4GB aligned and * written when the base register is 4GB aligned and
* < 32bit. This should already be the case based on the * < 32bit. This should already be the case based on
* driver defaults, but write the Limit registers first * the driver defaults, but write the Limit registers
* just in case. * first just in case.
*/ */
} }
......
...@@ -231,7 +231,7 @@ int ntb_register_db_callback(struct ntb_device *ndev, unsigned int idx, ...@@ -231,7 +231,7 @@ int ntb_register_db_callback(struct ntb_device *ndev, unsigned int idx,
int db_num)); int db_num));
void ntb_unregister_db_callback(struct ntb_device *ndev, unsigned int idx); void ntb_unregister_db_callback(struct ntb_device *ndev, unsigned int idx);
int ntb_register_event_callback(struct ntb_device *ndev, int ntb_register_event_callback(struct ntb_device *ndev,
void (*event_cb_func) (void *handle, void (*event_cb_func)(void *handle,
enum ntb_hw_event event)); enum ntb_hw_event event));
void ntb_unregister_event_callback(struct ntb_device *ndev); void ntb_unregister_event_callback(struct ntb_device *ndev);
int ntb_get_max_spads(struct ntb_device *ndev); int ntb_get_max_spads(struct ntb_device *ndev);
......
...@@ -106,7 +106,7 @@ struct ntb_transport_qp { ...@@ -106,7 +106,7 @@ struct ntb_transport_qp {
struct ntb_rx_info __iomem *rx_info; struct ntb_rx_info __iomem *rx_info;
struct ntb_rx_info *remote_rx_info; struct ntb_rx_info *remote_rx_info;
void (*tx_handler) (struct ntb_transport_qp *qp, void *qp_data, void (*tx_handler)(struct ntb_transport_qp *qp, void *qp_data,
void *data, int len); void *data, int len);
struct list_head tx_free_q; struct list_head tx_free_q;
spinlock_t ntb_tx_free_q_lock; spinlock_t ntb_tx_free_q_lock;
...@@ -116,7 +116,7 @@ struct ntb_transport_qp { ...@@ -116,7 +116,7 @@ struct ntb_transport_qp {
unsigned int tx_max_entry; unsigned int tx_max_entry;
unsigned int tx_max_frame; unsigned int tx_max_frame;
void (*rx_handler) (struct ntb_transport_qp *qp, void *qp_data, void (*rx_handler)(struct ntb_transport_qp *qp, void *qp_data,
void *data, int len); void *data, int len);
struct list_head rx_pend_q; struct list_head rx_pend_q;
struct list_head rx_free_q; struct list_head rx_free_q;
...@@ -128,7 +128,7 @@ struct ntb_transport_qp { ...@@ -128,7 +128,7 @@ struct ntb_transport_qp {
unsigned int rx_max_frame; unsigned int rx_max_frame;
dma_cookie_t last_cookie; dma_cookie_t last_cookie;
void (*event_handler) (void *data, int status); void (*event_handler)(void *data, int status);
struct delayed_work link_work; struct delayed_work link_work;
struct work_struct link_cleanup; struct work_struct link_cleanup;
...@@ -1189,8 +1189,7 @@ static int ntb_process_rxc(struct ntb_transport_qp *qp) ...@@ -1189,8 +1189,7 @@ static int ntb_process_rxc(struct ntb_transport_qp *qp)
return 0; return 0;
err: err:
ntb_list_add(&qp->ntb_rx_pend_q_lock, &entry->entry, ntb_list_add(&qp->ntb_rx_pend_q_lock, &entry->entry, &qp->rx_pend_q);
&qp->rx_pend_q);
/* Ensure that the data is fully copied out before clearing the flag */ /* Ensure that the data is fully copied out before clearing the flag */
wmb(); wmb();
hdr->flags = 0; hdr->flags = 0;
......
...@@ -50,8 +50,8 @@ struct ntb_transport_qp; ...@@ -50,8 +50,8 @@ struct ntb_transport_qp;
struct ntb_client { struct ntb_client {
struct device_driver driver; struct device_driver driver;
int (*probe) (struct pci_dev *pdev); int (*probe)(struct pci_dev *pdev);
void (*remove) (struct pci_dev *pdev); void (*remove)(struct pci_dev *pdev);
}; };
enum { enum {
...@@ -65,11 +65,11 @@ int ntb_register_client_dev(char *device_name); ...@@ -65,11 +65,11 @@ int ntb_register_client_dev(char *device_name);
void ntb_unregister_client_dev(char *device_name); void ntb_unregister_client_dev(char *device_name);
struct ntb_queue_handlers { struct ntb_queue_handlers {
void (*rx_handler) (struct ntb_transport_qp *qp, void *qp_data, void (*rx_handler)(struct ntb_transport_qp *qp, void *qp_data,
void *data, int len); void *data, int len);
void (*tx_handler) (struct ntb_transport_qp *qp, void *qp_data, void (*tx_handler)(struct ntb_transport_qp *qp, void *qp_data,
void *data, int len); void *data, int len);
void (*event_handler) (void *data, int status); void (*event_handler)(void *data, int status);
}; };
unsigned char ntb_transport_qp_num(struct ntb_transport_qp *qp); unsigned char ntb_transport_qp_num(struct ntb_transport_qp *qp);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment