All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/3] GPU: DRM: drm_agpsupport.c: Code cleanup
@ 2017-09-13 10:18 Meghana Madhyastha
  2017-09-13 10:21 ` [PATCH 1/3] GPU: DRM: Moved EXPORT_SYMBOL so that it immediately followed its function Meghana Madhyastha
                   ` (3 more replies)
  0 siblings, 4 replies; 12+ messages in thread
From: Meghana Madhyastha @ 2017-09-13 10:18 UTC (permalink / raw)
  To: Daniel Vetter, Jani Nikula, Sean Paul, outreachy-kernel

These patches fix the checkpath warnings and errors
in drm_agpsupport.c

Meghana Madhyastha (3):
  GPU: DRM: Moved EXPORT_SYMBOL so that it immediately followed its
    function
  GPU: DRM: Replace "foo * bar" with "foo *bar"
  GPU: DRM: Remove assignment in if condition

 drivers/gpu/drm/drm_agpsupport.c | 41 ++++++++++++++++++++++------------------
 1 file changed, 23 insertions(+), 18 deletions(-)

-- 
2.7.4



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

* [PATCH 1/3] GPU: DRM: Moved EXPORT_SYMBOL so that it immediately followed its function
  2017-09-13 10:18 [PATCH 0/3] GPU: DRM: drm_agpsupport.c: Code cleanup Meghana Madhyastha
@ 2017-09-13 10:21 ` Meghana Madhyastha
  2017-09-13 11:55   ` [Outreachy kernel] " Julia Lawall
  2017-09-13 10:22 ` [PATCH 2/3] GPU: DRM: Replace "foo * bar" with "foo *bar" Meghana Madhyastha
                   ` (2 subsequent siblings)
  3 siblings, 1 reply; 12+ messages in thread
From: Meghana Madhyastha @ 2017-09-13 10:21 UTC (permalink / raw)
  To: Daniel Vetter, Jani Nikula, Sean Paul, outreachy-kernel

EXPORT_SYMBOL(foo) should immediately follow its function/variable.
This coding style is preferred.
Found by checkpath.pl.

Signed-off-by: Meghana Madhyastha <meghana.madhyastha@gmail.com>
---
 drivers/gpu/drm/drm_agpsupport.c | 4 ----
 1 file changed, 4 deletions(-)

diff --git a/drivers/gpu/drm/drm_agpsupport.c b/drivers/gpu/drm/drm_agpsupport.c
index c899534..928248e 100644
--- a/drivers/gpu/drm/drm_agpsupport.c
+++ b/drivers/gpu/drm/drm_agpsupport.c
@@ -70,7 +70,6 @@ int drm_agp_info(struct drm_device *dev, struct drm_agp_info *info)
 
 	return 0;
 }
-
 EXPORT_SYMBOL(drm_agp_info);
 
 int drm_agp_info_ioctl(struct drm_device *dev, void *data,
@@ -106,7 +105,6 @@ int drm_agp_acquire(struct drm_device * dev)
 	dev->agp->acquired = 1;
 	return 0;
 }
-
 EXPORT_SYMBOL(drm_agp_acquire);
 
 /**
@@ -171,7 +169,6 @@ int drm_agp_enable(struct drm_device * dev, struct drm_agp_mode mode)
 	dev->agp->enabled = 1;
 	return 0;
 }
-
 EXPORT_SYMBOL(drm_agp_enable);
 
 int drm_agp_enable_ioctl(struct drm_device *dev, void *data,
@@ -373,7 +370,6 @@ int drm_agp_free(struct drm_device *dev, struct drm_agp_buffer *request)
 EXPORT_SYMBOL(drm_agp_free);
 
 
-
 int drm_agp_free_ioctl(struct drm_device *dev, void *data,
 		       struct drm_file *file_priv)
 {
-- 
2.7.4



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

* [PATCH 2/3] GPU: DRM: Replace "foo * bar" with "foo *bar"
  2017-09-13 10:18 [PATCH 0/3] GPU: DRM: drm_agpsupport.c: Code cleanup Meghana Madhyastha
  2017-09-13 10:21 ` [PATCH 1/3] GPU: DRM: Moved EXPORT_SYMBOL so that it immediately followed its function Meghana Madhyastha
@ 2017-09-13 10:22 ` Meghana Madhyastha
  2017-09-13 11:59   ` [Outreachy kernel] " Julia Lawall
  2017-09-13 10:23 ` [PATCH 3/3] GPU: DRM: Remove assignment in if condition Meghana Madhyastha
  2017-09-13 11:54 ` [Outreachy kernel] [PATCH 0/3] GPU: DRM: drm_agpsupport.c: Code cleanup Julia Lawall
  3 siblings, 1 reply; 12+ messages in thread
From: Meghana Madhyastha @ 2017-09-13 10:22 UTC (permalink / raw)
  To: Daniel Vetter, Jani Nikula, Sean Paul, outreachy-kernel

This replaces all instances of foo * bar with foo *bar
in drm_agpsupport.c. This is so that it adheres to
standard C syntax for pointers.

Signed-off-by: Meghana Madhyastha <meghana.madhyastha@gmail.com>
---
 drivers/gpu/drm/drm_agpsupport.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/gpu/drm/drm_agpsupport.c b/drivers/gpu/drm/drm_agpsupport.c
index 928248e..993e486 100644
--- a/drivers/gpu/drm/drm_agpsupport.c
+++ b/drivers/gpu/drm/drm_agpsupport.c
@@ -94,7 +94,7 @@ int drm_agp_info_ioctl(struct drm_device *dev, void *data,
  * Verifies the AGP device hasn't been acquired before and calls
  * \c agp_backend_acquire.
  */
-int drm_agp_acquire(struct drm_device * dev)
+int drm_agp_acquire(struct drm_device *dev)
 {
 	if (!dev->agp)
 		return -ENODEV;
@@ -133,7 +133,7 @@ int drm_agp_acquire_ioctl(struct drm_device *dev, void *data,
  *
  * Verifies the AGP device has been acquired and calls \c agp_backend_release.
  */
-int drm_agp_release(struct drm_device * dev)
+int drm_agp_release(struct drm_device *dev)
 {
 	if (!dev->agp || !dev->agp->acquired)
 		return -EINVAL;
@@ -159,7 +159,7 @@ int drm_agp_release_ioctl(struct drm_device *dev, void *data,
  * Verifies the AGP device has been acquired but not enabled, and calls
  * \c agp_enable.
  */
-int drm_agp_enable(struct drm_device * dev, struct drm_agp_mode mode)
+int drm_agp_enable(struct drm_device *dev, struct drm_agp_mode mode)
 {
 	if (!dev->agp || !dev->agp->acquired)
 		return -EINVAL;
@@ -241,8 +241,8 @@ int drm_agp_alloc_ioctl(struct drm_device *dev, void *data,
  *
  * Walks through drm_agp_head::memory until finding a matching handle.
  */
-static struct drm_agp_mem *drm_agp_lookup_entry(struct drm_device * dev,
-					   unsigned long handle)
+static struct drm_agp_mem *drm_agp_lookup_entry(struct drm_device *dev,
+						unsigned long handle)
 {
 	struct drm_agp_mem *entry;
 
-- 
2.7.4



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

* [PATCH 3/3] GPU: DRM: Remove assignment in if condition
  2017-09-13 10:18 [PATCH 0/3] GPU: DRM: drm_agpsupport.c: Code cleanup Meghana Madhyastha
  2017-09-13 10:21 ` [PATCH 1/3] GPU: DRM: Moved EXPORT_SYMBOL so that it immediately followed its function Meghana Madhyastha
  2017-09-13 10:22 ` [PATCH 2/3] GPU: DRM: Replace "foo * bar" with "foo *bar" Meghana Madhyastha
@ 2017-09-13 10:23 ` Meghana Madhyastha
  2017-09-13 12:02   ` [Outreachy kernel] " Julia Lawall
  2017-09-13 11:54 ` [Outreachy kernel] [PATCH 0/3] GPU: DRM: drm_agpsupport.c: Code cleanup Julia Lawall
  3 siblings, 1 reply; 12+ messages in thread
From: Meghana Madhyastha @ 2017-09-13 10:23 UTC (permalink / raw)
  To: Daniel Vetter, Jani Nikula, Sean Paul, outreachy-kernel

This patch moves the assignment so that
it happens before the if condition. This
results in syntax which is easier to read.

Found by checkpath.pl

Signed-off-by: Meghana Madhyastha <meghana.madhyastha@gmail.com>
---
 drivers/gpu/drm/drm_agpsupport.c | 27 ++++++++++++++++++---------
 1 file changed, 18 insertions(+), 9 deletions(-)

diff --git a/drivers/gpu/drm/drm_agpsupport.c b/drivers/gpu/drm/drm_agpsupport.c
index 993e486..08933d6 100644
--- a/drivers/gpu/drm/drm_agpsupport.c
+++ b/drivers/gpu/drm/drm_agpsupport.c
@@ -100,7 +100,8 @@ int drm_agp_acquire(struct drm_device *dev)
 		return -ENODEV;
 	if (dev->agp->acquired)
 		return -EBUSY;
-	if (!(dev->agp->bridge = agp_backend_acquire(dev->pdev)))
+	dev->agp->bridge = agp_backend_acquire(dev->pdev);
+	if (!dev->agp->bridge)
 		return -ENODEV;
 	dev->agp->acquired = 1;
 	return 0;
@@ -200,12 +201,14 @@ int drm_agp_alloc(struct drm_device *dev, struct drm_agp_buffer *request)
 
 	if (!dev->agp || !dev->agp->acquired)
 		return -EINVAL;
-	if (!(entry = kzalloc(sizeof(*entry), GFP_KERNEL)))
+	entry = kzalloc(sizeof(*entry), GFP_KERNEL);
+	if (!entry)
 		return -ENOMEM;
 
 	pages = (request->size + PAGE_SIZE - 1) / PAGE_SIZE;
 	type = (u32) request->type;
-	if (!(memory = agp_allocate_memory(dev->agp->bridge, pages, type))) {
+	memory = agp_allocate_memory(dev->agp->bridge, pages, type);
+	if (!memory) {
 		kfree(entry);
 		return -ENOMEM;
 	}
@@ -272,7 +275,8 @@ int drm_agp_unbind(struct drm_device *dev, struct drm_agp_binding *request)
 
 	if (!dev->agp || !dev->agp->acquired)
 		return -EINVAL;
-	if (!(entry = drm_agp_lookup_entry(dev, request->handle)))
+	entry = drm_agp_lookup_entry(dev, request->handle);
+	if (!entry)
 		return -EINVAL;
 	if (!entry->bound)
 		return -EINVAL;
@@ -313,12 +317,14 @@ int drm_agp_bind(struct drm_device *dev, struct drm_agp_binding *request)
 
 	if (!dev->agp || !dev->agp->acquired)
 		return -EINVAL;
-	if (!(entry = drm_agp_lookup_entry(dev, request->handle)))
+	entry = drm_agp_lookup_entry(dev, request->handle);
+	if (!entry)
 		return -EINVAL;
 	if (entry->bound)
 		return -EINVAL;
 	page = (request->offset + PAGE_SIZE - 1) / PAGE_SIZE;
-	if ((retcode = drm_bind_agp(entry->memory, page)))
+	retcode = drm_bind_agp(entry->memory, page);
+	if (retcode)
 		return retcode;
 	entry->bound = dev->agp->base + (page << PAGE_SHIFT);
 	DRM_DEBUG("base = 0x%lx entry->bound = 0x%lx\n",
@@ -356,7 +362,8 @@ int drm_agp_free(struct drm_device *dev, struct drm_agp_buffer *request)
 
 	if (!dev->agp || !dev->agp->acquired)
 		return -EINVAL;
-	if (!(entry = drm_agp_lookup_entry(dev, request->handle)))
+	entry = drm_agp_lookup_entry(dev, request->handle);
+	if (!entry)
 		return -EINVAL;
 	if (entry->bound)
 		drm_unbind_agp(entry->memory);
@@ -394,11 +401,13 @@ struct drm_agp_head *drm_agp_init(struct drm_device *dev)
 {
 	struct drm_agp_head *head = NULL;
 
-	if (!(head = kzalloc(sizeof(*head), GFP_KERNEL)))
+	head = kzalloc(sizeof(*head), GFP_KERNEL);
+	if (!head)
 		return NULL;
 	head->bridge = agp_find_bridge(dev->pdev);
 	if (!head->bridge) {
-		if (!(head->bridge = agp_backend_acquire(dev->pdev))) {
+		head->bridge = agp_backend_acquire(dev->pdev);
+		if (!head->bridge) {
 			kfree(head);
 			return NULL;
 		}
-- 
2.7.4



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

* Re: [Outreachy kernel] [PATCH 0/3] GPU: DRM: drm_agpsupport.c: Code cleanup
  2017-09-13 10:18 [PATCH 0/3] GPU: DRM: drm_agpsupport.c: Code cleanup Meghana Madhyastha
                   ` (2 preceding siblings ...)
  2017-09-13 10:23 ` [PATCH 3/3] GPU: DRM: Remove assignment in if condition Meghana Madhyastha
@ 2017-09-13 11:54 ` Julia Lawall
  2017-09-13 12:58   ` Jani Nikula
  3 siblings, 1 reply; 12+ messages in thread
From: Julia Lawall @ 2017-09-13 11:54 UTC (permalink / raw)
  To: Meghana Madhyastha
  Cc: Daniel Vetter, Jani Nikula, Sean Paul, outreachy-kernel



On Wed, 13 Sep 2017, Meghana Madhyastha wrote:

> These patches fix the checkpath warnings and errors
> in drm_agpsupport.c
>
> Meghana Madhyastha (3):
>   GPU: DRM: Moved EXPORT_SYMBOL so that it immediately followed its
>     function
>   GPU: DRM: Replace "foo * bar" with "foo *bar"
>   GPU: DRM: Remove assignment in if condition
>
>  drivers/gpu/drm/drm_agpsupport.c | 41 ++++++++++++++++++++++------------------
>  1 file changed, 23 insertions(+), 18 deletions(-)

Are the DRM people going to pick this up?  Because Greg will not.  If you
do something that is outside staging at a mentor's suggestion it could be
good to make explicit that the mentor will make sure that the patch will
be applied.

thanks,
julia


>
> --
> 2.7.4
>
> --
> You received this message because you are subscribed to the Google Groups "outreachy-kernel" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to outreachy-kernel+unsubscribe@googlegroups.com.
> To post to this group, send email to outreachy-kernel@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/outreachy-kernel/cover.1505296813.git.meghana.madhyastha%40gmail.com.
> For more options, visit https://groups.google.com/d/optout.
>


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

* Re: [Outreachy kernel] [PATCH 1/3] GPU: DRM: Moved EXPORT_SYMBOL so that it immediately followed its function
  2017-09-13 10:21 ` [PATCH 1/3] GPU: DRM: Moved EXPORT_SYMBOL so that it immediately followed its function Meghana Madhyastha
@ 2017-09-13 11:55   ` Julia Lawall
  0 siblings, 0 replies; 12+ messages in thread
From: Julia Lawall @ 2017-09-13 11:55 UTC (permalink / raw)
  To: Meghana Madhyastha
  Cc: Daniel Vetter, Jani Nikula, Sean Paul, outreachy-kernel



On Wed, 13 Sep 2017, Meghana Madhyastha wrote:

> EXPORT_SYMBOL(foo) should immediately follow its function/variable.
> This coding style is preferred.
> Found by checkpath.pl.
>
> Signed-off-by: Meghana Madhyastha <meghana.madhyastha@gmail.com>
> ---
>  drivers/gpu/drm/drm_agpsupport.c | 4 ----
>  1 file changed, 4 deletions(-)
>
> diff --git a/drivers/gpu/drm/drm_agpsupport.c b/drivers/gpu/drm/drm_agpsupport.c
> index c899534..928248e 100644
> --- a/drivers/gpu/drm/drm_agpsupport.c
> +++ b/drivers/gpu/drm/drm_agpsupport.c
> @@ -70,7 +70,6 @@ int drm_agp_info(struct drm_device *dev, struct drm_agp_info *info)
>
>  	return 0;
>  }
> -
>  EXPORT_SYMBOL(drm_agp_info);
>
>  int drm_agp_info_ioctl(struct drm_device *dev, void *data,
> @@ -106,7 +105,6 @@ int drm_agp_acquire(struct drm_device * dev)
>  	dev->agp->acquired = 1;
>  	return 0;
>  }
> -
>  EXPORT_SYMBOL(drm_agp_acquire);
>
>  /**
> @@ -171,7 +169,6 @@ int drm_agp_enable(struct drm_device * dev, struct drm_agp_mode mode)
>  	dev->agp->enabled = 1;
>  	return 0;
>  }
> -
>  EXPORT_SYMBOL(drm_agp_enable);
>
>  int drm_agp_enable_ioctl(struct drm_device *dev, void *data,
> @@ -373,7 +370,6 @@ int drm_agp_free(struct drm_device *dev, struct drm_agp_buffer *request)
>  EXPORT_SYMBOL(drm_agp_free);
>
>
> -

What was the issue here?  There are indeed too many blank lines, but that
would be a different patch.

julia

>  int drm_agp_free_ioctl(struct drm_device *dev, void *data,
>  		       struct drm_file *file_priv)
>  {
> --
> 2.7.4
>
> --
> You received this message because you are subscribed to the Google Groups "outreachy-kernel" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to outreachy-kernel+unsubscribe@googlegroups.com.
> To post to this group, send email to outreachy-kernel@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/outreachy-kernel/2f47dda3c36c008a108768d7142684c372f0980f.1505296813.git.meghana.madhyastha%40gmail.com.
> For more options, visit https://groups.google.com/d/optout.
>


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

* Re: [Outreachy kernel] [PATCH 2/3] GPU: DRM: Replace "foo * bar" with "foo *bar"
  2017-09-13 10:22 ` [PATCH 2/3] GPU: DRM: Replace "foo * bar" with "foo *bar" Meghana Madhyastha
@ 2017-09-13 11:59   ` Julia Lawall
  0 siblings, 0 replies; 12+ messages in thread
From: Julia Lawall @ 2017-09-13 11:59 UTC (permalink / raw)
  To: Meghana Madhyastha
  Cc: Daniel Vetter, Jani Nikula, Sean Paul, outreachy-kernel



On Wed, 13 Sep 2017, Meghana Madhyastha wrote:

> This replaces all instances of foo * bar with foo *bar
> in drm_agpsupport.c. This is so that it adheres to
> standard C syntax for pointers.

Just for future reference, you don't really need to metion the file name
in the log message.  One can see that directly from the patch code.

Also, remember to use the imperative.  So "This replaces" should be just
"Replace".

> Signed-off-by: Meghana Madhyastha <meghana.madhyastha@gmail.com>

Acked-by: Julia Lawall <julia.lawall@lip6.fr>

julia

> ---
>  drivers/gpu/drm/drm_agpsupport.c | 10 +++++-----
>  1 file changed, 5 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/gpu/drm/drm_agpsupport.c b/drivers/gpu/drm/drm_agpsupport.c
> index 928248e..993e486 100644
> --- a/drivers/gpu/drm/drm_agpsupport.c
> +++ b/drivers/gpu/drm/drm_agpsupport.c
> @@ -94,7 +94,7 @@ int drm_agp_info_ioctl(struct drm_device *dev, void *data,
>   * Verifies the AGP device hasn't been acquired before and calls
>   * \c agp_backend_acquire.
>   */
> -int drm_agp_acquire(struct drm_device * dev)
> +int drm_agp_acquire(struct drm_device *dev)
>  {
>  	if (!dev->agp)
>  		return -ENODEV;
> @@ -133,7 +133,7 @@ int drm_agp_acquire_ioctl(struct drm_device *dev, void *data,
>   *
>   * Verifies the AGP device has been acquired and calls \c agp_backend_release.
>   */
> -int drm_agp_release(struct drm_device * dev)
> +int drm_agp_release(struct drm_device *dev)
>  {
>  	if (!dev->agp || !dev->agp->acquired)
>  		return -EINVAL;
> @@ -159,7 +159,7 @@ int drm_agp_release_ioctl(struct drm_device *dev, void *data,
>   * Verifies the AGP device has been acquired but not enabled, and calls
>   * \c agp_enable.
>   */
> -int drm_agp_enable(struct drm_device * dev, struct drm_agp_mode mode)
> +int drm_agp_enable(struct drm_device *dev, struct drm_agp_mode mode)
>  {
>  	if (!dev->agp || !dev->agp->acquired)
>  		return -EINVAL;
> @@ -241,8 +241,8 @@ int drm_agp_alloc_ioctl(struct drm_device *dev, void *data,
>   *
>   * Walks through drm_agp_head::memory until finding a matching handle.
>   */
> -static struct drm_agp_mem *drm_agp_lookup_entry(struct drm_device * dev,
> -					   unsigned long handle)
> +static struct drm_agp_mem *drm_agp_lookup_entry(struct drm_device *dev,
> +						unsigned long handle)
>  {
>  	struct drm_agp_mem *entry;
>
> --
> 2.7.4
>
> --
> You received this message because you are subscribed to the Google Groups "outreachy-kernel" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to outreachy-kernel+unsubscribe@googlegroups.com.
> To post to this group, send email to outreachy-kernel@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/outreachy-kernel/3fefbb68a40ca5483a6b0e4c528c020e2d42f6bf.1505296813.git.meghana.madhyastha%40gmail.com.
> For more options, visit https://groups.google.com/d/optout.
>


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

* Re: [Outreachy kernel] [PATCH 3/3] GPU: DRM: Remove assignment in if condition
  2017-09-13 10:23 ` [PATCH 3/3] GPU: DRM: Remove assignment in if condition Meghana Madhyastha
@ 2017-09-13 12:02   ` Julia Lawall
  0 siblings, 0 replies; 12+ messages in thread
From: Julia Lawall @ 2017-09-13 12:02 UTC (permalink / raw)
  To: Meghana Madhyastha
  Cc: Daniel Vetter, Jani Nikula, Sean Paul, outreachy-kernel



On Wed, 13 Sep 2017, Meghana Madhyastha wrote:

> This patch moves the assignment so that
> it happens before the if condition. This
> results in syntax which is easier to read.

The commit message could be a bit wider.

>
> Found by checkpath.pl
>
> Signed-off-by: Meghana Madhyastha <meghana.madhyastha@gmail.com>
> ---
>  drivers/gpu/drm/drm_agpsupport.c | 27 ++++++++++++++++++---------
>  1 file changed, 18 insertions(+), 9 deletions(-)
>
> diff --git a/drivers/gpu/drm/drm_agpsupport.c b/drivers/gpu/drm/drm_agpsupport.c
> index 993e486..08933d6 100644
> --- a/drivers/gpu/drm/drm_agpsupport.c
> +++ b/drivers/gpu/drm/drm_agpsupport.c
> @@ -100,7 +100,8 @@ int drm_agp_acquire(struct drm_device *dev)
>  		return -ENODEV;
>  	if (dev->agp->acquired)
>  		return -EBUSY;
> -	if (!(dev->agp->bridge = agp_backend_acquire(dev->pdev)))
> +	dev->agp->bridge = agp_backend_acquire(dev->pdev);
> +	if (!dev->agp->bridge)
>  		return -ENODEV;
>  	dev->agp->acquired = 1;
>  	return 0;
> @@ -200,12 +201,14 @@ int drm_agp_alloc(struct drm_device *dev, struct drm_agp_buffer *request)
>
>  	if (!dev->agp || !dev->agp->acquired)
>  		return -EINVAL;
> -	if (!(entry = kzalloc(sizeof(*entry), GFP_KERNEL)))
> +	entry = kzalloc(sizeof(*entry), GFP_KERNEL);
> +	if (!entry)
>  		return -ENOMEM;
>
>  	pages = (request->size + PAGE_SIZE - 1) / PAGE_SIZE;
>  	type = (u32) request->type;
> -	if (!(memory = agp_allocate_memory(dev->agp->bridge, pages, type))) {
> +	memory = agp_allocate_memory(dev->agp->bridge, pages, type);
> +	if (!memory) {
>  		kfree(entry);
>  		return -ENOMEM;
>  	}
> @@ -272,7 +275,8 @@ int drm_agp_unbind(struct drm_device *dev, struct drm_agp_binding *request)
>
>  	if (!dev->agp || !dev->agp->acquired)
>  		return -EINVAL;
> -	if (!(entry = drm_agp_lookup_entry(dev, request->handle)))
> +	entry = drm_agp_lookup_entry(dev, request->handle);
> +	if (!entry)
>  		return -EINVAL;
>  	if (!entry->bound)
>  		return -EINVAL;

In this case and the next one, there are two tests that end up with the
same result.  You could merge them now that the test expression is
shorter, like the test a few lines up.

julia

> @@ -313,12 +317,14 @@ int drm_agp_bind(struct drm_device *dev, struct drm_agp_binding *request)
>
>  	if (!dev->agp || !dev->agp->acquired)
>  		return -EINVAL;
> -	if (!(entry = drm_agp_lookup_entry(dev, request->handle)))
> +	entry = drm_agp_lookup_entry(dev, request->handle);
> +	if (!entry)
>  		return -EINVAL;
>  	if (entry->bound)
>  		return -EINVAL;
>  	page = (request->offset + PAGE_SIZE - 1) / PAGE_SIZE;
> -	if ((retcode = drm_bind_agp(entry->memory, page)))
> +	retcode = drm_bind_agp(entry->memory, page);
> +	if (retcode)
>  		return retcode;
>  	entry->bound = dev->agp->base + (page << PAGE_SHIFT);
>  	DRM_DEBUG("base = 0x%lx entry->bound = 0x%lx\n",
> @@ -356,7 +362,8 @@ int drm_agp_free(struct drm_device *dev, struct drm_agp_buffer *request)
>
>  	if (!dev->agp || !dev->agp->acquired)
>  		return -EINVAL;
> -	if (!(entry = drm_agp_lookup_entry(dev, request->handle)))
> +	entry = drm_agp_lookup_entry(dev, request->handle);
> +	if (!entry)
>  		return -EINVAL;
>  	if (entry->bound)
>  		drm_unbind_agp(entry->memory);
> @@ -394,11 +401,13 @@ struct drm_agp_head *drm_agp_init(struct drm_device *dev)
>  {
>  	struct drm_agp_head *head = NULL;
>
> -	if (!(head = kzalloc(sizeof(*head), GFP_KERNEL)))
> +	head = kzalloc(sizeof(*head), GFP_KERNEL);
> +	if (!head)
>  		return NULL;
>  	head->bridge = agp_find_bridge(dev->pdev);
>  	if (!head->bridge) {
> -		if (!(head->bridge = agp_backend_acquire(dev->pdev))) {
> +		head->bridge = agp_backend_acquire(dev->pdev);
> +		if (!head->bridge) {
>  			kfree(head);
>  			return NULL;
>  		}
> --
> 2.7.4
>
> --
> You received this message because you are subscribed to the Google Groups "outreachy-kernel" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to outreachy-kernel+unsubscribe@googlegroups.com.
> To post to this group, send email to outreachy-kernel@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/outreachy-kernel/5eb79800ec4c7218e23841345ba81e3a515901e7.1505296813.git.meghana.madhyastha%40gmail.com.
> For more options, visit https://groups.google.com/d/optout.
>


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

* Re: [Outreachy kernel] [PATCH 0/3] GPU: DRM: drm_agpsupport.c: Code cleanup
  2017-09-13 11:54 ` [Outreachy kernel] [PATCH 0/3] GPU: DRM: drm_agpsupport.c: Code cleanup Julia Lawall
@ 2017-09-13 12:58   ` Jani Nikula
  2017-09-18 23:05     ` Vetter, Daniel
  0 siblings, 1 reply; 12+ messages in thread
From: Jani Nikula @ 2017-09-13 12:58 UTC (permalink / raw)
  To: Julia Lawall, Meghana Madhyastha
  Cc: Daniel Vetter, Sean Paul, outreachy-kernel

On Wed, 13 Sep 2017, Julia Lawall <julia.lawall@lip6.fr> wrote:
> On Wed, 13 Sep 2017, Meghana Madhyastha wrote:
>
>> These patches fix the checkpath warnings and errors
>> in drm_agpsupport.c
>>
>> Meghana Madhyastha (3):
>>   GPU: DRM: Moved EXPORT_SYMBOL so that it immediately followed its
>>     function
>>   GPU: DRM: Replace "foo * bar" with "foo *bar"
>>   GPU: DRM: Remove assignment in if condition
>>
>>  drivers/gpu/drm/drm_agpsupport.c | 41 ++++++++++++++++++++++------------------

Please try 'git log --oneline -- drivers/gpu/drm/drm_agpsupport.c' and
observe the commit subject prefix used. Please try to follow the style
in the area you're changing, not some generic rules.

>>  1 file changed, 23 insertions(+), 18 deletions(-)
>
> Are the DRM people going to pick this up?  Because Greg will not.  If you
> do something that is outside staging at a mentor's suggestion it could be
> good to make explicit that the mentor will make sure that the patch will
> be applied.

I'm not generally fond of pure checkpatch fixes, but patch 3 alone I
want enough to pick them all up. ;)

But please do submit the series to dri-devel@lists.freedesktop.org. As a
matter of policy, we don't apply patches not posted to our subsystem
mailing list.

The scripts/get_maintainer.pl script will help you with the lists, but
do use discretion. The script is sometimes misguided, adding *way* too
many lists and people. Just the main subsystem list and
supporters/maintainers are usually enough.


Thanks,
Jani.


-- 
Jani Nikula, Intel Open Source Technology Center


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

* Re: [Outreachy kernel] [PATCH 0/3] GPU: DRM: drm_agpsupport.c: Code cleanup
  2017-09-13 12:58   ` Jani Nikula
@ 2017-09-18 23:05     ` Vetter, Daniel
  2017-09-20 17:48       ` Daniel Vetter
  0 siblings, 1 reply; 12+ messages in thread
From: Vetter, Daniel @ 2017-09-18 23:05 UTC (permalink / raw)
  To: meghana.madhyastha, jani.nikula, julia.lawall; +Cc: seanpaul, outreachy-kernel

On Wed, 2017-09-13 at 15:58 +0300, Jani Nikula wrote:
> On Wed, 13 Sep 2017, Julia Lawall <julia.lawall@lip6.fr> wrote:
> > On Wed, 13 Sep 2017, Meghana Madhyastha wrote:
> > 
> > > These patches fix the checkpath warnings and errors
> > > in drm_agpsupport.c
> > > 
> > > Meghana Madhyastha (3):
> > >   GPU: DRM: Moved EXPORT_SYMBOL so that it immediately followed
> > > its
> > >     function
> > >   GPU: DRM: Replace "foo * bar" with "foo *bar"
> > >   GPU: DRM: Remove assignment in if condition
> > > 
> > >  drivers/gpu/drm/drm_agpsupport.c | 41 ++++++++++++++++++++++--
> > > ----------------
> 
> Please try 'git log --oneline -- drivers/gpu/drm/drm_agpsupport.c'
> and
> observe the commit subject prefix used. Please try to follow the
> style
> in the area you're changing, not some generic rules.
> 
> > >  1 file changed, 23 insertions(+), 18 deletions(-)
> > 
> > Are the DRM people going to pick this up?  Because Greg will
> > not.  If you
> > do something that is outside staging at a mentor's suggestion it
> > could be
> > good to make explicit that the mentor will make sure that the patch
> > will
> > be applied.
> 
> I'm not generally fond of pure checkpatch fixes, but patch 3 alone I
> want enough to pick them all up. ;)
> 
> But please do submit the series to dri-devel@lists.freedesktop.org.
> As a
> matter of policy, we don't apply patches not posted to our subsystem
> mailing list.

Yeah, stuff needs to go through dri-devel when it's a drm patch (or
anything else in drivers/gpu). That's why we don't recommend it for the
very first patch (I guess I should update the text a bit, but I'm
travelling and don't have login creds nearby).
-Daniel

> The scripts/get_maintainer.pl script will help you with the lists,
> but
> do use discretion. The script is sometimes misguided, adding *way*
> too
> many lists and people. Just the main subsystem list and
> supporters/maintainers are usually enough.
> 
> 
> Thanks,
> Jani.
> 
> 
Intel Semiconductor AG
Registered No. 020.30.913.786-7
Registered Office: Badenerstrasse 549, 8048 Zurich, Switzerland

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

* Re: [Outreachy kernel] [PATCH 0/3] GPU: DRM: drm_agpsupport.c: Code cleanup
  2017-09-18 23:05     ` Vetter, Daniel
@ 2017-09-20 17:48       ` Daniel Vetter
  2017-09-20 18:13         ` Sean Paul
  0 siblings, 1 reply; 12+ messages in thread
From: Daniel Vetter @ 2017-09-20 17:48 UTC (permalink / raw)
  To: Vetter, Daniel
  Cc: meghana.madhyastha, jani.nikula, julia.lawall, seanpaul,
	outreachy-kernel

On Mon, Sep 18, 2017 at 11:05:39PM +0000, Vetter, Daniel wrote:
> On Wed, 2017-09-13 at 15:58 +0300, Jani Nikula wrote:
> > On Wed, 13 Sep 2017, Julia Lawall <julia.lawall@lip6.fr> wrote:
> > > On Wed, 13 Sep 2017, Meghana Madhyastha wrote:
> > > 
> > > > These patches fix the checkpath warnings and errors
> > > > in drm_agpsupport.c
> > > > 
> > > > Meghana Madhyastha (3):
> > > > � GPU: DRM: Moved EXPORT_SYMBOL so that it immediately followed
> > > > its
> > > > ����function
> > > > � GPU: DRM: Replace "foo * bar" with "foo *bar"
> > > > � GPU: DRM: Remove assignment in if condition
> > > > 
> > > > �drivers/gpu/drm/drm_agpsupport.c | 41 ++++++++++++++++++++++--
> > > > ----------------
> > 
> > Please try 'git log --oneline -- drivers/gpu/drm/drm_agpsupport.c'
> > and
> > observe the commit subject prefix used. Please try to follow the
> > style
> > in the area you're changing, not some generic rules.
> > 
> > > > �1 file changed, 23 insertions(+), 18 deletions(-)
> > > 
> > > Are the DRM people going to pick this up?��Because Greg will
> > > not.��If you
> > > do something that is outside staging at a mentor's suggestion it
> > > could be
> > > good to make explicit that the mentor will make sure that the patch
> > > will
> > > be applied.
> > 
> > I'm not generally fond of pure checkpatch fixes, but patch 3 alone I
> > want enough to pick them all up. ;)
> > 
> > But please do submit the series to dri-devel@lists.freedesktop.org.
> > As a
> > matter of policy, we don't apply patches not posted to our subsystem
> > mailing list.
> 
> Yeah, stuff needs to go through dri-devel when it's a drm patch (or
> anything else in drivers/gpu). That's why we don't recommend it for the
> very first patch (I guess I should update the text a bit, but I'm
> travelling and don't have login creds nearby).

Hm, not all of these landed. Haneen, can you pls resend the remaining
patches with dri-devel (and maintainers, per scripts/get_maintainer.pl) on
cc?

Thanks, Daniel


> -Daniel
> 
> > The scripts/get_maintainer.pl script will help you with the lists,
> > but
> > do use discretion. The script is sometimes misguided, adding *way*
> > too
> > many lists and people. Just the main subsystem list and
> > supporters/maintainers are usually enough.
> > 
> > 
> > Thanks,
> > Jani.
> > 
> > 
> Intel Semiconductor AG
> Registered No. 020.30.913.786-7
> Registered Office: Badenerstrasse 549, 8048 Zurich, Switzerland
> 
> -- 
> You received this message because you are subscribed to the Google Groups "outreachy-kernel" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to outreachy-kernel+unsubscribe@googlegroups.com.
> To post to this group, send email to outreachy-kernel@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/outreachy-kernel/1505775934.6581.6.camel%40intel.com.
> For more options, visit https://groups.google.com/d/optout.

-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch


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

* Re: [Outreachy kernel] [PATCH 0/3] GPU: DRM: drm_agpsupport.c: Code cleanup
  2017-09-20 17:48       ` Daniel Vetter
@ 2017-09-20 18:13         ` Sean Paul
  0 siblings, 0 replies; 12+ messages in thread
From: Sean Paul @ 2017-09-20 18:13 UTC (permalink / raw)
  To: Daniel Vetter
  Cc: Vetter, Daniel, meghana.madhyastha, jani.nikula, julia.lawall,
	outreachy-kernel

On Wed, Sep 20, 2017 at 10:48 AM, Daniel Vetter <daniel@ffwll.ch> wrote:
> On Mon, Sep 18, 2017 at 11:05:39PM +0000, Vetter, Daniel wrote:
>> On Wed, 2017-09-13 at 15:58 +0300, Jani Nikula wrote:
>> > On Wed, 13 Sep 2017, Julia Lawall <julia.lawall@lip6.fr> wrote:
>> > > On Wed, 13 Sep 2017, Meghana Madhyastha wrote:
>> > >
>> > > > These patches fix the checkpath warnings and errors
>> > > > in drm_agpsupport.c
>> > > >
>> > > > Meghana Madhyastha (3):
>> > > >   GPU: DRM: Moved EXPORT_SYMBOL so that it immediately followed
>> > > > its
>> > > >     function
>> > > >   GPU: DRM: Replace "foo * bar" with "foo *bar"
>> > > >   GPU: DRM: Remove assignment in if condition
>> > > >
>> > > >  drivers/gpu/drm/drm_agpsupport.c | 41 ++++++++++++++++++++++--
>> > > > ----------------
>> >
>> > Please try 'git log --oneline -- drivers/gpu/drm/drm_agpsupport.c'
>> > and
>> > observe the commit subject prefix used. Please try to follow the
>> > style
>> > in the area you're changing, not some generic rules.
>> >
>> > > >  1 file changed, 23 insertions(+), 18 deletions(-)
>> > >
>> > > Are the DRM people going to pick this up?  Because Greg will
>> > > not.  If you
>> > > do something that is outside staging at a mentor's suggestion it
>> > > could be
>> > > good to make explicit that the mentor will make sure that the patch
>> > > will
>> > > be applied.
>> >
>> > I'm not generally fond of pure checkpatch fixes, but patch 3 alone I
>> > want enough to pick them all up. ;)
>> >
>> > But please do submit the series to dri-devel@lists.freedesktop.org.
>> > As a
>> > matter of policy, we don't apply patches not posted to our subsystem
>> > mailing list.
>>
>> Yeah, stuff needs to go through dri-devel when it's a drm patch (or
>> anything else in drivers/gpu). That's why we don't recommend it for the
>> very first patch (I guess I should update the text a bit, but I'm
>> travelling and don't have login creds nearby).
>
> Hm, not all of these landed. Haneen, can you pls resend the remaining
> patches with dri-devel (and maintainers, per scripts/get_maintainer.pl) on
> cc?

Looks like we got our wires crossed! I just applied v3 of this set, so
we're allll good :)

Sean

>
> Thanks, Daniel
>
>
>> -Daniel
>>
>> > The scripts/get_maintainer.pl script will help you with the lists,
>> > but
>> > do use discretion. The script is sometimes misguided, adding *way*
>> > too
>> > many lists and people. Just the main subsystem list and
>> > supporters/maintainers are usually enough.
>> >
>> >
>> > Thanks,
>> > Jani.
>> >
>> >
>> Intel Semiconductor AG
>> Registered No. 020.30.913.786-7
>> Registered Office: Badenerstrasse 549, 8048 Zurich, Switzerland
>>
>> --
>> You received this message because you are subscribed to the Google Groups "outreachy-kernel" group.
>> To unsubscribe from this group and stop receiving emails from it, send an email to outreachy-kernel+unsubscribe@googlegroups.com.
>> To post to this group, send email to outreachy-kernel@googlegroups.com.
>> To view this discussion on the web visit https://groups.google.com/d/msgid/outreachy-kernel/1505775934.6581.6.camel%40intel.com.
>> For more options, visit https://groups.google.com/d/optout.
>
> --
> Daniel Vetter
> Software Engineer, Intel Corporation
> http://blog.ffwll.ch
>
> --
> You received this message because you are subscribed to the Google Groups "outreachy-kernel" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to outreachy-kernel+unsubscribe@googlegroups.com.
> To post to this group, send email to outreachy-kernel@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/outreachy-kernel/20170920174828.GA25248%40dvetter-linux.ger.corp.intel.com.
> For more options, visit https://groups.google.com/d/optout.


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

end of thread, other threads:[~2017-09-20 18:13 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-09-13 10:18 [PATCH 0/3] GPU: DRM: drm_agpsupport.c: Code cleanup Meghana Madhyastha
2017-09-13 10:21 ` [PATCH 1/3] GPU: DRM: Moved EXPORT_SYMBOL so that it immediately followed its function Meghana Madhyastha
2017-09-13 11:55   ` [Outreachy kernel] " Julia Lawall
2017-09-13 10:22 ` [PATCH 2/3] GPU: DRM: Replace "foo * bar" with "foo *bar" Meghana Madhyastha
2017-09-13 11:59   ` [Outreachy kernel] " Julia Lawall
2017-09-13 10:23 ` [PATCH 3/3] GPU: DRM: Remove assignment in if condition Meghana Madhyastha
2017-09-13 12:02   ` [Outreachy kernel] " Julia Lawall
2017-09-13 11:54 ` [Outreachy kernel] [PATCH 0/3] GPU: DRM: drm_agpsupport.c: Code cleanup Julia Lawall
2017-09-13 12:58   ` Jani Nikula
2017-09-18 23:05     ` Vetter, Daniel
2017-09-20 17:48       ` Daniel Vetter
2017-09-20 18:13         ` Sean Paul

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.