* [PATCH] Drivers: gpu: drm: drm_memory: fixed coding style issue
@ 2011-06-17 7:38 Chris Forbes
2011-06-17 15:12 ` Ville Syrjälä
0 siblings, 1 reply; 3+ messages in thread
From: Chris Forbes @ 2011-06-17 7:38 UTC (permalink / raw)
To: David Airlie; +Cc: dri-devel, linux-kernel, Chris Forbes
Fixed coding style issues flagged by checkpatch.pl.
Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
---
drivers/gpu/drm/drm_memory.c | 20 +++++++++++---------
1 files changed, 11 insertions(+), 9 deletions(-)
diff --git a/drivers/gpu/drm/drm_memory.c b/drivers/gpu/drm/drm_memory.c
index c9b8050..516c86a 100644
--- a/drivers/gpu/drm/drm_memory.c
+++ b/drivers/gpu/drm/drm_memory.c
@@ -57,7 +57,7 @@ int drm_mem_info(char *buf, char **start, off_t offset,
#if __OS_HAS_AGP
static void *agp_remap(unsigned long offset, unsigned long size,
- struct drm_device * dev)
+ struct drm_device *dev)
{
unsigned long i, num_pages =
PAGE_ALIGN(size) / PAGE_SIZE;
@@ -81,16 +81,18 @@ static void *agp_remap(unsigned long offset, unsigned long size,
return NULL;
/*
- * OK, we're mapping AGP space on a chipset/platform on which memory accesses by
- * the CPU do not get remapped by the GART. We fix this by using the kernel's
- * page-table instead (that's probably faster anyhow...).
+ * OK, we're mapping AGP space on a chipset/platform on which
+ * memory accesses by the CPU do not get remapped by the GART.
+ * We fix this by using the kernel's page-table instead
+ * (that's probably faster anyhow...).
*/
/* note: use vmalloc() because num_pages could be large... */
page_map = vmalloc(num_pages * sizeof(struct page *));
if (!page_map)
return NULL;
- phys_page_map = (agpmem->memory->pages + (offset - agpmem->bound) / PAGE_SIZE);
+ phys_page_map = (agpmem->memory->pages + (offset - agpmem->bound)
+ / PAGE_SIZE);
for (i = 0; i < num_pages; ++i)
page_map[i] = phys_page_map[i];
addr = vmap(page_map, num_pages, VM_IOREMAP, PAGE_AGP);
@@ -100,20 +102,20 @@ static void *agp_remap(unsigned long offset, unsigned long size,
}
/** Wrapper around agp_free_memory() */
-void drm_free_agp(DRM_AGP_MEM * handle, int pages)
+void drm_free_agp(DRM_AGP_MEM *handle, int pages)
{
agp_free_memory(handle);
}
EXPORT_SYMBOL(drm_free_agp);
/** Wrapper around agp_bind_memory() */
-int drm_bind_agp(DRM_AGP_MEM * handle, unsigned int start)
+int drm_bind_agp(DRM_AGP_MEM *handle, unsigned int start)
{
return agp_bind_memory(handle, start);
}
/** Wrapper around agp_unbind_memory() */
-int drm_unbind_agp(DRM_AGP_MEM * handle)
+int drm_unbind_agp(DRM_AGP_MEM *handle)
{
return agp_unbind_memory(handle);
}
@@ -121,7 +123,7 @@ EXPORT_SYMBOL(drm_unbind_agp);
#else /* __OS_HAS_AGP */
static inline void *agp_remap(unsigned long offset, unsigned long size,
- struct drm_device * dev)
+ struct drm_device *dev)
{
return NULL;
}
--
1.7.4.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] Drivers: gpu: drm: drm_memory: fixed coding style issue
2011-06-17 7:38 [PATCH] Drivers: gpu: drm: drm_memory: fixed coding style issue Chris Forbes
@ 2011-06-17 15:12 ` Ville Syrjälä
2011-06-18 0:08 ` [PATCH v2] " Chris Forbes
0 siblings, 1 reply; 3+ messages in thread
From: Ville Syrjälä @ 2011-06-17 15:12 UTC (permalink / raw)
To: Chris Forbes; +Cc: David Airlie, linux-kernel, dri-devel
On Fri, Jun 17, 2011 at 07:38:56PM +1200, Chris Forbes wrote:
> Fixed coding style issues flagged by checkpatch.pl.
>
> Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
> ---
> drivers/gpu/drm/drm_memory.c | 20 +++++++++++---------
> 1 files changed, 11 insertions(+), 9 deletions(-)
>
> diff --git a/drivers/gpu/drm/drm_memory.c b/drivers/gpu/drm/drm_memory.c
> index c9b8050..516c86a 100644
> --- a/drivers/gpu/drm/drm_memory.c
> +++ b/drivers/gpu/drm/drm_memory.c
> @@ -57,7 +57,7 @@ int drm_mem_info(char *buf, char **start, off_t offset,
>
> #if __OS_HAS_AGP
> static void *agp_remap(unsigned long offset, unsigned long size,
> - struct drm_device * dev)
> + struct drm_device *dev)
> {
> unsigned long i, num_pages =
> PAGE_ALIGN(size) / PAGE_SIZE;
> @@ -81,16 +81,18 @@ static void *agp_remap(unsigned long offset, unsigned long size,
> return NULL;
>
> /*
> - * OK, we're mapping AGP space on a chipset/platform on which memory accesses by
> - * the CPU do not get remapped by the GART. We fix this by using the kernel's
> - * page-table instead (that's probably faster anyhow...).
> + * OK, we're mapping AGP space on a chipset/platform on which
> + * memory accesses by the CPU do not get remapped by the GART.
> + * We fix this by using the kernel's page-table instead
> + * (that's probably faster anyhow...).
> */
> /* note: use vmalloc() because num_pages could be large... */
> page_map = vmalloc(num_pages * sizeof(struct page *));
> if (!page_map)
> return NULL;
>
> - phys_page_map = (agpmem->memory->pages + (offset - agpmem->bound) / PAGE_SIZE);
> + phys_page_map = (agpmem->memory->pages + (offset - agpmem->bound)
> + / PAGE_SIZE);
If you feel the need to do this, at least wrap it at '+', otherwise
you're making the order of operations harder to follow. And you might
as well remove the pointless parens while you're at it.
--
Ville Syrjälä
syrjala@sci.fi
http://www.sci.fi/~syrjala/
^ permalink raw reply [flat|nested] 3+ messages in thread
* [PATCH v2] Drivers: gpu: drm: drm_memory: fixed coding style issue
2011-06-17 15:12 ` Ville Syrjälä
@ 2011-06-18 0:08 ` Chris Forbes
0 siblings, 0 replies; 3+ messages in thread
From: Chris Forbes @ 2011-06-18 0:08 UTC (permalink / raw)
To: David Airlie; +Cc: dri-devel, linux-kernel, syrjala, Chris Forbes
Fixed coding style issues flagged by checkpatch.pl.
Reworked break of long line as per Ville's suggestion, to maintain
readability.
Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
---
drivers/gpu/drm/drm_memory.c | 20 +++++++++++---------
1 files changed, 11 insertions(+), 9 deletions(-)
diff --git a/drivers/gpu/drm/drm_memory.c b/drivers/gpu/drm/drm_memory.c
index c9b8050..fd96561 100644
--- a/drivers/gpu/drm/drm_memory.c
+++ b/drivers/gpu/drm/drm_memory.c
@@ -57,7 +57,7 @@ int drm_mem_info(char *buf, char **start, off_t offset,
#if __OS_HAS_AGP
static void *agp_remap(unsigned long offset, unsigned long size,
- struct drm_device * dev)
+ struct drm_device *dev)
{
unsigned long i, num_pages =
PAGE_ALIGN(size) / PAGE_SIZE;
@@ -81,16 +81,18 @@ static void *agp_remap(unsigned long offset, unsigned long size,
return NULL;
/*
- * OK, we're mapping AGP space on a chipset/platform on which memory accesses by
- * the CPU do not get remapped by the GART. We fix this by using the kernel's
- * page-table instead (that's probably faster anyhow...).
+ * OK, we're mapping AGP space on a chipset/platform on which
+ * memory accesses by the CPU do not get remapped by the GART.
+ * We fix this by using the kernel's page-table instead
+ * (that's probably faster anyhow...).
*/
/* note: use vmalloc() because num_pages could be large... */
page_map = vmalloc(num_pages * sizeof(struct page *));
if (!page_map)
return NULL;
- phys_page_map = (agpmem->memory->pages + (offset - agpmem->bound) / PAGE_SIZE);
+ phys_page_map = (agpmem->memory->pages +
+ (offset - agpmem->bound) / PAGE_SIZE);
for (i = 0; i < num_pages; ++i)
page_map[i] = phys_page_map[i];
addr = vmap(page_map, num_pages, VM_IOREMAP, PAGE_AGP);
@@ -100,20 +102,20 @@ static void *agp_remap(unsigned long offset, unsigned long size,
}
/** Wrapper around agp_free_memory() */
-void drm_free_agp(DRM_AGP_MEM * handle, int pages)
+void drm_free_agp(DRM_AGP_MEM *handle, int pages)
{
agp_free_memory(handle);
}
EXPORT_SYMBOL(drm_free_agp);
/** Wrapper around agp_bind_memory() */
-int drm_bind_agp(DRM_AGP_MEM * handle, unsigned int start)
+int drm_bind_agp(DRM_AGP_MEM *handle, unsigned int start)
{
return agp_bind_memory(handle, start);
}
/** Wrapper around agp_unbind_memory() */
-int drm_unbind_agp(DRM_AGP_MEM * handle)
+int drm_unbind_agp(DRM_AGP_MEM *handle)
{
return agp_unbind_memory(handle);
}
@@ -121,7 +123,7 @@ EXPORT_SYMBOL(drm_unbind_agp);
#else /* __OS_HAS_AGP */
static inline void *agp_remap(unsigned long offset, unsigned long size,
- struct drm_device * dev)
+ struct drm_device *dev)
{
return NULL;
}
--
1.7.4.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
end of thread, other threads:[~2011-06-18 0:09 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-06-17 7:38 [PATCH] Drivers: gpu: drm: drm_memory: fixed coding style issue Chris Forbes
2011-06-17 15:12 ` Ville Syrjälä
2011-06-18 0:08 ` [PATCH v2] " Chris Forbes
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox