drm/bridge: sii902x: fix comparision of u32 with less than zero
Subsystems (4)
PATCH 1/1 drm/bridge: sii902x: fix comparision of u32 with less than zero
From: Colin Ian King <[email protected]>
The less than check for the variable num_lanes is always going to be false because the variable is a u32. Fix this by making num_lanes an int and also make loop index i an int too.
Addresses-Coverity: ("Unsigned compared against 0")
--- drivers/gpu/drm/bridge/sii902x.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/bridge/sii902x.c +1 -1
@@ -719,7 +719,7 @@ static int sii902x_audio_codec_init(struct sii902x *sii902x, .max_i2s_channels = 0, };u8 lanes[4 ]; -u32 num_lanes, i; +int num_lanes, i;if (!of_property_read_bool (dev->of_node,"#sound-dai-cells" )) { dev_dbg(dev, "%s: No \"#sound-dai-cells\", no audio\n",
Signature · 1 line
2.20.1
Quoted 9 lines · Colin King
From: Colin Ian King <[email protected]>
The less than check for the variable
num_lanesis always going to be false because the variable is a u32. Fix this by makingnum_lanesan int and also make loop index i an int too.Addresses-Coverity: ("Unsigned compared against 0")
Fixes ff5781634c41 ("drm/bridge: sii902x: Implement HDMI audio support")Signed-off-by Colin Ian King <[email protected]>
Oh, one of these slipped trough after all.
Quoted 18 lines
--- drivers/gpu/drm/bridge/sii902x.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/gpu/drm/bridge/sii902x.c +1
-1@@ -719,7 +719,7 @@ static int sii902x_audio_codec_init(struct sii902x *sii902x, .max_i2s_channels = 0, };u8 lanes[4 ]; -u32 num_lanes, i; +int num_lanes, i;if (!of_property_read_bool (dev->of_node,"#sound-dai-cells" )) { dev_dbg(dev, "%s: No \"#sound-dai-cells\", no audio\n",
Signature · 2 lines
Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki. Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki
Quoted 7 lines · Colin King
From: Colin Ian King <[email protected]>
The less than check for the variable
num_lanesis always going to be false because the variable is a u32. Fix this by makingnum_lanesan int and also make loop index i an int too.Addresses-Coverity: ("Unsigned compared against 0")
Is there a rule in Kernel of adding such tags?
I have spotted only: Addresses-Coverity-ID?
Beside this:
--
Regards
Andrzej
Quoted 19 lines
Fixes ff5781634c41 ("drm/bridge: sii902x: Implement HDMI audio support")Signed-off-by Colin Ian King <[email protected]>--- drivers/gpu/drm/bridge/sii902x.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/gpu/drm/bridge/sii902x.c +1
-1@@ -719,7 +719,7 @@ static int sii902x_audio_codec_init(struct sii902x *sii902x, .max_i2s_channels = 0, };u8 lanes[4 ]; -u32 num_lanes, i; +int num_lanes, i;if (!of_property_read_bool (dev->of_node,"#sound-dai-cells" )) { dev_dbg(dev, "%s: No \"#sound-dai-cells\", no audio\n",
Quoted 7 lines · Andrzej Hajda
Quoted 6 lines · Colin King
From: Colin Ian King <[email protected]>
The less than check for the variable
num_lanesis always going to be false because the variable is a u32. Fix this by makingnum_lanesan int and also make loop index i an int too.
Quoted 7 lines
Quoted 1 line
Addresses-Coverity: ("Unsigned compared against 0")
Is there a rule in Kernel of adding such tags?
I have spotted only: Addresses-Coverity-ID?
Unfortunately I'm running a Coverity in-house and so the Coverity ID is not public, so it does not make sense for me to report the ID.
Colin
Quoted 31 lines
Beside this:
Reviewed-by Andrzej Hajda <[email protected]>--
Regards
AndrzejQuoted 19 lines
Fixes ff5781634c41 ("drm/bridge: sii902x: Implement HDMI audio support")Signed-off-by Colin Ian King <[email protected]>--- drivers/gpu/drm/bridge/sii902x.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/gpu/drm/bridge/sii902x.c +1
-1@@ -719,7 +719,7 @@ static int sii902x_audio_codec_init(struct sii902x *sii902x, .max_i2s_channels = 0, };u8 lanes[4 ]; -u32 num_lanes, i; +int num_lanes, i;if (!of_property_read_bool (dev->of_node,"#sound-dai-cells" )) { dev_dbg(dev, "%s: No \"#sound-dai-cells\", no audio\n",
Andrzej Hajda
AppliedQuoted 18 lines · Colin King
From: Colin Ian King <[email protected]>
The less than check for the variable
num_lanesis always going to be false because the variable is a u32. Fix this by makingnum_lanesan int and also make loop index i an int too.Addresses-Coverity: ("Unsigned compared against 0")
Fixes ff5781634c41 ("drm/bridge: sii902x: Implement HDMI audio support")Signed-off-by Colin Ian King <[email protected]>--- drivers/gpu/drm/bridge/sii902x.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/gpu/drm/bridge/sii902x.c +0
-0
drivers/gpu/drm/bridge/sii902x.c static int sii902x_audio_codec_init(struct sii902x *sii902x, · line 725
Quoted 8 lines
drivers/gpu/drm/bridge/sii902x.c +1
-1@@ -719,7 +719,7 @@ static int sii902x_audio_codec_init(struct sii902x *sii902x, .max_i2s_channels = 0, };u8 lanes[4 ]; -u32 num_lanes, i; +int num_lanes, i;if (!of_property_read_bool (dev->of_node,"#sound-dai-cells" )) { dev_dbg(dev, "%s: No \"#sound-dai-cells\", no audio\n",
Queued to drm-misc-next.
--
Regards
Andrzej