From: "Ville Syrjälä" <syrjala@sci.fi>
To: Chris Forbes <chrisf@ijw.co.nz>
Cc: David Airlie <airlied@linux.ie>,
linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org
Subject: Re: [PATCH] Drivers: gpu: drm: drm_memory: fixed coding style issue
Date: Fri, 17 Jun 2011 18:12:41 +0300 [thread overview]
Message-ID: <20110617151241.GH17833@sci.fi> (raw)
In-Reply-To: <1308296336-28871-1-git-send-email-chrisf@ijw.co.nz>
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/
next prev parent reply other threads:[~2011-06-17 15:12 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
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ä [this message]
2011-06-18 0:08 ` [PATCH v2] " Chris Forbes
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20110617151241.GH17833@sci.fi \
--to=syrjala@sci.fi \
--cc=airlied@linux.ie \
--cc=chrisf@ijw.co.nz \
--cc=dri-devel@lists.freedesktop.org \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox