Message ID | 1450752319-2941-1-git-send-email-cyril.bur@au1.ibm.com |
---|---|
State | Superseded |
Headers | show |
On Tue, 22 Dec 2015 13:45:17 +1100 Cyril Bur <cyril.bur@au1.ibm.com> wrote: Feedback welcome, I'll actually add another patch to auto detect the /dev/mtd device. It isn't too much work, so it really should be a part of this series. I'll resend. > Signed-off-by: Cyril Bur <cyril.bur@au1.ibm.com> > --- > Patch 3/3 will need to be applies after my first rework of opal-prd. > https://patchwork.ozlabs.org/patch/558688/ > > external/opal-prd/Makefile | 2 +- > external/opal-prd/test/test_pnor.c | 10 ++++++++++ > 2 files changed, 11 insertions(+), 1 deletion(-) > > diff --git a/external/opal-prd/Makefile b/external/opal-prd/Makefile > index db38d71..ff3fc73 100644 > --- a/external/opal-prd/Makefile > +++ b/external/opal-prd/Makefile > @@ -68,7 +68,7 @@ version.c: ../../make_version.sh .version > > test: test/test_pnor > > -test/test_pnor: test/test_pnor.o pnor.o libflash/libflash.o libflash/libffs.o > +test/test_pnor: test/test_pnor.o pnor.o libflash.o libffs.o blocklevel.o file.o ecc.o > $(Q_LINK)$(LINK.o) -o $@ $^ > > install: all > diff --git a/external/opal-prd/test/test_pnor.c b/external/opal-prd/test/test_pnor.c > index f4b0a6d..84e4231 100644 > --- a/external/opal-prd/test/test_pnor.c > +++ b/external/opal-prd/test/test_pnor.c > @@ -14,6 +14,7 @@ > * limitations under the License. > */ > > +#include <stdarg.h> > #include <stdio.h> > #include <stdlib.h> > #include <string.h> > @@ -25,6 +26,15 @@ > > extern void dump_parts(struct ffs_handle *ffs); > > +void pr_log(int priority, const char *fmt, ...) > +{ > + va_list ap; > + > + va_start(ap, fmt); > + vfprintf(stderr, fmt, ap); > + va_end(ap); > +} > + > int main(int argc, char **argv) > { > struct pnor pnor;
diff --git a/external/opal-prd/Makefile b/external/opal-prd/Makefile index db38d71..ff3fc73 100644 --- a/external/opal-prd/Makefile +++ b/external/opal-prd/Makefile @@ -68,7 +68,7 @@ version.c: ../../make_version.sh .version test: test/test_pnor -test/test_pnor: test/test_pnor.o pnor.o libflash/libflash.o libflash/libffs.o +test/test_pnor: test/test_pnor.o pnor.o libflash.o libffs.o blocklevel.o file.o ecc.o $(Q_LINK)$(LINK.o) -o $@ $^ install: all diff --git a/external/opal-prd/test/test_pnor.c b/external/opal-prd/test/test_pnor.c index f4b0a6d..84e4231 100644 --- a/external/opal-prd/test/test_pnor.c +++ b/external/opal-prd/test/test_pnor.c @@ -14,6 +14,7 @@ * limitations under the License. */ +#include <stdarg.h> #include <stdio.h> #include <stdlib.h> #include <string.h> @@ -25,6 +26,15 @@ extern void dump_parts(struct ffs_handle *ffs); +void pr_log(int priority, const char *fmt, ...) +{ + va_list ap; + + va_start(ap, fmt); + vfprintf(stderr, fmt, ap); + va_end(ap); +} + int main(int argc, char **argv) { struct pnor pnor;
Signed-off-by: Cyril Bur <cyril.bur@au1.ibm.com> --- Patch 3/3 will need to be applies after my first rework of opal-prd. https://patchwork.ozlabs.org/patch/558688/ external/opal-prd/Makefile | 2 +- external/opal-prd/test/test_pnor.c | 10 ++++++++++ 2 files changed, 11 insertions(+), 1 deletion(-)