Patchwork [U-Boot,v2,2/3] tools/proftool: remove REG_NOERROR

login
register
mail settings
Submitter Andreas Bießmann
Date July 2, 2013, 6:37 a.m.
Message ID <1372747057-85539-3-git-send-email-andreas.devel@googlemail.com>
Download mbox | patch
Permalink /patch/256288/
State Accepted
Delegated to: Tom Rini
Headers show

Comments

Andreas Bießmann - July 2, 2013, 6:37 a.m.
Remove non portable usage of REG_NOERROR.
BSD (like OS X) variants of regex.h do not declare REG_NOERROR, even GNU
regex(3) do mention REG_NOERROR, just remove it.

Signed-off-by: Andreas Bießmann <andreas.devel@googlemail.com>
---
Changes in v2:
 - remove REG_NOERROR instead of defining it conditionally (as Jeroen
   suggested)

 tools/proftool.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Jeroen Hofstee - July 2, 2013, 6:19 p.m.
Hello Andreas,

On 07/02/2013 08:37 AM, Andreas Bießmann wrote:
> Remove non portable usage of REG_NOERROR.
> BSD (like OS X) variants of regex.h do not declare REG_NOERROR, even GNU
> regex(3) do mention REG_NOERROR, just remove it.
                ^ does _not_

Perhaps Tom can amend it while applying. Anyway ..

Acked-by: Jeroen Hofstee <jeroen@myspectrum.nl>

And compile tested on FreeBSD (the 3 of them).

Regards,
Jeroen
Simon Glass - July 3, 2013, 2:24 p.m.
On Tue, Jul 2, 2013 at 3:37 PM, Andreas Bießmann <
andreas.devel@googlemail.com> wrote:

> Remove non portable usage of REG_NOERROR.
> BSD (like OS X) variants of regex.h do not declare REG_NOERROR, even GNU
> regex(3) do mention REG_NOERROR, just remove it.
>
> Signed-off-by: Andreas Bießmann <andreas.devel@googlemail.com>
>

Reviewed-by: Simon Glass <sjg@chromium.org>

Patch

diff --git a/tools/proftool.c b/tools/proftool.c
index a48ed28..aa05e77 100644
--- a/tools/proftool.c
+++ b/tools/proftool.c
@@ -333,7 +333,7 @@  static void check_trace_config_line(struct trace_configline_info *item)
 		if (err == REG_NOMATCH)
 			continue;
 
-		if (err != REG_NOERROR) {
+		if (err) {
 			regex_report_error(&item->regex, err, "match",
 					   item->name);
 			break;