* [PATCH v2] thunderbolt (gcc13): synchronize tb_port_is_clx_enabled()'s 2nd param
@ 2022-12-12 10:29 Jiri Slaby (SUSE)
2022-12-13 14:54 ` Mika Westerberg
2022-12-27 8:38 ` Mika Westerberg
0 siblings, 2 replies; 3+ messages in thread
From: Jiri Slaby (SUSE) @ 2022-12-12 10:29 UTC (permalink / raw)
To: mika.westerberg
Cc: linux-kernel, Jiri Slaby (SUSE),
Martin Liska, Andreas Noever, Michael Jamet, Yehezkel Bernat,
linux-usb
tb_port_is_clx_enabled() generates a valid warning with gcc-13:
drivers/thunderbolt/switch.c:1286:6: error: conflicting types for 'tb_port_is_clx_enabled' due to enum/integer mismatch; have 'bool(struct tb_port *, unsigned int)' ...
drivers/thunderbolt/tb.h:1050:6: note: previous declaration of 'tb_port_is_clx_enabled' with type 'bool(struct tb_port *, enum tb_clx)' ...
I.e. the type of the 2nd parameter of tb_port_is_clx_enabled() in the
declaration is unsigned int, while the definition spells enum tb_clx.
Synchronize them to the former as the parameter is in fact a mask of the
enum values.
Cc: Martin Liska <mliska@suse.cz>
Cc: Andreas Noever <andreas.noever@gmail.com>
Cc: Michael Jamet <michael.jamet@intel.com>
Cc: Mika Westerberg <mika.westerberg@linux.intel.com>
Cc: Yehezkel Bernat <YehezkelShB@gmail.com>
Cc: linux-usb@vger.kernel.org
Signed-off-by: Jiri Slaby (SUSE) <jirislaby@kernel.org>
---
Notes:
[v2] switch to uint instead of to enum
drivers/thunderbolt/tb.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/thunderbolt/tb.h b/drivers/thunderbolt/tb.h
index f9786976f5ec..6c4a26b1c37c 100644
--- a/drivers/thunderbolt/tb.h
+++ b/drivers/thunderbolt/tb.h
@@ -1047,7 +1047,7 @@ void tb_port_lane_bonding_disable(struct tb_port *port);
int tb_port_wait_for_link_width(struct tb_port *port, int width,
int timeout_msec);
int tb_port_update_credits(struct tb_port *port);
-bool tb_port_is_clx_enabled(struct tb_port *port, enum tb_clx clx);
+bool tb_port_is_clx_enabled(struct tb_port *port, unsigned int clx);
int tb_switch_find_vse_cap(struct tb_switch *sw, enum tb_switch_vse_cap vsec);
int tb_switch_find_cap(struct tb_switch *sw, enum tb_switch_cap cap);
--
2.38.1
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH v2] thunderbolt (gcc13): synchronize tb_port_is_clx_enabled()'s 2nd param
2022-12-12 10:29 [PATCH v2] thunderbolt (gcc13): synchronize tb_port_is_clx_enabled()'s 2nd param Jiri Slaby (SUSE)
@ 2022-12-13 14:54 ` Mika Westerberg
2022-12-27 8:38 ` Mika Westerberg
1 sibling, 0 replies; 3+ messages in thread
From: Mika Westerberg @ 2022-12-13 14:54 UTC (permalink / raw)
To: Jiri Slaby (SUSE)
Cc: linux-kernel, Martin Liska, Andreas Noever, Michael Jamet,
Yehezkel Bernat, linux-usb
Hi,
On Mon, Dec 12, 2022 at 11:29:36AM +0100, Jiri Slaby (SUSE) wrote:
> tb_port_is_clx_enabled() generates a valid warning with gcc-13:
> drivers/thunderbolt/switch.c:1286:6: error: conflicting types for 'tb_port_is_clx_enabled' due to enum/integer mismatch; have 'bool(struct tb_port *, unsigned int)' ...
> drivers/thunderbolt/tb.h:1050:6: note: previous declaration of 'tb_port_is_clx_enabled' with type 'bool(struct tb_port *, enum tb_clx)' ...
>
> I.e. the type of the 2nd parameter of tb_port_is_clx_enabled() in the
> declaration is unsigned int, while the definition spells enum tb_clx.
> Synchronize them to the former as the parameter is in fact a mask of the
> enum values.
>
> Cc: Martin Liska <mliska@suse.cz>
> Cc: Andreas Noever <andreas.noever@gmail.com>
> Cc: Michael Jamet <michael.jamet@intel.com>
> Cc: Mika Westerberg <mika.westerberg@linux.intel.com>
> Cc: Yehezkel Bernat <YehezkelShB@gmail.com>
> Cc: linux-usb@vger.kernel.org
> Signed-off-by: Jiri Slaby (SUSE) <jirislaby@kernel.org>
Looks good now. I will pick this up after the merge window closes.
Thanks!
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH v2] thunderbolt (gcc13): synchronize tb_port_is_clx_enabled()'s 2nd param
2022-12-12 10:29 [PATCH v2] thunderbolt (gcc13): synchronize tb_port_is_clx_enabled()'s 2nd param Jiri Slaby (SUSE)
2022-12-13 14:54 ` Mika Westerberg
@ 2022-12-27 8:38 ` Mika Westerberg
1 sibling, 0 replies; 3+ messages in thread
From: Mika Westerberg @ 2022-12-27 8:38 UTC (permalink / raw)
To: Jiri Slaby (SUSE)
Cc: linux-kernel, Martin Liska, Andreas Noever, Michael Jamet,
Yehezkel Bernat, linux-usb
On Mon, Dec 12, 2022 at 11:29:36AM +0100, Jiri Slaby (SUSE) wrote:
> tb_port_is_clx_enabled() generates a valid warning with gcc-13:
> drivers/thunderbolt/switch.c:1286:6: error: conflicting types for 'tb_port_is_clx_enabled' due to enum/integer mismatch; have 'bool(struct tb_port *, unsigned int)' ...
> drivers/thunderbolt/tb.h:1050:6: note: previous declaration of 'tb_port_is_clx_enabled' with type 'bool(struct tb_port *, enum tb_clx)' ...
>
> I.e. the type of the 2nd parameter of tb_port_is_clx_enabled() in the
> declaration is unsigned int, while the definition spells enum tb_clx.
> Synchronize them to the former as the parameter is in fact a mask of the
> enum values.
>
> Cc: Martin Liska <mliska@suse.cz>
> Cc: Andreas Noever <andreas.noever@gmail.com>
> Cc: Michael Jamet <michael.jamet@intel.com>
> Cc: Mika Westerberg <mika.westerberg@linux.intel.com>
> Cc: Yehezkel Bernat <YehezkelShB@gmail.com>
> Cc: linux-usb@vger.kernel.org
> Signed-off-by: Jiri Slaby (SUSE) <jirislaby@kernel.org>
Applied now, thanks!
I changed the title slightly to avoid words like "synchronize" because
that makes me think this is fixing a race condition somewhere but in
fact this is simply fixing a function prototope to match the definition :)
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2022-12-27 8:38 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-12-12 10:29 [PATCH v2] thunderbolt (gcc13): synchronize tb_port_is_clx_enabled()'s 2nd param Jiri Slaby (SUSE)
2022-12-13 14:54 ` Mika Westerberg
2022-12-27 8:38 ` Mika Westerberg
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®