From: Randy Dunlap <randy.dunlap@oracle.com>
To: "John Anthony Kazos Jr." <jakj@j-a-k-j.com>
Cc: aeb@cwi.nl, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 4/5] partitions: Add conditionals and static inline stubs to helpers in headers
Date: Sat, 7 Apr 2007 21:01:08 -0700 [thread overview]
Message-ID: <20070407210108.66cdb32f.randy.dunlap@oracle.com> (raw)
In-Reply-To: <alpine.DEB.0.83.0704072340100.27057@sigma.j-a-k-j.com>
On Sat, 7 Apr 2007 23:40:50 -0400 (EDT) John Anthony Kazos Jr. wrote:
> From: John Anthony Kazos Jr. <jakj@j-a-k-j.com>
>
> Functions of the form adfspart_check_FOO and foo_partition defined in
> fs/partitions/*.h are helper functions called in a deliberate order by
> check_partition in check.c. Add conditional-compilation directives and
> static inline no-op functions to allow code to indiscriminately call these
> functions irrespective of whether they do anything, removing the necessity
> of oodles of #ifdef/#endif in function bodies.
>
> Signed-off-by: John Anthony Kazos Jr. <jakj@j-a-k-j.com>
>
> ---
>
> The next patch changes the check.c code to use these function definitions
> in a nicer way.
>
> --- linux-2.6.20.6-orig/fs/partitions/acorn.h 2007-04-06 16:02:48.000000000 -0400
> +++ linux-2.6.20.6-mod/fs/partitions/acorn.h 2007-04-07 20:02:51.000000000 -0400
Send patches against the latest Linus-tree unless the patches are
specifically for the -stable branch (where 2.6.20.y is -stable
and 2.6.21-rc6 or -git is Linus). (Maybe it won't matter for
these patches....)
See Andrew's The Perfect Patch for more info:
http://www.zip.com.au/~akpm/linux/patches/stuff/tpp.txt
> @@ -7,8 +7,47 @@
> * format, and everyone stick to it?
> */
>
> -int adfspart_check_CUMANA(struct parsed_partitions *state, struct block_device *bdev);
> -int adfspart_check_ADFS(struct parsed_partitions *state, struct block_device *bdev);
> -int adfspart_check_ICS(struct parsed_partitions *state, struct block_device *bdev);
> -int adfspart_check_POWERTEC(struct parsed_partitions *state, struct block_device *bdev);
> -int adfspart_check_EESOX(struct parsed_partitions *state, struct block_device *bdev);
> +#ifdef CONFIG_ACORN_PARTITION_ICS
> + int adfspart_check_ICS(struct parsed_partitions *state, struct block_device *bdev);
> +#else
> + static inline int adfspart_check_ICS(struct parsed_partitions *state, struct block_device *bdev)
> + {
> + return 0;
> + }
> +#endif
> +
> +#ifdef CONFIG_ACORN_PARTITION_POWERTEC
> + int adfspart_check_POWERTEC(struct parsed_partitions *state, struct block_device *bdev);
> +#else
> + static inline int adfspart_check_POWERTEC(struct parsed_partitions *state, struct block_device *bdev)
> + {
> + return 0;
> + }
> +#endif
We don't indent functions inside ifdef/else/endif blocks.
Just act as though the preprocessor lines are not there.
(That's our current common practice; I don't see that documented
anywhere.)
---
~Randy
*** Remember to use Documentation/SubmitChecklist when testing your code ***
next prev parent reply other threads:[~2007-04-08 3:59 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-04-08 3:33 [PATCH 0/5] partitions: Changes to fs/partitions for readability and efficiency John Anthony Kazos Jr.
2007-04-08 3:38 ` [PATCH 1/5] partitions: Touch up comments for check.h and ibm.h John Anthony Kazos Jr.
2007-04-08 9:46 ` Christoph Hellwig
2007-04-08 3:39 ` [PATCH 2/5] partitions: Add Kconfig dependency to clear benign compiler warning John Anthony Kazos Jr.
2007-04-08 3:40 ` [PATCH 3/5] partitions: Add conditionals to acorn.c to clear benign compiler warnings John Anthony Kazos Jr.
2007-04-08 3:40 ` [PATCH 4/5] partitions: Add conditionals and static inline stubs to helpers in headers John Anthony Kazos Jr.
2007-04-08 4:01 ` Randy Dunlap [this message]
2007-04-08 9:47 ` Christoph Hellwig
2007-04-08 3:42 ` [PATCH 5/5] partitions: Rewrite check_partition to remove necessity of check_part John Anthony Kazos Jr.
2007-04-08 4:09 ` Randy Dunlap
2007-04-08 10:42 ` [PATCH 0/5] partitions: Changes to fs/partitions for readability and efficiency 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=20070407210108.66cdb32f.randy.dunlap@oracle.com \
--to=randy.dunlap@oracle.com \
--cc=aeb@cwi.nl \
--cc=jakj@j-a-k-j.com \
--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
Powered by JetHome