linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 2/4] staging: gasket: Move open-curly brace to match kernel code style
       [not found] <1531423694-22478-1-git-send-email-felix.siegel@posteo.de>
@ 2018-07-12 19:27 ` Felix Siegel
  2018-07-12 19:27 ` [PATCH 3/4] staging: gasket: fix multi line comments style Felix Siegel
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 8+ messages in thread
From: Felix Siegel @ 2018-07-12 19:27 UTC (permalink / raw)
  To: devel
  Cc: Felix Siegel, Rob Springer, John Joseph, Ben Chan,
	Greg Kroah-Hartman, linux-kernel

Move open open-curly brace to the next line following function
definition to match the kernel's coding style

Signed-off-by: Felix Siegel <felix.siegel@posteo.de>
---
 drivers/staging/gasket/gasket_core.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/staging/gasket/gasket_core.c b/drivers/staging/gasket/gasket_core.c
index 24e85fb..d7fdfa1 100644
--- a/drivers/staging/gasket/gasket_core.c
+++ b/drivers/staging/gasket/gasket_core.c
@@ -1895,7 +1895,8 @@ int gasket_reset_nolock(struct gasket_dev *gasket_dev, uint reset_type)
 EXPORT_SYMBOL(gasket_reset_nolock);
 
 gasket_ioctl_permissions_cb_t gasket_get_ioctl_permissions_cb(
-	struct gasket_dev *gasket_dev) {
+	struct gasket_dev *gasket_dev)
+{
 	return gasket_dev->internal_desc->driver_desc->ioctl_permissions_cb;
 }
 EXPORT_SYMBOL(gasket_get_ioctl_permissions_cb);
-- 
2.7.4


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

* [PATCH 3/4] staging: gasket: fix multi line comments style
       [not found] <1531423694-22478-1-git-send-email-felix.siegel@posteo.de>
  2018-07-12 19:27 ` [PATCH 2/4] staging: gasket: Move open-curly brace to match kernel code style Felix Siegel
@ 2018-07-12 19:27 ` Felix Siegel
  2018-07-12 19:53   ` Greg Kroah-Hartman
  2018-07-12 19:27 ` [PATCH 4/4] staging: gasket: Use __func__ instead of hardcoded string - Style Felix Siegel
  2018-07-12 19:42 ` [PATCH 1/4] staging: gasket: add SPDX-License-Identifier tag Greg Kroah-Hartman
  3 siblings, 1 reply; 8+ messages in thread
From: Felix Siegel @ 2018-07-12 19:27 UTC (permalink / raw)
  To: devel
  Cc: Felix Siegel, Rob Springer, John Joseph, Ben Chan,
	Greg Kroah-Hartman, linux-kernel

This patch fixes checkpatch.pl warnings:

WARNING: Block comments should align the * on each line
Signed-off-by: Felix Siegel <felix.siegel@posteo.de>
---
 drivers/staging/gasket/gasket_core.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/gasket/gasket_core.c b/drivers/staging/gasket/gasket_core.c
index d7fdfa1..5eeaae7 100644
--- a/drivers/staging/gasket/gasket_core.c
+++ b/drivers/staging/gasket/gasket_core.c
@@ -1347,9 +1347,9 @@ static bool gasket_mm_get_mapping_addrs(
 	*virt_offset = 0;
 	if (bar_offset + requested_length < range_start) {
 		/*
-		* If the requested region is completely below the range,
-		* there is nothing to map.
-		*/
+		 * If the requested region is completely below the range,
+		 * there is nothing to map.
+		 */
 		return false;
 	} else if (bar_offset <= range_start) {
 		/* If the bar offset is below this range's start
@@ -1507,7 +1507,7 @@ static enum do_map_region_status do_map_region(
  * Calculates the offset where the VMA range begins in its containing BAR.
  * The offset is written into bar_offset on success.
  * Returns zero on success, anything else on error.
-*/
+ */
 static int gasket_mm_vma_bar_offset(
 	const struct gasket_dev *gasket_dev, const struct vm_area_struct *vma,
 	ulong *bar_offset)
-- 
2.7.4


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

* [PATCH 4/4] staging: gasket: Use __func__ instead of hardcoded string - Style
       [not found] <1531423694-22478-1-git-send-email-felix.siegel@posteo.de>
  2018-07-12 19:27 ` [PATCH 2/4] staging: gasket: Move open-curly brace to match kernel code style Felix Siegel
  2018-07-12 19:27 ` [PATCH 3/4] staging: gasket: fix multi line comments style Felix Siegel
@ 2018-07-12 19:27 ` Felix Siegel
  2018-07-12 19:53   ` Greg Kroah-Hartman
  2018-07-12 19:42 ` [PATCH 1/4] staging: gasket: add SPDX-License-Identifier tag Greg Kroah-Hartman
  3 siblings, 1 reply; 8+ messages in thread
From: Felix Siegel @ 2018-07-12 19:27 UTC (permalink / raw)
  To: devel
  Cc: Felix Siegel, Rob Springer, John Joseph, Ben Chan,
	Greg Kroah-Hartman, linux-kernel

Changed logging statements to use %s and __func__ instead of hard coding
the function name in a string.

Signed-off-by: Felix Siegel <felix.siegel@posteo.de>
---
 drivers/staging/gasket/apex_driver.c       | 15 ++++++++-------
 drivers/staging/gasket/gasket_core.c       | 11 ++++++-----
 drivers/staging/gasket/gasket_ioctl.c      |  4 ++--
 drivers/staging/gasket/gasket_page_table.c | 13 ++++++++-----
 4 files changed, 24 insertions(+), 19 deletions(-)

diff --git a/drivers/staging/gasket/apex_driver.c b/drivers/staging/gasket/apex_driver.c
index ffcc59d..735d43d 100644
--- a/drivers/staging/gasket/apex_driver.c
+++ b/drivers/staging/gasket/apex_driver.c
@@ -341,7 +341,7 @@ static int apex_add_dev_cb(struct gasket_dev *gasket_dev)
 	ulong page_table_ready, msix_table_ready;
 	int retries = 0;
 
-	gasket_log_error(gasket_dev, "apex_add_dev_cb.");
+	gasket_log_error(gasket_dev, "%s.", __func__);
 
 	apex_reset(gasket_dev, 0);
 
@@ -422,8 +422,9 @@ static int apex_device_cleanup(struct gasket_dev *gasket_dev)
 
 	gasket_log_info(
 		gasket_dev,
-		"apex_device_cleanup 0x%p hib_error 0x%llx scalar_error "
+		"%s 0x%p hib_error 0x%llx scalar_error "
 		"0x%llx.",
+		__func__,
 		gasket_dev, hib_error, scalar_error);
 
 	if (allow_power_save)
@@ -447,13 +448,13 @@ static int apex_reset(struct gasket_dev *gasket_dev, uint type)
 	if (bypass_top_level)
 		return 0;
 
-	gasket_log_debug(gasket_dev, "apex_reset.");
+	gasket_log_debug(gasket_dev, "%s.", __func__);
 
 	if (!is_gcb_in_reset(gasket_dev)) {
 		/* We are not in reset - toggle the reset bit so as to force
 		 * re-init of custom block
 		 */
-		gasket_log_debug(gasket_dev, "apex_reset: toggle reset.");
+		gasket_log_debug(gasket_dev, "%s: toggle reset.", __func__);
 
 		ret = apex_enter_reset(gasket_dev, type);
 		if (ret)
@@ -472,7 +473,7 @@ static int apex_enter_reset(struct gasket_dev *gasket_dev, uint type)
 	if (bypass_top_level)
 		return 0;
 
-	gasket_log_debug(gasket_dev, "apex_enter_reset.");
+	gasket_log_debug(gasket_dev, "%s.", __func__);
 
 	/*
 	 * Software reset:
@@ -534,7 +535,7 @@ static int apex_quit_reset(struct gasket_dev *gasket_dev, uint type)
 	if (bypass_top_level)
 		return 0;
 
-	gasket_log_debug(gasket_dev, "apex_quit_reset.");
+	gasket_log_debug(gasket_dev, "%s.", __func__);
 
 	/*
 	 * Disable sleep mode:
@@ -681,7 +682,7 @@ static long apex_clock_gating(struct gasket_dev *gasket_dev, ulong arg)
 			return -EFAULT;
 
 		gasket_log_error(
-			gasket_dev, "apex_clock_gating %llu", ibuf.enable);
+			gasket_dev, "%s %llu", __func__, ibuf.enable);
 
 		if (ibuf.enable) {
 			/* Quiesce AXI, gate GCB clock. */
diff --git a/drivers/staging/gasket/gasket_core.c b/drivers/staging/gasket/gasket_core.c
index 5eeaae7..b14a956 100644
--- a/drivers/staging/gasket/gasket_core.c
+++ b/drivers/staging/gasket/gasket_core.c
@@ -932,7 +932,8 @@ static int gasket_enable_dev(
 		} else {
 			gasket_log_error(
 				gasket_dev,
-				"gasket_enable_dev with no physical device!!");
+				"%s with no physical device!!",
+				__func__);
 			WARN_ON(1);
 			ddev = NULL;
 		}
@@ -2100,9 +2101,9 @@ int gasket_wait_sync(
 		if (diff_nanosec > timeout_ns) {
 			gasket_log_error(
 				gasket_dev,
-				"gasket_wait_sync timeout: reg %llx count %x "
+				"%s timeout: reg %llx count %x "
 				"dma %lld ns\n",
-				offset, count, diff_nanosec);
+				__func__, offset, count, diff_nanosec);
 			return -1;
 		}
 		reg = gasket_dev_read_64(gasket_dev, bar, offset);
@@ -2141,8 +2142,8 @@ int gasket_wait_with_reschedule(
 	if (retries == max_retries) {
 		gasket_log_error(
 			gasket_dev,
-			"gasket_wait_with_reschedule timeout: reg %llx timeout (%llu ms)",
-			offset, max_retries * delay_ms);
+			"%s timeout: reg %llx timeout (%llu ms)",
+			__func__, offset, max_retries * delay_ms);
 		return -EINVAL;
 	}
 	return 0;
diff --git a/drivers/staging/gasket/gasket_ioctl.c b/drivers/staging/gasket/gasket_ioctl.c
index 832beed..738c56f 100644
--- a/drivers/staging/gasket/gasket_ioctl.c
+++ b/drivers/staging/gasket/gasket_ioctl.c
@@ -180,8 +180,8 @@ static uint gasket_ioctl_check_permissions(struct file *filp, uint cmd)
 	alive = (gasket_dev->status == GASKET_STATUS_ALIVE);
 	if (!alive) {
 		gasket_nodev_error(
-			"gasket_ioctl_check_permissions alive %d status %d.",
-			alive, gasket_dev->status);
+			"%s alive %d status %d.",
+			__func__,  alive, gasket_dev->status);
 	}
 
 	root = capable(CAP_SYS_ADMIN);
diff --git a/drivers/staging/gasket/gasket_page_table.c b/drivers/staging/gasket/gasket_page_table.c
index 04ea0d2..8021272 100644
--- a/drivers/staging/gasket/gasket_page_table.c
+++ b/drivers/staging/gasket/gasket_page_table.c
@@ -445,8 +445,9 @@ int gasket_page_table_map(
 	mutex_unlock(&pg_tbl->mutex);
 
 	gasket_nodev_debug(
-		"gasket_page_table_map done: ha %llx daddr %llx num %d, "
+		"%s done: ha %llx daddr %llx num %d, "
 		"ret %d\n",
+		__func__,
 		(unsigned long long)host_addr,
 		(unsigned long long)dev_addr, num_pages, ret);
 	return ret;
@@ -869,7 +870,7 @@ static int gasket_perform_mapping(
 	for (i = 0; i < num_pages; i++) {
 		page_addr = host_addr + i * PAGE_SIZE;
 		offset = page_addr & (PAGE_SIZE - 1);
-		gasket_nodev_debug("gasket_perform_mapping i %d\n", i);
+		gasket_nodev_debug("%s i %d\n", __func__, i);
 		if (is_coherent(pg_tbl, host_addr)) {
 			u64 off =
 				(u64)host_addr -
@@ -907,17 +908,19 @@ static int gasket_perform_mapping(
 			}
 
 			gasket_nodev_debug(
-				"    gasket_perform_mapping dev %p "
+				"    %s dev %p "
 				"i %d pte %p pfn %p -> mapped %llx\n",
+				__func__,
 				pg_tbl->device, i, &ptes[i],
 				(void *)page_to_pfn(page),
 				(unsigned long long)ptes[i].dma_addr);
 
 			if (ptes[i].dma_addr == -1) {
 				gasket_nodev_error(
-					"gasket_perform_mapping i %d"
+					"%s i %d"
 					" -> fail to map page %llx "
 					"[pfn %p ohys %p]\n",
+					__func__,
 					i,
 					(unsigned long long)ptes[i].dma_addr,
 					(void *)page_to_pfn(page),
@@ -1623,7 +1626,7 @@ int gasket_set_user_virt(
 	pg_tbl = gasket_dev->page_table[0];
 	if (!pg_tbl) {
 		gasket_nodev_error(
-			"gasket_set_user_virt: invalid page table index");
+			"%s: invalid page table index", __func__);
 		return 0;
 	}
 	for (j = 0; j < num_pages; j++) {
-- 
2.7.4


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

* Re: [PATCH 1/4] staging: gasket: add SPDX-License-Identifier tag
       [not found] <1531423694-22478-1-git-send-email-felix.siegel@posteo.de>
                   ` (2 preceding siblings ...)
  2018-07-12 19:27 ` [PATCH 4/4] staging: gasket: Use __func__ instead of hardcoded string - Style Felix Siegel
@ 2018-07-12 19:42 ` Greg Kroah-Hartman
  2018-07-12 20:28   ` Felix Siegel
  3 siblings, 1 reply; 8+ messages in thread
From: Greg Kroah-Hartman @ 2018-07-12 19:42 UTC (permalink / raw)
  To: Felix Siegel; +Cc: devel, Rob Springer, John Joseph, Ben Chan, linux-kernel

On Thu, Jul 12, 2018 at 09:27:12PM +0200, Felix Siegel wrote:
> Use GPL-2.0 based on the license text in each of the files.
> Remove license "boiler-plate".
> 
> Signed-off-by: Felix Siegel <felix.siegel@posteo.de>

I sent this same patch 1 1/2 days ago :)

sorry,

greg k-h

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

* Re: [PATCH 4/4] staging: gasket: Use __func__ instead of hardcoded string - Style
  2018-07-12 19:27 ` [PATCH 4/4] staging: gasket: Use __func__ instead of hardcoded string - Style Felix Siegel
@ 2018-07-12 19:53   ` Greg Kroah-Hartman
  0 siblings, 0 replies; 8+ messages in thread
From: Greg Kroah-Hartman @ 2018-07-12 19:53 UTC (permalink / raw)
  To: Felix Siegel; +Cc: devel, John Joseph, linux-kernel, Rob Springer

On Thu, Jul 12, 2018 at 09:27:15PM +0200, Felix Siegel wrote:
> Changed logging statements to use %s and __func__ instead of hard coding
> the function name in a string.
> 
> Signed-off-by: Felix Siegel <felix.siegel@posteo.de>
> ---
>  drivers/staging/gasket/apex_driver.c       | 15 ++++++++-------
>  drivers/staging/gasket/gasket_core.c       | 11 ++++++-----
>  drivers/staging/gasket/gasket_ioctl.c      |  4 ++--
>  drivers/staging/gasket/gasket_page_table.c | 13 ++++++++-----
>  4 files changed, 24 insertions(+), 19 deletions(-)
> 
> diff --git a/drivers/staging/gasket/apex_driver.c b/drivers/staging/gasket/apex_driver.c
> index ffcc59d..735d43d 100644
> --- a/drivers/staging/gasket/apex_driver.c
> +++ b/drivers/staging/gasket/apex_driver.c
> @@ -341,7 +341,7 @@ static int apex_add_dev_cb(struct gasket_dev *gasket_dev)
>  	ulong page_table_ready, msix_table_ready;
>  	int retries = 0;
>  
> -	gasket_log_error(gasket_dev, "apex_add_dev_cb.");
> +	gasket_log_error(gasket_dev, "%s.", __func__);

Function calls that do nothing but log "Look at this function I just
entered/exited!" need to just be deleted entirely, as ftrace should be
used instead.

Care to do that here, and then send a patch for the remaining messages
that do need __func__?

thanks,

greg k-h

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

* Re: [PATCH 3/4] staging: gasket: fix multi line comments style
  2018-07-12 19:27 ` [PATCH 3/4] staging: gasket: fix multi line comments style Felix Siegel
@ 2018-07-12 19:53   ` Greg Kroah-Hartman
  2018-07-12 20:44     ` Felix Siegel
  0 siblings, 1 reply; 8+ messages in thread
From: Greg Kroah-Hartman @ 2018-07-12 19:53 UTC (permalink / raw)
  To: Felix Siegel; +Cc: devel, John Joseph, linux-kernel, Rob Springer

On Thu, Jul 12, 2018 at 09:27:14PM +0200, Felix Siegel wrote:
> This patch fixes checkpatch.pl warnings:
> 
> WARNING: Block comments should align the * on each line
> Signed-off-by: Felix Siegel <felix.siegel@posteo.de>

So close, I need a blank line before the signed-of-by line :(

I'll go edit it by hand, but be more careful next time please...

thanks,

greg k-h

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

* Re: [PATCH 1/4] staging: gasket: add SPDX-License-Identifier tag
  2018-07-12 19:42 ` [PATCH 1/4] staging: gasket: add SPDX-License-Identifier tag Greg Kroah-Hartman
@ 2018-07-12 20:28   ` Felix Siegel
  0 siblings, 0 replies; 8+ messages in thread
From: Felix Siegel @ 2018-07-12 20:28 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: Felix Siegel, devel, Rob Springer, John Joseph, Ben Chan, linux-kernel

On Thu, 12 Jul 2018 21:42:49 +0200
Greg Kroah-Hartman <gregkh@linuxfoundation.org> wrote:

> On Thu, Jul 12, 2018 at 09:27:12PM +0200, Felix Siegel wrote:
> > Use GPL-2.0 based on the license text in each of the files.
> > Remove license "boiler-plate".
> > 
> > Signed-off-by: Felix Siegel <felix.siegel@posteo.de>
> 
> I sent this same patch 1 1/2 days ago :)
> 
> sorry,
> 
> greg k-h

My bad, I should have checked before sending it.

Regards,
Felix


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

* Re: [PATCH 3/4] staging: gasket: fix multi line comments style
  2018-07-12 19:53   ` Greg Kroah-Hartman
@ 2018-07-12 20:44     ` Felix Siegel
  0 siblings, 0 replies; 8+ messages in thread
From: Felix Siegel @ 2018-07-12 20:44 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: Felix Siegel, devel, John Joseph, linux-kernel, Rob Springer

On Thu, 12 Jul 2018 21:53:54 +0200
Greg Kroah-Hartman <gregkh@linuxfoundation.org> wrote:

> On Thu, Jul 12, 2018 at 09:27:14PM +0200, Felix Siegel wrote:
> > This patch fixes checkpatch.pl warnings:
> > 
> > WARNING: Block comments should align the * on each line
> > Signed-off-by: Felix Siegel <felix.siegel@posteo.de>
> 
> So close, I need a blank line before the signed-of-by line :(
> 
> I'll go edit it by hand, but be more careful next time please...
> 
> thanks,
> 
> greg k-h


Sorry, I'll look out for it next time.
Strange though, they were all added with format-patch -s.

Regards,
Felix

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

end of thread, other threads:[~2018-07-12 20:44 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <1531423694-22478-1-git-send-email-felix.siegel@posteo.de>
2018-07-12 19:27 ` [PATCH 2/4] staging: gasket: Move open-curly brace to match kernel code style Felix Siegel
2018-07-12 19:27 ` [PATCH 3/4] staging: gasket: fix multi line comments style Felix Siegel
2018-07-12 19:53   ` Greg Kroah-Hartman
2018-07-12 20:44     ` Felix Siegel
2018-07-12 19:27 ` [PATCH 4/4] staging: gasket: Use __func__ instead of hardcoded string - Style Felix Siegel
2018-07-12 19:53   ` Greg Kroah-Hartman
2018-07-12 19:42 ` [PATCH 1/4] staging: gasket: add SPDX-License-Identifier tag Greg Kroah-Hartman
2018-07-12 20:28   ` Felix Siegel

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).