netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andy Duan <fugang.duan@nxp.com>
To: "Fuzzey, Martin" <martin.fuzzey@flowbird.group>
Cc: Rob Herring <robh+dt@kernel.org>, Shawn Guo <shawnguo@kernel.org>,
	"David S. Miller" <davem@davemloft.net>,
	"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	Fabio Estevam <festevam@gmail.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	Sascha Hauer <s.hauer@pengutronix.de>,
	dl-linux-imx <linux-imx@nxp.com>,
	"devicetree@vger.kernel.org" <devicetree@vger.kernel.org>
Subject: RE: [EXT] [PATCH 1/4] net: fec: set GPR bit on suspend by DT connfiguration.
Date: Wed, 18 Mar 2020 09:02:22 +0000	[thread overview]
Message-ID: <VI1PR0402MB3600BF8115865C58A463FE37FFF70@VI1PR0402MB3600.eurprd04.prod.outlook.com> (raw)
In-Reply-To: <CANh8QzxNYzLL8sAXwYEnic2-o-3xzyQaUZZ3LmaRO7fCfgoLQg@mail.gmail.com>

From: Fuzzey, Martin <martin.fuzzey@flowbird.group> Sent: Wednesday, March 18, 2020 4:36 PM
> On Wed, 18 Mar 2020 at 07:26, Andy Duan <fugang.duan@nxp.com> wrote:
> >
> > From: Martin Fuzzey <martin.fuzzey@flowbird.group> Sent: Wednesday,
> > March 18, 2020 12:50 AM
> > > +static int fec_enet_of_parse_stop_mode(struct fec_enet_private *fep,
> > > +                                      struct device_node *np) {
> > > +       static const char prop[] = "fsl,stop-mode";
> > > +       struct of_phandle_args args;
> > > +       int ret;
> > > +
> > > +       ret = of_parse_phandle_with_fixed_args(np, prop, 2, 0,
> > > + &args);
> > To save memory:
> >
> >                  ret = of_parse_phandle_with_fixed_args(np,
> > "fsl,stop-mode", 2, 0, &args);
> >
> 
> Why would this save memory?
> prop is defined static const char[] (and not char *) so there will no be extra
> pointers.
> 
> I haven't checked the generated assembler but this should generate the same
> code as a string litteral I think.
> 
> It is also reused later in the function in a debug (which is the reason I did it
> this way to ensure the property name is unique and consistent.

static variable cost memory and never is not freed if the module is built in. 

the later debug message cannot depend on the variable.
> 
> Regards,
> 
> Martin
> 
> --

  reply	other threads:[~2020-03-18  9:02 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-17 16:50 [PATCH 0/4] Fix Wake on lan with FEC on i.MX6 Martin Fuzzey
2020-03-17 16:50 ` [PATCH 1/4] net: fec: set GPR bit on suspend by DT connfiguration Martin Fuzzey
2020-03-18  6:26   ` [EXT] " Andy Duan
2020-03-18  8:35     ` Fuzzey, Martin
2020-03-18  9:02       ` Andy Duan [this message]
2020-03-17 16:50 ` [PATCH 2/4] ARM: dts: imx6: Use gpc for FEC interrupt controller to fix wake on LAN Martin Fuzzey
2020-03-17 16:50 ` [PATCH 3/4] dt-bindings: fec: document the new fsl,stop-mode property Martin Fuzzey
2020-03-18  9:17   ` Andrew Lunn
2020-03-18  9:28     ` Fuzzey, Martin
2020-03-18 11:38       ` Andrew Lunn
2020-03-17 16:50 ` [PATCH 4/4] ARM: dts: imx6: add " Martin Fuzzey
2020-03-18  6:28 ` [EXT] [PATCH 0/4] Fix Wake on lan with FEC on i.MX6 Andy Duan
2020-03-18  8:27   ` Fuzzey, Martin
2020-03-18  8:34     ` Andy Duan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=VI1PR0402MB3600BF8115865C58A463FE37FFF70@VI1PR0402MB3600.eurprd04.prod.outlook.com \
    --to=fugang.duan@nxp.com \
    --cc=davem@davemloft.net \
    --cc=devicetree@vger.kernel.org \
    --cc=festevam@gmail.com \
    --cc=linux-imx@nxp.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=martin.fuzzey@flowbird.group \
    --cc=netdev@vger.kernel.org \
    --cc=robh+dt@kernel.org \
    --cc=s.hauer@pengutronix.de \
    --cc=shawnguo@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).