Skip to content

Commit

Permalink
drm/vc4: Update type of reg parameter in vc4_hdmi_{read,write}
Browse files Browse the repository at this point in the history
Clang warns 100+ times in the vc4 driver along the lines of:

drivers/gpu/drm/vc4/vc4_hdmi_phy.c:518:13: warning: implicit conversion
from enumeration type 'enum vc4_hdmi_field' to different enumeration
type 'enum vc4_hdmi_regs' [-Wenum-conversion]
        HDMI_WRITE(HDMI_TX_PHY_POWERDOWN_CTL,
        ~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~

The HDMI_READ and HDMI_WRITE macros pass in enumerators of type
vc4_hdmi_field but vc4_hdmi_write and vc4_hdmi_read expect a enumerator
of type vc4_hdmi_regs, causing a warning for every instance of this.
Update the parameter type so there is no more mismatch.

Fixes: 311e305 ("drm/vc4: hdmi: Implement a register layout abstraction")
Signed-off-by: Nathan Chancellor <natechancellor@gmail.com>
Link: ClangBuiltLinux/linux#1149
Signed-off-by: Maxime Ripard <maxime@cerno.tech>
Link: https://patchwork.freedesktop.org/patch/msgid/20200910170401.3857250-1-natechancellor@gmail.com
  • Loading branch information
nathanchance authored and popcornmix committed Sep 15, 2020
1 parent e8bf1a4 commit a1ffd14
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/gpu/drm/vc4/vc4_hdmi_regs.h
Original file line number Diff line number Diff line change
Expand Up @@ -411,7 +411,7 @@ void __iomem *__vc4_hdmi_get_field_base(struct vc4_hdmi *hdmi,
}

static inline u32 vc4_hdmi_read(struct vc4_hdmi *hdmi,
enum vc4_hdmi_regs reg)
enum vc4_hdmi_field reg)
{
const struct vc4_hdmi_register *field;
const struct vc4_hdmi_variant *variant = hdmi->variant;
Expand All @@ -436,7 +436,7 @@ static inline u32 vc4_hdmi_read(struct vc4_hdmi *hdmi,
#define HDMI_READ(reg) vc4_hdmi_read(vc4_hdmi, reg)

static inline void vc4_hdmi_write(struct vc4_hdmi *hdmi,
enum vc4_hdmi_regs reg,
enum vc4_hdmi_field reg,
u32 value)
{
const struct vc4_hdmi_register *field;
Expand Down

0 comments on commit a1ffd14

Please sign in to comment.