lkml.org 
[lkml]   [2011]   [Jun]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] Drivers: gpu: drm: drm_memory: fixed coding style issue
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/
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2011-06-17 17:15    [W:0.315 / U:0.088 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site