Message ID | 20190509161109.10499-5-dmurphy@ti.com |
---|---|
State | New |
Headers | show |
Series | None | expand |
Hi, On 09/05/19 9:41 PM, Dan Murphy wrote: > Fix checkpatch issues found during the m_can framework creation. > The code the issues were in, was in untouched code and these > changes should be done separately as to not be confused with the > framework changes. > > Fix these 3 check issues: > CHECK: Unnecessary parentheses around 'cdev->can.state != CAN_STATE_ERROR_WARNING' > if (psr & PSR_EW && > (cdev->can.state != CAN_STATE_ERROR_WARNING)) { > > CHECK: Unnecessary parentheses around 'cdev->can.state != CAN_STATE_ERROR_PASSIVE' > if ((psr & PSR_EP) && > (cdev->can.state != CAN_STATE_ERROR_PASSIVE)) { > > CHECK: Unnecessary parentheses around 'cdev->can.state != CAN_STATE_BUS_OFF' > if ((psr & PSR_BO) && > (cdev->can.state != CAN_STATE_BUS_OFF)) { > > Signed-off-by: Dan Murphy <dmurphy@ti.com> Acked-by: Faiz Abbas <faiz_abbas@ti.com> Thanks, Faiz
diff --git a/drivers/net/can/m_can/m_can.c b/drivers/net/can/m_can/m_can.c index 923c53204d7d..ef4282a98fe1 100644 --- a/drivers/net/can/m_can/m_can.c +++ b/drivers/net/can/m_can/m_can.c @@ -733,22 +733,19 @@ static int m_can_handle_state_errors(struct net_device *dev, u32 psr) struct m_can_classdev *cdev = netdev_priv(dev); int work_done = 0; - if ((psr & PSR_EW) && - (cdev->can.state != CAN_STATE_ERROR_WARNING)) { + if (psr & PSR_EW && cdev->can.state != CAN_STATE_ERROR_WARNING) { netdev_dbg(dev, "entered error warning state\n"); work_done += m_can_handle_state_change(dev, CAN_STATE_ERROR_WARNING); } - if ((psr & PSR_EP) && - (cdev->can.state != CAN_STATE_ERROR_PASSIVE)) { + if (psr & PSR_EP && cdev->can.state != CAN_STATE_ERROR_PASSIVE) { netdev_dbg(dev, "entered error passive state\n"); work_done += m_can_handle_state_change(dev, CAN_STATE_ERROR_PASSIVE); } - if ((psr & PSR_BO) && - (cdev->can.state != CAN_STATE_BUS_OFF)) { + if (psr & PSR_BO && cdev->can.state != CAN_STATE_BUS_OFF) { netdev_dbg(dev, "entered error bus off state\n"); work_done += m_can_handle_state_change(dev, CAN_STATE_BUS_OFF);
Fix checkpatch issues found during the m_can framework creation. The code the issues were in, was in untouched code and these changes should be done separately as to not be confused with the framework changes. Fix these 3 check issues: CHECK: Unnecessary parentheses around 'cdev->can.state != CAN_STATE_ERROR_WARNING' if (psr & PSR_EW && (cdev->can.state != CAN_STATE_ERROR_WARNING)) { CHECK: Unnecessary parentheses around 'cdev->can.state != CAN_STATE_ERROR_PASSIVE' if ((psr & PSR_EP) && (cdev->can.state != CAN_STATE_ERROR_PASSIVE)) { CHECK: Unnecessary parentheses around 'cdev->can.state != CAN_STATE_BUS_OFF' if ((psr & PSR_BO) && (cdev->can.state != CAN_STATE_BUS_OFF)) { Signed-off-by: Dan Murphy <dmurphy@ti.com> --- v12 - No Changes - https://lore.kernel.org/patchwork/patch/1052304/ v11 - New change to clean up last remaining checkpatch issues on original code. drivers/net/can/m_can/m_can.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) -- 2.21.0.5.gaeb582a983