Re: [PATCH] vgaswitcheroo: Fix error checking in vga_switcheroo_register_audio_client()

2025-02-25 Thread Dan Carpenter
On Tue, Feb 25, 2025 at 11:10:29AM +0200, Jani Nikula wrote: > On Mon, 24 Feb 2025, Dan Carpenter wrote: > > On Mon, Feb 24, 2025 at 03:14:33PM +0200, Jani Nikula wrote: > >> On Wed, 19 Feb 2025, Dan Carpenter wrote: > >> > The "id" variable is an enum and in this context it's treated as an > >>

Re: [PATCH] vgaswitcheroo: Fix error checking in vga_switcheroo_register_audio_client()

2025-02-25 Thread Takashi Iwai
On Tue, 25 Feb 2025 10:10:29 +0100, Jani Nikula wrote: > > On Mon, 24 Feb 2025, Dan Carpenter wrote: > > On Mon, Feb 24, 2025 at 03:14:33PM +0200, Jani Nikula wrote: > >> On Wed, 19 Feb 2025, Dan Carpenter wrote: > >> > The "id" variable is an enum and in this context it's treated as an > >> > u

Re: [PATCH] vgaswitcheroo: Fix error checking in vga_switcheroo_register_audio_client()

2025-02-25 Thread Jani Nikula
On Mon, 24 Feb 2025, Dan Carpenter wrote: > On Mon, Feb 24, 2025 at 03:14:33PM +0200, Jani Nikula wrote: >> On Wed, 19 Feb 2025, Dan Carpenter 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. The >> > ->get

Re: [PATCH] vgaswitcheroo: Fix error checking in vga_switcheroo_register_audio_client()

2025-02-24 Thread Dan Carpenter
On Mon, Feb 24, 2025 at 03:14:33PM +0200, Jani Nikula wrote: > On Wed, 19 Feb 2025, Dan Carpenter 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. The > > ->get_client_id() functions do not currently return an

Re: [PATCH] vgaswitcheroo: Fix error checking in vga_switcheroo_register_audio_client()

2025-02-24 Thread Jani Nikula
On Wed, 19 Feb 2025, Dan Carpenter 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. The > ->get_client_id() functions do not currently return any errors but > I imagine that if they did, then the intention was to

Re: [PATCH] vgaswitcheroo: Fix error checking in vga_switcheroo_register_audio_client()

2025-02-19 Thread Jani Nikula
On Wed, 19 Feb 2025, Dan Carpenter wrote: > On Wed, Feb 19, 2025 at 05:17:56PM +0200, Jani Nikula wrote: >> On Wed, 19 Feb 2025, Dan Carpenter 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 wou

Re: [PATCH] vgaswitcheroo: Fix error checking in vga_switcheroo_register_audio_client()

2025-02-19 Thread Dan Carpenter
On Wed, Feb 19, 2025 at 05:17:56PM +0200, Jani Nikula wrote: > On Wed, 19 Feb 2025, Dan Carpenter 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 com

Re: [PATCH] vgaswitcheroo: Fix error checking in vga_switcheroo_register_audio_client()

2025-02-19 Thread Jani Nikula
On Wed, 19 Feb 2025, Dan Carpenter 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? BR, Jani. > The > ->get_client_id() functions do not currently return any errors but > I imag

[PATCH] vgaswitcheroo: Fix error checking in vga_switcheroo_register_audio_client()

2025-02-19 Thread Dan Carpenter
The "id" variable is an enum and in this context it's treated as an unsigned int so the error handling can never trigger. The ->get_client_id() functions do not currently return any errors but I imagine that if they did, then the intention was to return VGA_SWITCHEROO_UNKNOWN_ID on error. Let's c