Skip to content

Commit 6965219

Browse files
Dan Murphymarckleinebudde
authored andcommitted
can: m_can: Fix checkpatch issues on existing code
Fix checkpatch issues found during the m_can framework creation, before framework creation in the following patches. Fix these 4 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)) { CHECK: Unnecessary parentheses around 'priv->version <= 31' if ((priv->version <= 31) && (irqstatus & IR_MRAF) && (m_can_read(priv, M_CAN_ECR) & ECR_RP)) { Signed-off-by: Dan Murphy <[email protected]> Acked-by: Faiz Abbas <[email protected]> Signed-off-by: Marc Kleine-Budde <[email protected]>
1 parent b07fbf2 commit 6965219

File tree

1 file changed

+5
-8
lines changed

1 file changed

+5
-8
lines changed

drivers/net/can/m_can/m_can.c

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -744,22 +744,19 @@ static int m_can_handle_state_errors(struct net_device *dev, u32 psr)
744744
struct m_can_priv *priv = netdev_priv(dev);
745745
int work_done = 0;
746746

747-
if ((psr & PSR_EW) &&
748-
(priv->can.state != CAN_STATE_ERROR_WARNING)) {
747+
if (psr & PSR_EW && priv->can.state != CAN_STATE_ERROR_WARNING) {
749748
netdev_dbg(dev, "entered error warning state\n");
750749
work_done += m_can_handle_state_change(dev,
751750
CAN_STATE_ERROR_WARNING);
752751
}
753752

754-
if ((psr & PSR_EP) &&
755-
(priv->can.state != CAN_STATE_ERROR_PASSIVE)) {
753+
if (psr & PSR_EP && priv->can.state != CAN_STATE_ERROR_PASSIVE) {
756754
netdev_dbg(dev, "entered error passive state\n");
757755
work_done += m_can_handle_state_change(dev,
758756
CAN_STATE_ERROR_PASSIVE);
759757
}
760758

761-
if ((psr & PSR_BO) &&
762-
(priv->can.state != CAN_STATE_BUS_OFF)) {
759+
if (psr & PSR_BO && priv->can.state != CAN_STATE_BUS_OFF) {
763760
netdev_dbg(dev, "entered error bus off state\n");
764761
work_done += m_can_handle_state_change(dev,
765762
CAN_STATE_BUS_OFF);
@@ -832,8 +829,8 @@ static int m_can_poll(struct napi_struct *napi, int quota)
832829
* whether MCAN_ECR.RP = ’1’ and MCAN_ECR.REC = 127.
833830
* In this case, reset MCAN_IR.MRAF. No further action is required.
834831
*/
835-
if ((priv->version <= 31) && (irqstatus & IR_MRAF) &&
836-
(m_can_read(priv, M_CAN_ECR) & ECR_RP)) {
832+
if (priv->version <= 31 && irqstatus & IR_MRAF &&
833+
m_can_read(priv, M_CAN_ECR) & ECR_RP) {
837834
struct can_berr_counter bec;
838835

839836
__m_can_get_berr_counter(dev, &bec);

0 commit comments

Comments
 (0)