mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH 1/3] loadb: add missing brackets in help
@ 2015-10-26 18:10 Alexander Aring
  2015-10-26 18:10 ` [PATCH 2/3] checkpatch: fix left brace warning Alexander Aring
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Alexander Aring @ 2015-10-26 18:10 UTC (permalink / raw)
  To: barebox

This patch adds missing brackets in the help text of loadb command.

Signed-off-by: Alexander Aring <alex.aring@gmail.com>
---
 commands/loadb.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/commands/loadb.c b/commands/loadb.c
index be5830d..aabb00a 100644
--- a/commands/loadb.c
+++ b/commands/loadb.c
@@ -681,9 +681,9 @@ static int do_load_serial_bin(int argc, char *argv[])
 BAREBOX_CMD_HELP_START(loadb)
 BAREBOX_CMD_HELP_TEXT("")
 BAREBOX_CMD_HELP_TEXT("Options:")
-BAREBOX_CMD_HELP_OPT("-f FILE", "download to FILE (default image.bin")
+BAREBOX_CMD_HELP_OPT("-f FILE", "download to FILE (default image.bin)")
 BAREBOX_CMD_HELP_OPT("-o OFFS", "destination file OFFSet (default 0)")
-BAREBOX_CMD_HELP_OPT("-b BAUD", "baudrate for download (default: console baudrate")
+BAREBOX_CMD_HELP_OPT("-b BAUD", "baudrate for download (default: console baudrate)")
 BAREBOX_CMD_HELP_END
 
 BAREBOX_CMD_START(loadb)
-- 
2.6.1


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH 2/3] checkpatch: fix left brace warning
  2015-10-26 18:10 [PATCH 1/3] loadb: add missing brackets in help Alexander Aring
@ 2015-10-26 18:10 ` Alexander Aring
  2015-10-26 18:10 ` [PATCH 3/3] amba: check if on remove callback Alexander Aring
  2015-10-27 15:46 ` [PATCH 1/3] loadb: add missing brackets in help Sascha Hauer
  2 siblings, 0 replies; 4+ messages in thread
From: Alexander Aring @ 2015-10-26 18:10 UTC (permalink / raw)
  To: barebox

Running checkpatch with perl version 5.22 occur the following warnings:

Unescaped left brace in regex is deprecated, ... checkpatch.pl line 2017.
Unescaped left brace in regex is deprecated, ... checkpatch.pl line 2267.
Unescaped left brace in regex is deprecated, ... checkpatch.pl line 2268.
...
lot of weird things
...
)\(.*\).*\s{ <-- HERE / at ./scripts/checkpatch.pl line 2016.

This patch fix these warning, an similar commit was done in linux kernel
commit: 4e5d56bdf892e18832a6540b63ebf709966bce2a ("checkpatch: fix left
brace warning").

Signed-off-by: Alexander Aring <alex.aring@gmail.com>
---
 scripts/checkpatch.pl | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index 8d96434..f3fd339 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -2013,8 +2013,8 @@ sub process {
 
 # function brace can't be on same line, except for #defines of do while,
 # or if closed on same line
-		if (($line=~/$Type\s*$Ident\(.*\).*\s{/) and
-		    !($line=~/\#\s*define.*do\s{/) and !($line=~/}/)) {
+		if (($line=~/$Type\s*$Ident\(.*\).*\s\{/) and
+		    !($line=~/\#\s*define.*do\s\{/) and !($line=~/}/)) {
 			ERROR("open brace '{' following function declarations go on the next line\n" . $herecurr);
 		}
 
@@ -2264,8 +2264,8 @@ sub process {
 ## 		}
 
 #need space before brace following if, while, etc
-		if (($line =~ /\(.*\){/ && $line !~ /\($Type\){/) ||
-		    $line =~ /do{/) {
+		if (($line =~ /\(.*\)\{/ && $line !~ /\($Type\){/) ||
+		    $line =~ /do\{/) {
 			ERROR("space required before the open brace '{'\n" . $herecurr);
 		}
 
-- 
2.6.1


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH 3/3] amba: check if on remove callback
  2015-10-26 18:10 [PATCH 1/3] loadb: add missing brackets in help Alexander Aring
  2015-10-26 18:10 ` [PATCH 2/3] checkpatch: fix left brace warning Alexander Aring
@ 2015-10-26 18:10 ` Alexander Aring
  2015-10-27 15:46 ` [PATCH 1/3] loadb: add missing brackets in help Sascha Hauer
  2 siblings, 0 replies; 4+ messages in thread
From: Alexander Aring @ 2015-10-26 18:10 UTC (permalink / raw)
  To: barebox

Currently we get a null pointer dereference when booting linux on RPi
which use "uart-pl011" driver. This driver doesn't implement a remove
driver callback. This patch adds a check before calling the remove
callback if the driver which use the amba bus implement such
functionality.

Signed-off-by: Alexander Aring <alex.aring@gmail.com>
---
 drivers/amba/bus.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/amba/bus.c b/drivers/amba/bus.c
index b934e11..ddd9661 100644
--- a/drivers/amba/bus.c
+++ b/drivers/amba/bus.c
@@ -70,7 +70,8 @@ static void amba_remove(struct device_d *dev)
 	struct amba_device *pcdev = to_amba_device(dev);
 	struct amba_driver *drv = to_amba_driver(dev->driver);
 
-	drv->remove(pcdev);
+	if (drv->remove)
+		drv->remove(pcdev);
 }
 
 struct bus_type amba_bustype = {
-- 
2.6.1


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH 1/3] loadb: add missing brackets in help
  2015-10-26 18:10 [PATCH 1/3] loadb: add missing brackets in help Alexander Aring
  2015-10-26 18:10 ` [PATCH 2/3] checkpatch: fix left brace warning Alexander Aring
  2015-10-26 18:10 ` [PATCH 3/3] amba: check if on remove callback Alexander Aring
@ 2015-10-27 15:46 ` Sascha Hauer
  2 siblings, 0 replies; 4+ messages in thread
From: Sascha Hauer @ 2015-10-27 15:46 UTC (permalink / raw)
  To: Alexander Aring; +Cc: barebox

On Mon, Oct 26, 2015 at 07:10:27PM +0100, Alexander Aring wrote:
> This patch adds missing brackets in the help text of loadb command.
> 
> Signed-off-by: Alexander Aring <alex.aring@gmail.com>

Applied, thanks

Sascha

> ---
>  commands/loadb.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/commands/loadb.c b/commands/loadb.c
> index be5830d..aabb00a 100644
> --- a/commands/loadb.c
> +++ b/commands/loadb.c
> @@ -681,9 +681,9 @@ static int do_load_serial_bin(int argc, char *argv[])
>  BAREBOX_CMD_HELP_START(loadb)
>  BAREBOX_CMD_HELP_TEXT("")
>  BAREBOX_CMD_HELP_TEXT("Options:")
> -BAREBOX_CMD_HELP_OPT("-f FILE", "download to FILE (default image.bin")
> +BAREBOX_CMD_HELP_OPT("-f FILE", "download to FILE (default image.bin)")
>  BAREBOX_CMD_HELP_OPT("-o OFFS", "destination file OFFSet (default 0)")
> -BAREBOX_CMD_HELP_OPT("-b BAUD", "baudrate for download (default: console baudrate")
> +BAREBOX_CMD_HELP_OPT("-b BAUD", "baudrate for download (default: console baudrate)")
>  BAREBOX_CMD_HELP_END
>  
>  BAREBOX_CMD_START(loadb)
> -- 
> 2.6.1
> 
> 
> _______________________________________________
> barebox mailing list
> barebox@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/barebox
> 

-- 
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 |

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2015-10-27 15:46 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-10-26 18:10 [PATCH 1/3] loadb: add missing brackets in help Alexander Aring
2015-10-26 18:10 ` [PATCH 2/3] checkpatch: fix left brace warning Alexander Aring
2015-10-26 18:10 ` [PATCH 3/3] amba: check if on remove callback Alexander Aring
2015-10-27 15:46 ` [PATCH 1/3] loadb: add missing brackets in help Sascha Hauer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox