mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Sascha Hauer <s.hauer@pengutronix.de>
To: Antony Pavlov <antonynpavlov@gmail.com>
Cc: barebox@lists.infradead.org
Subject: Re: [RFC 05/10] resource: add create_resource() helper function
Date: Wed, 23 Apr 2014 10:46:29 +0200	[thread overview]
Message-ID: <20140423084629.GF5858@pengutronix.de> (raw)
In-Reply-To: <1397547514-19925-6-git-send-email-antonynpavlov@gmail.com>

On Tue, Apr 15, 2014 at 11:38:29AM +0400, Antony Pavlov wrote:
> Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
> ---
>  common/resource.c      | 15 +++++++++++++++
>  include/linux/ioport.h |  2 ++
>  2 files changed, 17 insertions(+)
> 
> diff --git a/common/resource.c b/common/resource.c
> index fe4680e..b6c7c87 100644
> --- a/common/resource.c
> +++ b/common/resource.c
> @@ -143,3 +143,18 @@ struct resource *request_ioport_region(const char *name,
>  {
>  	return __request_region(&ioport_resource, name, start, end);
>  }
> +
> +struct resource *create_resource(const char *name,
> +	resource_size_t start, resource_size_t end)
> +{
> +	struct resource *t;
> +
> +	t = xzalloc(sizeof *t);
> +	INIT_LIST_HEAD(&t->children);
> +	t->parent = NULL;
> +	t->name = xstrdup(name);
> +	t->start = start;
> +	t->end = end;

How about calling init_resource() and skip the fields already initialized
there from this function? This makes sure new fields in struct resource
can be initialized in a single place.

Sascha


-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

  reply	other threads:[~2014-04-23  8:46 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-04-15  7:38 [RFC 00/10] MIPS: use kexec to load ELF linux images Antony Pavlov
2014-04-15  7:38 ` [RFC 01/10] MIPS: add initial cache support for R4000-class CPUs Antony Pavlov
2014-04-15  7:38 ` [RFC 02/10] MIPS: introduce arch_shutdown() Antony Pavlov
2014-04-15  7:38 ` [RFC 03/10] MIPS: use arch_shutdown() for flushing caches Antony Pavlov
2014-04-23  8:43   ` Sascha Hauer
2014-04-15  7:38 ` [RFC 04/10] MIPS: add virt_to_phys() and phys_to_virt() Antony Pavlov
2014-04-15  7:38 ` [RFC 05/10] resource: add create_resource() helper function Antony Pavlov
2014-04-23  8:46   ` Sascha Hauer [this message]
2014-04-15  7:38 ` [RFC 06/10] import initial kexec stuff Antony Pavlov
2014-04-15  7:38 ` [RFC 07/10] filetype: add ELF type Antony Pavlov
2014-04-15  7:38 ` [RFC 08/10] bootm: add kexec ELF support Antony Pavlov
2014-04-23  9:15   ` Sascha Hauer
2014-04-15  7:38 ` [RFC 09/10] MIPS: add " Antony Pavlov
2014-04-15  7:38 ` [RFC 10/10] MIPS: mach-malta: add kexec-capable reboot() Antony Pavlov

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=20140423084629.GF5858@pengutronix.de \
    --to=s.hauer@pengutronix.de \
    --cc=antonynpavlov@gmail.com \
    --cc=barebox@lists.infradead.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