public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Jiri Slaby <jslaby@suse.cz>
To: Arend van Spriel <arend@broadcom.com>
Cc: linux-kernel@vger.kernel.org, akpm@linux-foundation.org,
	rmk+kernel@arm.linux.org.uk, devel@linuxdriverproject.org,
	gregkh@suse.de, linux-wireless@vger.kernel.org,
	Jiri Slaby <jirislaby@gmail.com>
Subject: Re: [PATCH 1/1] drivers: brcmaxi: provide amba axi functionality in separate module
Date: Tue, 29 Mar 2011 12:45:42 +0200	[thread overview]
Message-ID: <4D91B856.8040302@suse.cz> (raw)
In-Reply-To: <1301391619-4499-2-git-send-email-arend@broadcom.com>

On 03/29/2011 11:40 AM, Arend van Spriel wrote:
> --- /dev/null
> +++ b/drivers/brcmaxi/axi.c
> @@ -0,0 +1,786 @@
...
> +/* resetctrl */
> +#define	AIRC_RESET		1
> +
> +/* definition for specifying padding fields */
> +#define	_PADLINE(line)	pad ## line
> +#define	_XSTR(line)	_PADLINE(line)
> +#define	PAD		_XSTR(__LINE__)
> +
> +/*
> + * struct aidmp - device management plugin "wrapper" registers.
> + */
> +struct aidmp {

This looks like it should be __packed__.

> +	u32 oobselina30;	/* 0x000 */
> +	u32 oobselina74;	/* 0x004 */
> +	u32 PAD[6];
...
> +};
...
> +struct axi_local *axi_create(u32 priv_len)
> +{
> +	struct axi_local *inst;
> +	int size = ALIGN(sizeof(*inst), 4) + priv_len;
> +
> +	inst = kzalloc(size, GFP_ATOMIC);

Hmm, ATOMIC without checking the retval. This is prepared for its first
crash under a high memory pressure.

> +	try_module_get(THIS_MODULE);
> +
> +	return inst;
> +}
> +struct axi_instance *axi_open(void *regs, u32 erombase, u32 priv_len)
> +{
> +	struct axi_local *inst = axi_create(priv_len);
> +
> +	/* fill public fields */
> +	inst->pub.regs = regs;
> +	inst->pub.priv = (char *)inst + ALIGN(sizeof(*inst), 4);
> +
> +	inst->enum_rom_ptr = ioremap_nocache((unsigned long)erombase,
> +					     AXI_CORE_SIZE);

Check retval.

> +	return &inst->pub;
> +}
...

regards,
-- 
js
suse labs

  reply	other threads:[~2011-03-29 10:45 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-03-29  9:40 [PATCH 0/1] new module for amba axi on-chip interconnect Arend van Spriel
2011-03-29  9:40 ` [PATCH 1/1] drivers: brcmaxi: provide amba axi functionality in separate module Arend van Spriel
2011-03-29 10:45   ` Jiri Slaby [this message]
2011-03-30 12:53     ` Arnd Bergmann
2011-03-31 13:48       ` Jiri Slaby
2011-03-31 13:51         ` Russell King
2011-03-31 14:09           ` Jiri Slaby
2011-03-31 14:14             ` Russell King
2011-03-31 16:10               ` Jiri Slaby
2011-04-01  9:14                 ` Arnd Bergmann
2011-03-29 13:14 ` [PATCH 0/1] new module for amba axi on-chip interconnect Greg KH
2011-03-29 18:19 ` Russell King
2011-03-30 13:09   ` Arnd Bergmann
2011-03-30 17:40     ` Russell King - ARM Linux
2011-03-30 18:24       ` Arnd Bergmann
2011-03-30 19:08         ` Russell King - ARM Linux
2011-04-01 15:40           ` Arnd Bergmann
2011-03-29 18:30 ` Christoph Hellwig
2011-03-29 18:40 ` Russell King

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=4D91B856.8040302@suse.cz \
    --to=jslaby@suse.cz \
    --cc=akpm@linux-foundation.org \
    --cc=arend@broadcom.com \
    --cc=devel@linuxdriverproject.org \
    --cc=gregkh@suse.de \
    --cc=jirislaby@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=rmk+kernel@arm.linux.org.uk \
    /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