lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Fri, 16 Oct 2020 10:00:31 +0000
From:   Joakim Zhang <qiangqing.zhang@....com>
To:     Marc Kleine-Budde <mkl@...gutronix.de>,
        "robh+dt@...nel.org" <robh+dt@...nel.org>,
        "shawnguo@...nel.org" <shawnguo@...nel.org>,
        "s.hauer@...gutronix.de" <s.hauer@...gutronix.de>
CC:     "kernel@...gutronix.de" <kernel@...gutronix.de>,
        dl-linux-imx <linux-imx@....com>, Ying Liu <victor.liu@....com>,
        Peng Fan <peng.fan@....com>,
        "linux-can@...r.kernel.org" <linux-can@...r.kernel.org>,
        Pankaj Bansal <pankaj.bansal@....com>,
        "netdev@...r.kernel.org" <netdev@...r.kernel.org>,
        "devicetree@...r.kernel.org" <devicetree@...r.kernel.org>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: RE: [PATCH 5/6] can: flexcan: add CAN wakeup function for i.MX8QM


Hi Marc,

[...]
> > > +static int flexcan_stop_mode_enable_scfw(struct flexcan_priv *priv,
> > > +bool enabled) {
> > > +	u8 idx = priv->can_idx;
> > > +	u32 rsrc_id, val;
> > > +
> > > +	if (idx == 0)
> > > +		rsrc_id = IMX_SC_R_CAN_0;
> > > +	else if (idx == 1)
> > > +		rsrc_id = IMX_SC_R_CAN_1;
> > > +	else
> > > +		rsrc_id = IMX_SC_R_CAN_2;
> >
> > Can you introduce something like and make use of it:
> >
> > #define IMX_SC_R_CAN(x)			(105 + (x))
> OK.

I thought it over again, from my point of view, use macro here directly could be more intuitive, and can achieve a direct jump.
If change to above wrapper, on the contrary make confusion, and generate the magic number 105. ☹

> > > +
> > > +	if (enabled)
> > > +		val = 1;
> > > +	else
> > > +		val = 0;
> > > +
> > > +	/* stop mode request via scu firmware */
> > > +	return imx_sc_misc_set_control(priv->sc_ipc_handle, rsrc_id,
> > > +IMX_SC_C_IPG_STOP, val); }

We still need use IMX_SC_C_IPG_STOP, why not be consistent?

Best Regards,
Joakim Zhang

Powered by blists - more mailing lists