diff mbox series

[RFC,1/4] btrfs: turn checksum type define into a union

Message ID 6601e14425550304e1ba8b5317e74a5f806d6a34.1564046812.git.jthumshirn@suse.de (mailing list archive)
State New, archived
Headers show
Series Support xxhash64 checksums | expand

Commit Message

Johannes Thumshirn July 25, 2019, 9:33 a.m. UTC
Turn the checksum type definition into a union. This eases later addition
of new checksums.

Signed-off-by: Johannes Thumshirn <jthumshirn@suse.de>
---
 include/uapi/linux/btrfs_tree.h | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

Comments

Mike Fleetwood July 25, 2019, 11:08 a.m. UTC | #1
On Thu, 25 Jul 2019 at 10:34, Johannes Thumshirn <jthumshirn@suse.de> wrote:
>
> Turn the checksum type definition into a union. This eases later addition
> of new checksums.

I think you meant to say "Turn the checksum type definition into an
_enum_." in the title and commit message.


>
> Signed-off-by: Johannes Thumshirn <jthumshirn@suse.de>
> ---
>  include/uapi/linux/btrfs_tree.h | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/include/uapi/linux/btrfs_tree.h b/include/uapi/linux/btrfs_tree.h
> index 34d5b34286fa..babef98181a2 100644
> --- a/include/uapi/linux/btrfs_tree.h
> +++ b/include/uapi/linux/btrfs_tree.h
> @@ -300,7 +300,9 @@
>  #define BTRFS_CSUM_SIZE 32
>
>  /* csum types */
> -#define BTRFS_CSUM_TYPE_CRC32  0
> +enum btrfs_csum_type {
> +       BTRFS_CSUM_TYPE_CRC32   = 0,
> +};
>
>  /*
>   * flags definitions for directory entry item type
> --
> 2.16.4
>
Johannes Thumshirn July 25, 2019, 11:21 a.m. UTC | #2
On Thu, Jul 25, 2019 at 12:08:44PM +0100, Mike Fleetwood wrote:
> On Thu, 25 Jul 2019 at 10:34, Johannes Thumshirn <jthumshirn@suse.de> wrote:
> >
> > Turn the checksum type definition into a union. This eases later addition
> > of new checksums.
> 
> I think you meant to say "Turn the checksum type definition into an
> _enum_." in the title and commit message.

Indeed I did want to write 'enum'. No idea why I wrote union o.O

Thanks for spotting,
	JOhannes
diff mbox series

Patch

diff --git a/include/uapi/linux/btrfs_tree.h b/include/uapi/linux/btrfs_tree.h
index 34d5b34286fa..babef98181a2 100644
--- a/include/uapi/linux/btrfs_tree.h
+++ b/include/uapi/linux/btrfs_tree.h
@@ -300,7 +300,9 @@ 
 #define BTRFS_CSUM_SIZE 32
 
 /* csum types */
-#define BTRFS_CSUM_TYPE_CRC32	0
+enum btrfs_csum_type {
+	BTRFS_CSUM_TYPE_CRC32	= 0,
+};
 
 /*
  * flags definitions for directory entry item type