* [PATCH 1/3] staging: vchiq: remove braces from if block
@ 2021-09-15 20:29 ` Gaston Gonzalez
0 siblings, 0 replies; 6+ messages in thread
From: Gaston Gonzalez @ 2021-09-15 20:29 UTC (permalink / raw)
To: linux-staging
Cc: gregkh, nsaenz, stefan.wahren, arnd, dan.carpenter, ojaswin98,
amarjargal16, linux-rpi-kernel, linux-arm-kernel,
bcm-kernel-feedback-list, linux-kernel, gascoar
Remove unnecessary braces from if block.
Reported by checkpatch.pl
Signed-off-by: Gaston Gonzalez <gascoar@gmail.com>
---
.../vc04_services/interface/vchiq_arm/vchiq_connected.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_connected.c b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_connected.c
index 83502f5f3a33..f367dbe2bc63 100644
--- a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_connected.c
+++ b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_connected.c
@@ -17,9 +17,8 @@ static DEFINE_MUTEX(g_connected_mutex);
/* Function to initialize our lock */
static void connected_init(void)
{
- if (!g_once_init) {
+ if (!g_once_init)
g_once_init = 1;
- }
}
/*
--
2.33.0
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH 1/3] staging: vchiq: remove braces from if block
@ 2021-09-15 20:29 ` Gaston Gonzalez
0 siblings, 0 replies; 6+ messages in thread
From: Gaston Gonzalez @ 2021-09-15 20:29 UTC (permalink / raw)
To: linux-staging
Cc: gregkh, nsaenz, stefan.wahren, arnd, dan.carpenter, ojaswin98,
amarjargal16, linux-rpi-kernel, linux-arm-kernel,
bcm-kernel-feedback-list, linux-kernel, gascoar
Remove unnecessary braces from if block.
Reported by checkpatch.pl
Signed-off-by: Gaston Gonzalez <gascoar@gmail.com>
---
.../vc04_services/interface/vchiq_arm/vchiq_connected.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_connected.c b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_connected.c
index 83502f5f3a33..f367dbe2bc63 100644
--- a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_connected.c
+++ b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_connected.c
@@ -17,9 +17,8 @@ static DEFINE_MUTEX(g_connected_mutex);
/* Function to initialize our lock */
static void connected_init(void)
{
- if (!g_once_init) {
+ if (!g_once_init)
g_once_init = 1;
- }
}
/*
--
2.33.0
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH 2/3] staging: vchiq: add braces to if block
2021-09-15 20:29 ` Gaston Gonzalez
@ 2021-09-15 20:29 ` Gaston Gonzalez
-1 siblings, 0 replies; 6+ messages in thread
From: Gaston Gonzalez @ 2021-09-15 20:29 UTC (permalink / raw)
To: linux-staging
Cc: gregkh, nsaenz, stefan.wahren, arnd, dan.carpenter, ojaswin98,
amarjargal16, linux-rpi-kernel, linux-arm-kernel,
bcm-kernel-feedback-list, linux-kernel, gascoar
The rule of not using braces in single statement does not apply if only
one branch of the conditional statement is a single statement. Add
braces to fix this.
While at it, remove extra blank space after a comment inside the if
block.
Reported by checkpatch.pl
Signed-off-by: Gaston Gonzalez <gascoar@gmail.com>
---
.../vc04_services/interface/vchiq_arm/vchiq_connected.c | 9 ++++-----
1 file changed, 4 insertions(+), 5 deletions(-)
diff --git a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_connected.c b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_connected.c
index f367dbe2bc63..1802fd5e4888 100644
--- a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_connected.c
+++ b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_connected.c
@@ -34,16 +34,15 @@ void vchiq_add_connected_callback(void (*callback)(void))
if (mutex_lock_killable(&g_connected_mutex))
return;
- if (g_connected)
+ if (g_connected) {
/* We're already connected. Call the callback immediately. */
-
callback();
- else {
- if (g_num_deferred_callbacks >= MAX_CALLBACKS)
+ } else {
+ if (g_num_deferred_callbacks >= MAX_CALLBACKS) {
vchiq_log_error(vchiq_core_log_level,
"There already %d callback registered - please increase MAX_CALLBACKS",
g_num_deferred_callbacks);
- else {
+ } else {
g_deferred_callback[g_num_deferred_callbacks] =
callback;
g_num_deferred_callbacks++;
--
2.33.0
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH 2/3] staging: vchiq: add braces to if block
@ 2021-09-15 20:29 ` Gaston Gonzalez
0 siblings, 0 replies; 6+ messages in thread
From: Gaston Gonzalez @ 2021-09-15 20:29 UTC (permalink / raw)
To: linux-staging
Cc: gregkh, nsaenz, stefan.wahren, arnd, dan.carpenter, ojaswin98,
amarjargal16, linux-rpi-kernel, linux-arm-kernel,
bcm-kernel-feedback-list, linux-kernel, gascoar
The rule of not using braces in single statement does not apply if only
one branch of the conditional statement is a single statement. Add
braces to fix this.
While at it, remove extra blank space after a comment inside the if
block.
Reported by checkpatch.pl
Signed-off-by: Gaston Gonzalez <gascoar@gmail.com>
---
.../vc04_services/interface/vchiq_arm/vchiq_connected.c | 9 ++++-----
1 file changed, 4 insertions(+), 5 deletions(-)
diff --git a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_connected.c b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_connected.c
index f367dbe2bc63..1802fd5e4888 100644
--- a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_connected.c
+++ b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_connected.c
@@ -34,16 +34,15 @@ void vchiq_add_connected_callback(void (*callback)(void))
if (mutex_lock_killable(&g_connected_mutex))
return;
- if (g_connected)
+ if (g_connected) {
/* We're already connected. Call the callback immediately. */
-
callback();
- else {
- if (g_num_deferred_callbacks >= MAX_CALLBACKS)
+ } else {
+ if (g_num_deferred_callbacks >= MAX_CALLBACKS) {
vchiq_log_error(vchiq_core_log_level,
"There already %d callback registered - please increase MAX_CALLBACKS",
g_num_deferred_callbacks);
- else {
+ } else {
g_deferred_callback[g_num_deferred_callbacks] =
callback;
g_num_deferred_callbacks++;
--
2.33.0
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH 3/3] staging: vchiq: cleanup code alignment issues
2021-09-15 20:29 ` Gaston Gonzalez
@ 2021-09-15 20:29 ` Gaston Gonzalez
-1 siblings, 0 replies; 6+ messages in thread
From: Gaston Gonzalez @ 2021-09-15 20:29 UTC (permalink / raw)
To: linux-staging
Cc: gregkh, nsaenz, stefan.wahren, arnd, dan.carpenter, ojaswin98,
amarjargal16, linux-rpi-kernel, linux-arm-kernel,
bcm-kernel-feedback-list, linux-kernel, gascoar
Fix code alignment issues.
Reported by checkpatch.pl
Signed-off-by: Gaston Gonzalez <gascoar@gmail.com>
---
.../vc04_services/interface/vchiq_arm/vchiq_connected.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_connected.c b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_connected.c
index 1802fd5e4888..bdb0ab617d8b 100644
--- a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_connected.c
+++ b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_connected.c
@@ -40,8 +40,8 @@ void vchiq_add_connected_callback(void (*callback)(void))
} else {
if (g_num_deferred_callbacks >= MAX_CALLBACKS) {
vchiq_log_error(vchiq_core_log_level,
- "There already %d callback registered - please increase MAX_CALLBACKS",
- g_num_deferred_callbacks);
+ "There already %d callback registered - please increase MAX_CALLBACKS",
+ g_num_deferred_callbacks);
} else {
g_deferred_callback[g_num_deferred_callbacks] =
callback;
--
2.33.0
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH 3/3] staging: vchiq: cleanup code alignment issues
@ 2021-09-15 20:29 ` Gaston Gonzalez
0 siblings, 0 replies; 6+ messages in thread
From: Gaston Gonzalez @ 2021-09-15 20:29 UTC (permalink / raw)
To: linux-staging
Cc: gregkh, nsaenz, stefan.wahren, arnd, dan.carpenter, ojaswin98,
amarjargal16, linux-rpi-kernel, linux-arm-kernel,
bcm-kernel-feedback-list, linux-kernel, gascoar
Fix code alignment issues.
Reported by checkpatch.pl
Signed-off-by: Gaston Gonzalez <gascoar@gmail.com>
---
.../vc04_services/interface/vchiq_arm/vchiq_connected.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_connected.c b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_connected.c
index 1802fd5e4888..bdb0ab617d8b 100644
--- a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_connected.c
+++ b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_connected.c
@@ -40,8 +40,8 @@ void vchiq_add_connected_callback(void (*callback)(void))
} else {
if (g_num_deferred_callbacks >= MAX_CALLBACKS) {
vchiq_log_error(vchiq_core_log_level,
- "There already %d callback registered - please increase MAX_CALLBACKS",
- g_num_deferred_callbacks);
+ "There already %d callback registered - please increase MAX_CALLBACKS",
+ g_num_deferred_callbacks);
} else {
g_deferred_callback[g_num_deferred_callbacks] =
callback;
--
2.33.0
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply related [flat|nested] 6+ messages in thread
end of thread, other threads:[~2021-09-15 20:31 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-09-15 20:29 [PATCH 1/3] staging: vchiq: remove braces from if block Gaston Gonzalez
2021-09-15 20:29 ` Gaston Gonzalez
2021-09-15 20:29 ` [PATCH 2/3] staging: vchiq: add braces to " Gaston Gonzalez
2021-09-15 20:29 ` Gaston Gonzalez
2021-09-15 20:29 ` [PATCH 3/3] staging: vchiq: cleanup code alignment issues Gaston Gonzalez
2021-09-15 20:29 ` Gaston Gonzalez
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.