[ptxdist] [PATCH] flashbench: Fix error when flashbench is not selected
When flashbench is not selected in "ptxdist menuconfig", then $(PTXCONF_FLASHBENCH_MAX_BUFSIZE) is undefined. In that case, the expr call fails. Fix the problem by delaying the evaluation of FLASHBENCH_MAKE_OPT until it's really needed, i.e. when flashbench has been selected. Signed-off-by: Bernhard Walle --- Don't sign off my own patch twice with multiple email addresses. rules/flashbench.make |5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/rules/flashbench.make b/rules/flashbench.make index fcb669e..39bdfb6 100644 --- a/rules/flashbench.make +++ b/rules/flashbench.make @@ -31,7 +31,10 @@ FLASHBENCH_LICENSE := GPL v2 FLASHBENCH_CONF_TOOL := NO FLASHBENCH_MAKE_ENV:= $(CROSS_ENV) -FLASHBENCH_MAKE_OPT:= CC=$(CROSS_CC) \ + +# Use '=' instaed of ':=' because $(PTXCONF_FLASHBENCH_MAX_BUFSIZE) is not defined +# when flashbench is not selected to be built. +FLASHBENCH_MAKE_OPT= CC=$(CROSS_CC) \ EXTRA_CFLAGS=-DMAX_BUFSIZE=$(shell expr 1024 \* 1024 \* $(PTXCONF_FLASHBENCH_MAX_BUFSIZE)) # -- 1.7.9.4 -- ptxdist mailing list ptxdist@pengutronix.de
[ptxdist] [PATCH] flashbench: Fix error when flashbench is not selected
When flashbench is not selected in "ptxdist menuconfig", then $(PTXCONF_FLASHBENCH_MAX_BUFSIZE) is undefined. In that case, the expr call fails. Fix the problem by delaying the evaluation of FLASHBENCH_MAKE_OPT until it's really needed, i.e. when flashbench has been selected. Signed-off-by: Bernhard Walle Signed-off-by: Bernhard Walle --- rules/flashbench.make |5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/rules/flashbench.make b/rules/flashbench.make index fcb669e..39bdfb6 100644 --- a/rules/flashbench.make +++ b/rules/flashbench.make @@ -31,7 +31,10 @@ FLASHBENCH_LICENSE := GPL v2 FLASHBENCH_CONF_TOOL := NO FLASHBENCH_MAKE_ENV:= $(CROSS_ENV) -FLASHBENCH_MAKE_OPT:= CC=$(CROSS_CC) \ + +# Use '=' instaed of ':=' because $(PTXCONF_FLASHBENCH_MAX_BUFSIZE) is not defined +# when flashbench is not selected to be built. +FLASHBENCH_MAKE_OPT= CC=$(CROSS_CC) \ EXTRA_CFLAGS=-DMAX_BUFSIZE=$(shell expr 1024 \* 1024 \* $(PTXCONF_FLASHBENCH_MAX_BUFSIZE)) # -- 1.7.9.4 -- ptxdist mailing list ptxdist@pengutronix.de
Re: [ptxdist] [PATCH] flashbench: Fix error when flashbench is not selected
> > > FLASHBENCH_CONF_TOOL := NO > > > FLASHBENCH_MAKE_ENV := $(CROSS_ENV) > > > -FLASHBENCH_MAKE_OPT := CC=$(CROSS_CC) \ > > > > Please add a comment here. Otherwise it it not clear why this is needed. > > Then we should discuss about comments in the changed files or in the change > itself. In a comment, you describe why it is _done_ that way. In a commit message, you describe why it needs to be _changed_ that way. Those two can be quite similar, but often are not. When in doubt, redundancy is your friend here :) Regards, Wolfram -- Pengutronix e.K. | Wolfram Sang| Industrial Linux Solutions | http://www.pengutronix.de/ | signature.asc Description: Digital signature -- ptxdist mailing list ptxdist@pengutronix.de
Re: [ptxdist] [PATCH] flashbench: Fix error when flashbench is not selected
Michael Olbrich wrote: > On Tue, Mar 20, 2012 at 08:36:47PM +0100, Bernhard Walle wrote: > > When flashbench is not selected in "ptxdist menuconfig", then > > $(PTXCONF_FLASHBENCH_MAX_BUFSIZE) is undefined. In that case, the expr > > call fails. > > > > Fix the problem by delaying the evaluation of FLASHBENCH_MAKE_OPT until > > it's really needed, i.e. when flashbench has been selected. > > > > Signed-off-by: Bernhard Walle > > --- > > rules/flashbench.make |2 +- > > 1 file changed, 1 insertion(+), 1 deletion(-) > > > > diff --git a/rules/flashbench.make b/rules/flashbench.make > > index fcb669e..0ef52d1 100644 > > --- a/rules/flashbench.make > > +++ b/rules/flashbench.make > > @@ -31,7 +31,7 @@ FLASHBENCH_LICENSE:= GPL v2 > > > > FLASHBENCH_CONF_TOOL := NO > > FLASHBENCH_MAKE_ENV:= $(CROSS_ENV) > > -FLASHBENCH_MAKE_OPT:= CC=$(CROSS_CC) \ > > Please add a comment here. Otherwise it it not clear why this is needed. Then we should discuss about comments in the changed files or in the change itself. In the Linux kernel for example I see more and more complex comments in the change itself and nothing in the changed file. What is better? What is read more often? The change itself or the changed file? jbe -- Pengutronix e.K. | Juergen Beisert | Linux Solutions for Science and Industry | http://www.pengutronix.de/ | -- ptxdist mailing list ptxdist@pengutronix.de
Re: [ptxdist] [PATCH] flashbench: Fix error when flashbench is not selected
On Tue, Mar 20, 2012 at 08:36:47PM +0100, Bernhard Walle wrote: > When flashbench is not selected in "ptxdist menuconfig", then > $(PTXCONF_FLASHBENCH_MAX_BUFSIZE) is undefined. In that case, the expr > call fails. > > Fix the problem by delaying the evaluation of FLASHBENCH_MAKE_OPT until > it's really needed, i.e. when flashbench has been selected. > > Signed-off-by: Bernhard Walle > --- > rules/flashbench.make |2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/rules/flashbench.make b/rules/flashbench.make > index fcb669e..0ef52d1 100644 > --- a/rules/flashbench.make > +++ b/rules/flashbench.make > @@ -31,7 +31,7 @@ FLASHBENCH_LICENSE := GPL v2 > > FLASHBENCH_CONF_TOOL := NO > FLASHBENCH_MAKE_ENV := $(CROSS_ENV) > -FLASHBENCH_MAKE_OPT := CC=$(CROSS_CC) \ Please add a comment here. Otherwise it it not clear why this is needed. Michael > +FLASHBENCH_MAKE_OPT = CC=$(CROSS_CC) \ > EXTRA_CFLAGS=-DMAX_BUFSIZE=$(shell expr 1024 \* 1024 \* > $(PTXCONF_FLASHBENCH_MAX_BUFSIZE)) > > # > > -- > 1.7.9.4 > > > -- > ptxdist mailing list > ptxdist@pengutronix.de > -- Pengutronix e.K. | | Industrial Linux Solutions | http://www.pengutronix.de/ | Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0| Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917- | -- ptxdist mailing list ptxdist@pengutronix.de
Re: [ptxdist] [PATCH] flashbench: Fix error when flashbench is not selected
Hi, 2012/3/20 Bernhard Walle : > When flashbench is not selected in "ptxdist menuconfig", then > $(PTXCONF_FLASHBENCH_MAX_BUFSIZE) is undefined. In that case, the expr > call fails. > > Fix the problem by delaying the evaluation of FLASHBENCH_MAKE_OPT until > it's really needed, i.e. when flashbench has been selected. > > Signed-off-by: Bernhard Walle > --- > rules/flashbench.make | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/rules/flashbench.make b/rules/flashbench.make > index fcb669e..0ef52d1 100644 > --- a/rules/flashbench.make > +++ b/rules/flashbench.make > @@ -31,7 +31,7 @@ FLASHBENCH_LICENSE := GPL v2 > > FLASHBENCH_CONF_TOOL := NO > FLASHBENCH_MAKE_ENV := $(CROSS_ENV) > -FLASHBENCH_MAKE_OPT := CC=$(CROSS_CC) \ > +FLASHBENCH_MAKE_OPT = CC=$(CROSS_CC) \ > EXTRA_CFLAGS=-DMAX_BUFSIZE=$(shell expr 1024 \* 1024 \* > $(PTXCONF_FLASHBENCH_MAX_BUFSIZE)) Acked-by: Remy Bohmer Kind regards, Remy -- ptxdist mailing list ptxdist@pengutronix.de
[ptxdist] [PATCH] flashbench: Fix error when flashbench is not selected
When flashbench is not selected in "ptxdist menuconfig", then $(PTXCONF_FLASHBENCH_MAX_BUFSIZE) is undefined. In that case, the expr call fails. Fix the problem by delaying the evaluation of FLASHBENCH_MAKE_OPT until it's really needed, i.e. when flashbench has been selected. Signed-off-by: Bernhard Walle --- rules/flashbench.make |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rules/flashbench.make b/rules/flashbench.make index fcb669e..0ef52d1 100644 --- a/rules/flashbench.make +++ b/rules/flashbench.make @@ -31,7 +31,7 @@ FLASHBENCH_LICENSE:= GPL v2 FLASHBENCH_CONF_TOOL := NO FLASHBENCH_MAKE_ENV:= $(CROSS_ENV) -FLASHBENCH_MAKE_OPT:= CC=$(CROSS_CC) \ +FLASHBENCH_MAKE_OPT= CC=$(CROSS_CC) \ EXTRA_CFLAGS=-DMAX_BUFSIZE=$(shell expr 1024 \* 1024 \* $(PTXCONF_FLASHBENCH_MAX_BUFSIZE)) # -- 1.7.9.4 -- ptxdist mailing list ptxdist@pengutronix.de