From: Dan Carpenter <dan.carpenter@linaro.org>
To: Jani Nikula <jani.nikula@linux.intel.com>
Cc: Jim Qu <Jim.Qu@amd.com>, Lukas Wunner <lukas@wunner.de>,
Maarten Lankhorst <maarten.lankhorst@linux.intel.com>,
Maxime Ripard <mripard@kernel.org>,
Thomas Zimmermann <tzimmermann@suse.de>,
David Airlie <airlied@gmail.com>, Simona Vetter <simona@ffwll.ch>,
Takashi Iwai <tiwai@suse.de>,
dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org,
kernel-janitors@vger.kernel.org, Su Hui <suhui@nfschina.com>
Subject: Re: [PATCH] vgaswitcheroo: Fix error checking in vga_switcheroo_register_audio_client()
Date: Wed, 19 Feb 2025 19:04:54 +0300 [thread overview]
Message-ID: <f608a3b5-320a-4194-bd03-cf08be04c317@stanley.mountain> (raw)
In-Reply-To: <87zfiim09n.fsf@intel.com>
On Wed, Feb 19, 2025 at 05:17:56PM +0200, Jani Nikula wrote:
> On Wed, 19 Feb 2025, Dan Carpenter <dan.carpenter@linaro.org> wrote:
> > The "id" variable is an enum and in this context it's treated as an
> > unsigned int so the error handling can never trigger.
>
> When would that be true with GCC?
The C standard give compilers a lot of flexibility with regards to enums.
But in terms of GCC/Clang then enums default to unsigned int, if you
declare one as negative then they become signed int. If they don't fit
in int, then they become u64 etc.
enum u32_values {
zero,
};
enum s32_values {
minus_one = -1,
zero,
};
enum u64_values {
big = 0xfffffffffUL;
};
regards,
dan carpenter
next prev parent reply other threads:[~2025-02-19 16:05 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-02-19 13:49 Dan Carpenter
2025-02-19 15:17 ` Jani Nikula
2025-02-19 16:04 ` Dan Carpenter [this message]
2025-02-19 18:54 ` Jani Nikula
2025-02-24 13:14 ` Jani Nikula
2025-02-24 19:26 ` Dan Carpenter
2025-02-25 9:10 ` Jani Nikula
2025-02-25 9:36 ` Takashi Iwai
2025-02-25 11:56 ` Dan Carpenter
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=f608a3b5-320a-4194-bd03-cf08be04c317@stanley.mountain \
--to=dan.carpenter@linaro.org \
--cc=Jim.Qu@amd.com \
--cc=airlied@gmail.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=jani.nikula@linux.intel.com \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=lukas@wunner.de \
--cc=maarten.lankhorst@linux.intel.com \
--cc=mripard@kernel.org \
--cc=simona@ffwll.ch \
--cc=suhui@nfschina.com \
--cc=tiwai@suse.de \
--cc=tzimmermann@suse.de \
/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
all inboxes | Powered by JetHome®