Commit 8adc8c56 authored by Pavel Pisa's avatar Pavel Pisa
Browse files

driver: correct some problems reported by make checkpatch.


Signed-off-by: Pavel Pisa's avatarPavel Pisa <pisa@cmp.felk.cvut.cz>
parent 7a265ed8
...@@ -50,7 +50,7 @@ MODULE_DESCRIPTION("CTU CAN FD interface"); ...@@ -50,7 +50,7 @@ MODULE_DESCRIPTION("CTU CAN FD interface");
#define DRV_NAME "ctucanfd" #define DRV_NAME "ctucanfd"
static const char *ctucan_state_strings[] = { static const char * const ctucan_state_strings[] = {
"CAN_STATE_ERROR_ACTIVE", "CAN_STATE_ERROR_ACTIVE",
"CAN_STATE_ERROR_WARNING", "CAN_STATE_ERROR_WARNING",
"CAN_STATE_ERROR_PASSIVE", "CAN_STATE_ERROR_PASSIVE",
...@@ -164,14 +164,14 @@ static int ctucan_set_secondary_sample_point(struct net_device *ndev) ...@@ -164,14 +164,14 @@ static int ctucan_set_secondary_sample_point(struct net_device *ndev)
} }
// Use for bit-rates above 1 Mbits/s // Use for bit-rates above 1 Mbits/s
if (dbt->bitrate > 1000000){ if (dbt->bitrate > 1000000) {
ssp_ena = true; ssp_ena = true;
// Calculate SSP in minimal time quanta // Calculate SSP in minimal time quanta
ssp_offset = (priv->can.clock.freq / 1000) * ssp_offset = (priv->can.clock.freq / 1000) *
dbt->sample_point / dbt->bitrate; dbt->sample_point / dbt->bitrate;
if (ssp_offset > 127){ if (ssp_offset > 127) {
netdev_warn(ndev, "SSP offset saturated to 127\n"); netdev_warn(ndev, "SSP offset saturated to 127\n");
ssp_offset = 127; ssp_offset = 127;
} }
......
...@@ -767,7 +767,7 @@ void ctucan_hw_configure_ssp(struct ctucan_hw_priv *priv, bool enable_ssp, ...@@ -767,7 +767,7 @@ void ctucan_hw_configure_ssp(struct ctucan_hw_priv *priv, bool enable_ssp,
union ctu_can_fd_trv_delay_ssp_cfg ssp_cfg; union ctu_can_fd_trv_delay_ssp_cfg ssp_cfg;
ssp_cfg.u32 = 0; ssp_cfg.u32 = 0;
if (enable_ssp){ if (enable_ssp) {
if (use_trv_delay) if (use_trv_delay)
ssp_cfg.s.ssp_src = SSP_SRC_MEAS_N_OFFSET; ssp_cfg.s.ssp_src = SSP_SRC_MEAS_N_OFFSET;
else else
......
...@@ -223,7 +223,7 @@ static int ctucan_pci_probe(struct pci_dev *pdev, ...@@ -223,7 +223,7 @@ static int ctucan_pci_probe(struct pci_dev *pdev,
return 0; return 0;
err_free_board: err_free_board:
pci_set_drvdata(pdev, NULL); pci_set_drvdata(pdev, NULL);
kfree(bdata); kfree(bdata);
err_pci_iounmap_bar0: err_pci_iounmap_bar0:
......
...@@ -97,7 +97,8 @@ static int ctucan_platform_probe(struct platform_device *pdev) ...@@ -97,7 +97,8 @@ static int ctucan_platform_probe(struct platform_device *pdev)
if (ret < 0) if (ret < 0)
platform_set_drvdata(pdev, NULL); platform_set_drvdata(pdev, NULL);
err:
err:
return ret; return ret;
} }
......
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