From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Received: from ptx.hi.pengutronix.de ([2001:6f8:1178:2:5054:ff:fec0:8e10] ident=Debian-exim) by metis.ext.pengutronix.de with esmtp (Exim 4.72) (envelope-from ) id 1WcwfR-0006Rg-RU for ptxdist@pengutronix.de; Wed, 23 Apr 2014 14:52:49 +0200 Received: from mol by ptx.hi.pengutronix.de with local (Exim 4.80) (envelope-from ) id 1WcwfT-0006lH-4G for ptxdist@pengutronix.de; Wed, 23 Apr 2014 14:52:51 +0200 Date: Wed, 23 Apr 2014 14:52:51 +0200 From: Michael Olbrich Message-ID: <20140423125251.GM3804@pengutronix.de> References: <1381834722-20966-1-git-send-email-andreas@biessmann.de> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: Subject: Re: [ptxdist] [PATCH] flashbench: print strerror(3) Reply-To: ptxdist@pengutronix.de List-Id: PTXdist Development Mailing List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Sender: ptxdist-bounces@pengutronix.de Errors-To: ptxdist-bounces@pengutronix.de To: ptxdist@pengutronix.de Hi, On Wed, Apr 23, 2014 at 12:02:41PM +0200, Andreas Bie=DFmann wrote: > anything wrong with this patch? I remember looking at the patch, but it seems I never wrote a reply. It's a bit ugly, because from what I can tell 'returnif' is called more than once for some errors. I don't really have a strong opinion either way, but I'd prefer it if it was clean what will happen upstream here. > Bernhard, I realized this code is on your server. Would you build a > new version with this attached patch applied? Bernhard, you created a tarball. Are you our upstream or is this from somewhere else? Michael > Best regards > = > Andreas Bie=DFmann > = > Am 2013-10-15 12:58, schrieb Andreas Bie=DFmann: > >flashbench may end without any comment on error in setup (mostly > >ENOMEM on > >allocating scratch buffer). > >To avoid others searching again add strerror(3) to give a hint to > >the user. > > > >Signed-off-by: Andreas Bie=DFmann > >--- > > .../0003-flashbench-printout-error.patch | 33 > >++++++++++++++++++++ > > patches/flashbench-20120222/series | 3 +- > > 2 files changed, 35 insertions(+), 1 deletion(-) > > create mode 100644 > >patches/flashbench-20120222/0003-flashbench-printout-error.patch > > > >diff --git > >a/patches/flashbench-20120222/0003-flashbench-printout-error.patch > >b/patches/flashbench-20120222/0003-flashbench-printout-error.patch > >new file mode 100644 > >index 0000000..63c7453 > >--- /dev/null > >+++ b/patches/flashbench-20120222/0003-flashbench-printout-error.patch > >@@ -0,0 +1,33 @@ > >+From: =3D?UTF-8?q?Andreas=3D20Bie=3DC3=3D9Fmann?=3D > > > >+Date: Tue, 15 Oct 2013 12:37:48 +0200 > >+Subject: [PATCH] flashbench: printout error > >+MIME-Version: 1.0 > >+Content-Type: text/plain; charset=3DUTF-8 > >+Content-Transfer-Encoding: 8bit > >+ > >+In order to get a clue _what_ happened printout the error string. > >+ > >+Signed-off-by: Andreas Bie=DFmann > >+--- > >+ flashbench.c | 8 +++++++- > >+ 1 file changed, 7 insertions(+), 1 deletion(-) > >+ > >+diff --git a/flashbench.c b/flashbench.c > >+index 0a1016f..5b553c7 100644 > >+--- a/flashbench.c > >++++ b/flashbench.c > >+@@ -19,7 +19,13 @@ > >+ > >+ typedef long long ns_t; > >+ > >+-#define returnif(x) do { typeof(x) __x =3D (x); if (__x < 0) return > >(__x); } while (0) > >++#define returnif(x) do { > > \ > >++ typeof(x) __x =3D (x); > >\ > >++ if (__x < 0) { > >\ > >++ fprintf(stderr, "flashbench: internal error '%s'\n", > >strerror(-__x)); \ > >++ return (__x); > >\ > >++ } > >\ > >++ } while (0) > >+ > >+ static ns_t ns_min(int count, ns_t data[]) > >+ { > >diff --git a/patches/flashbench-20120222/series > >b/patches/flashbench-20120222/series > >index b63b21f..82de47c 100644 > >--- a/patches/flashbench-20120222/series > >+++ b/patches/flashbench-20120222/series > >@@ -2,4 +2,5 @@ > > #tag:base --start-number 1 > > 0001-Allow-to-specify-MAX_BUFSIZE-during-compile-time.patch > > 0002-Add-lrt-to-LDLIBS-instead-of-LDFLAGS.patch > >-# fa6c1da743f5dd6808f0f1b887b31657 - git-ptx-patches magic > >+0003-flashbench-printout-error.patch > >+# 429c331f680c7d428505b255597dd1f0 - git-ptx-patches magic > >-- > >1.7.10.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-5555 | -- = ptxdist mailing list ptxdist@pengutronix.de