Linux-Modules Archive on lore.kernel.org
 help / Atom feed
* [PATCH] libkmod: drop _PAD enum constants
@ 2018-07-18  8:43 Jan Engelhardt
  2018-07-18 18:46 ` Lucas De Marchi
  0 siblings, 1 reply; 2+ messages in thread
From: Jan Engelhardt @ 2018-07-18  8:43 UTC (permalink / raw)
  To: lucas.demarchi; +Cc: linux-modules, jengelh

When are enums ever mapped to something smaller than int, other than
willful packing into a bitfield?
---
 libkmod/libkmod.h | 4 ----
 1 file changed, 4 deletions(-)

diff --git a/libkmod/libkmod.h b/libkmod/libkmod.h
index 352627e..4fb5ba8 100644
--- a/libkmod/libkmod.h
+++ b/libkmod/libkmod.h
@@ -71,8 +71,6 @@ enum kmod_index {
 	KMOD_INDEX_MODULES_ALIAS,
 	KMOD_INDEX_MODULES_SYMBOL,
 	KMOD_INDEX_MODULES_BUILTIN,
-	/* Padding to make sure enum is not mapped to char */
-	_KMOD_INDEX_PAD = 1U << 31,
 };
 int kmod_dump_index(struct kmod_ctx *ctx, enum kmod_index type, int fd);
 
@@ -210,8 +208,6 @@ enum kmod_module_initstate {
 	KMOD_MODULE_LIVE,
 	KMOD_MODULE_COMING,
 	KMOD_MODULE_GOING,
-	/* Padding to make sure enum is not mapped to char */
-	_KMOD_MODULE_PAD = 1U << 31,
 };
 const char *kmod_module_initstate_str(enum kmod_module_initstate state);
 int kmod_module_get_initstate(const struct kmod_module *mod);
-- 
2.18.0


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] libkmod: drop _PAD enum constants
  2018-07-18  8:43 [PATCH] libkmod: drop _PAD enum constants Jan Engelhardt
@ 2018-07-18 18:46 ` Lucas De Marchi
  0 siblings, 0 replies; 2+ messages in thread
From: Lucas De Marchi @ 2018-07-18 18:46 UTC (permalink / raw)
  To: Jan Engelhardt; +Cc: Lucas De Marchi, linux-modules, Jan Engelhardt

On Wed, Jul 18, 2018 at 1:44 AM Jan Engelhardt <jengelh@inai.de> wrote:
>
> When are enums ever mapped to something smaller than int, other than
> willful packing into a bitfield?

When users do bad things like passing a flag to the compiler
instructing it to do so: -fshort-enums.
That was the reason to add it back several years ago and I'd rather
not break that user now whoever it was,
although I don't think I would care adding it now if it was requested.


Lucas De Marchi

> ---
>  libkmod/libkmod.h | 4 ----
>  1 file changed, 4 deletions(-)
>
> diff --git a/libkmod/libkmod.h b/libkmod/libkmod.h
> index 352627e..4fb5ba8 100644
> --- a/libkmod/libkmod.h
> +++ b/libkmod/libkmod.h
> @@ -71,8 +71,6 @@ enum kmod_index {
>         KMOD_INDEX_MODULES_ALIAS,
>         KMOD_INDEX_MODULES_SYMBOL,
>         KMOD_INDEX_MODULES_BUILTIN,
> -       /* Padding to make sure enum is not mapped to char */
> -       _KMOD_INDEX_PAD = 1U << 31,
>  };
>  int kmod_dump_index(struct kmod_ctx *ctx, enum kmod_index type, int fd);
>
> @@ -210,8 +208,6 @@ enum kmod_module_initstate {
>         KMOD_MODULE_LIVE,
>         KMOD_MODULE_COMING,
>         KMOD_MODULE_GOING,
> -       /* Padding to make sure enum is not mapped to char */
> -       _KMOD_MODULE_PAD = 1U << 31,
>  };
>  const char *kmod_module_initstate_str(enum kmod_module_initstate state);
>  int kmod_module_get_initstate(const struct kmod_module *mod);
> --
> 2.18.0
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-modules" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html



-- 
Lucas De Marchi

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, back to index

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-07-18  8:43 [PATCH] libkmod: drop _PAD enum constants Jan Engelhardt
2018-07-18 18:46 ` Lucas De Marchi

Linux-Modules Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-modules/0 linux-modules/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-modules linux-modules/ https://lore.kernel.org/linux-modules \
		linux-modules@vger.kernel.org linux-modules@archiver.kernel.org
	public-inbox-index linux-modules


Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-modules


AGPL code for this site: git clone https://public-inbox.org/ public-inbox