mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Jack Stone <jwjstone@fastmail.fm>
To: Ohad Ben-Cohen <ohad@wizery.com>
Cc: linux-kernel@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org,
	Grant Likely <grant.likely@secretlab.ca>,
	Mark Grosen <mgrosen@ti.com>
Subject: Re: [PATCH 2/2] remoteproc: s/big switch/lookup table/
Date: Tue, 31 Jan 2012 17:58:10 +0000	[thread overview]
Message-ID: <4F282BB2.6080604@fastmail.fm> (raw)
In-Reply-To: <1328028762-28352-2-git-send-email-ohad@wizery.com>

On 31/01/12 16:52, Ohad Ben-Cohen wrote:
> +/*
> + * A lookup table for resource handlers. Always keep in sync with
> + * enum fw_resource_type.
> + */
> +static rproc_handle_resource_t rproc_handle_rsc[] = {
> +	rproc_handle_carveout,	/* RSC_CARVEOUT */
> +	rproc_handle_devmem,	/* RSC_DEVMEM */
> +	rproc_handle_trace,	/* RSC_TRACE */
> +	rproc_handle_vring,	/* RSC_VRING */
> +	NULL, /* RSC_VIRTIO_DEV is handled early upon registration */
> +};
> +

You could change this to

[RSC_CARVEOUT] = rproc_handle_carveout,

Then you would be safe against renumbering and would only need to worry
about addition (which your RSC_LAST check copes with).

Thanks,

Jack

  reply	other threads:[~2012-01-31 17:58 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-01-31 16:52 [PATCH 1/2] remoteproc: bail out if firmware has different endianess Ohad Ben-Cohen
2012-01-31 16:52 ` [PATCH 2/2] remoteproc: s/big switch/lookup table/ Ohad Ben-Cohen
2012-01-31 17:58   ` Jack Stone [this message]
2012-01-31 20:08     ` Grant Likely
2012-01-31 20:21       ` Ohad Ben-Cohen
2012-01-31 20:09 ` [PATCH 1/2] remoteproc: bail out if firmware has different endianess Grant Likely
2012-02-08 21:01   ` Ohad Ben-Cohen

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=4F282BB2.6080604@fastmail.fm \
    --to=jwjstone@fastmail.fm \
    --cc=grant.likely@secretlab.ca \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mgrosen@ti.com \
    --cc=ohad@wizery.com \
    /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

all inboxes | Powered by JetHome®