linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: dave.martin@linaro.org (Dave Martin)
To: linux-arm-kernel@lists.infradead.org
Subject: [RFC PATCH 0/2] ARM: Add a generic macro for declaring proc_info structs
Date: Thu,  9 Jun 2011 18:21:50 +0100	[thread overview]
Message-ID: <1307640112-5360-1-git-send-email-dave.martin@linaro.org> (raw)

Based on recent problems with variable-size Thumb instructions
inside tables, this patch adds an experimental macro for declaring
proc_info structs, as an example of the kind of build-time robustness
we could implement for these and similar structures.

As such, it's an illustration of something we _could_ do, rather
than something we necessarily should do.

I'd be interested in people's views on this.


Potential advantages include:

 * automatic build-time checking that struct proc_info is reasonably
in sync with the assembler definitions;

 * automatic checking that proc_info structure declarations are
complete and correctly structured, with no mis-sized or misaligned
elements (particularly important for Thumb-2 kernels);

 * better readability of the declarations (depending on people's
personal taste, of course);

 * reduction of some boilerplate code (perhaps up to 700 lines net
if we were to convert all arch/arm/mm/proc-*.S to use the macro.


The same general technique could be potentially expanded to cover
any struct defined in assembler.

However, this may be taking a sledgehammer to crack a nut,
and it will cause some churn, though it could leave is with a
cleaner situation afterwards.


Much lighter-weight, less invasive build-time checks could
still deliver significant benefits.


Dave Martin (2):
  ARM: Add a generic macro for declaring proc_info structs
  ARM: proc-v7: Use the new proc_info declaration macro

 arch/arm/mm/proc-macros.S |  141 +++++++++++++++++++++++++++++++++++++++++++++
 arch/arm/mm/proc-v7.S     |   93 ++++++++++++-----------------
 2 files changed, 179 insertions(+), 55 deletions(-)

-- 
1.7.4.1

             reply	other threads:[~2011-06-09 17:21 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-06-09 17:21 Dave Martin [this message]
2011-06-09 17:21 ` [RFC PATCH 1/2] ARM: Add a generic macro for declaring proc_info structs Dave Martin
2011-06-09 17:21 ` [RFC PATCH 2/2] ARM: proc-v7: Use the new proc_info declaration macro Dave Martin
2011-06-09 17:38 ` [RFC PATCH 0/2] ARM: Add a generic macro for declaring proc_info structs Russell King - ARM Linux
2011-06-10  8:57   ` Dave Martin
2011-06-12  8:22     ` Russell King - ARM Linux
2011-06-12 15:14       ` Russell King - ARM Linux
2011-06-13 13:10         ` Dave Martin
2011-06-13 13:12           ` Russell King - ARM Linux
2011-06-13 13:48             ` Dave Martin

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=1307640112-5360-1-git-send-email-dave.martin@linaro.org \
    --to=dave.martin@linaro.org \
    --cc=linux-arm-kernel@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;
as well as URLs for NNTP newsgroup(s).