Skip to content

Commit

Permalink
ASoC: fix rockchip 64-bit build warning
Browse files Browse the repository at this point in the history
The rk_spdif_probe uses the device match data as a token to identify a
particular device, but accidentally casts a pointer to 'int', which is
not portable, as gcc points out in this warning on arm64:

rockchip_spdif.c: In function 'rk_spdif_probe':
rockchip_spdif.c:283:6: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]

This changes the logic to compare two pointer values instead, using
the same cast that was used for initializing the value in the first
place.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Mark Brown <broonie@kernel.org>
  • Loading branch information
Arnd Bergmann authored and Mark Brown committed Nov 16, 2015
1 parent 8005c49 commit 0e18d45
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion sound/soc/rockchip/rockchip_spdif.c
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,7 @@ static int rk_spdif_probe(struct platform_device *pdev)
int ret;

match = of_match_node(rk_spdif_match, np);
if ((int) match->data == RK_SPDIF_RK3288) {
if (match->data == (void *)RK_SPDIF_RK3288) {
struct regmap *grf;

grf = syscon_regmap_lookup_by_phandle(np, "rockchip,grf");
Expand Down

0 comments on commit 0e18d45

Please sign in to comment.