lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Sat, 7 Apr 2007 21:01:08 -0700
From:	Randy Dunlap <randy.dunlap@...cle.com>
To:	"John Anthony Kazos Jr." <jakj@...-k-j.com>
Cc:	aeb@....nl, linux-kernel@...r.kernel.org
Subject: Re: [PATCH 4/5] partitions: Add conditionals and static inline
 stubs to helpers in headers

On Sat, 7 Apr 2007 23:40:50 -0400 (EDT) John Anthony Kazos Jr. wrote:

> From: John Anthony Kazos Jr. <jakj@...-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@...-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 ***
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists