]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
drm/tegra: hdmi: sor: Fix error: variable ā€˜j’ set but not used
authorBrahmajit Das <listout@listout.xyz>
Mon, 1 Sep 2025 21:20:20 +0000 (02:50 +0530)
committerThierry Reding <treding@nvidia.com>
Thu, 11 Sep 2025 16:56:28 +0000 (18:56 +0200)
The variable j is set, however never used in or outside the loop, thus
resulting in dead code.
Building with GCC 16 results in a build error due to
-Werror=unused-but-set-variable= enabled by default.
This patch clean up the dead code and fixes the build error.

Example build log:
drivers/gpu/drm/tegra/sor.c:1867:19: error: variable ā€˜j’ set but not used [-Werror=unused-but-set-variable=]
 1867 |         size_t i, j;
      |                   ^

Signed-off-by: Brahmajit Das <listout@listout.xyz>
Signed-off-by: Thierry Reding <treding@nvidia.com>
Link: https://lore.kernel.org/r/20250901212020.3757519-1-listout@listout.xyz
drivers/gpu/drm/tegra/hdmi.c
drivers/gpu/drm/tegra/sor.c

index 8cd2969e7d4bfe2d9ff4065e9c5c8dda7925c3d9..c4820f5e765813c6451413fa6e13d6e51442df28 100644 (file)
@@ -658,7 +658,7 @@ static void tegra_hdmi_write_infopack(struct tegra_hdmi *hdmi, const void *data,
 {
        const u8 *ptr = data;
        unsigned long offset;
-       size_t i, j;
+       size_t i;
        u32 value;
 
        switch (ptr[0]) {
@@ -691,7 +691,7 @@ static void tegra_hdmi_write_infopack(struct tegra_hdmi *hdmi, const void *data,
         * - subpack_low: bytes 0 - 3
         * - subpack_high: bytes 4 - 6 (with byte 7 padded to 0x00)
         */
-       for (i = 3, j = 0; i < size; i += 7, j += 8) {
+       for (i = 3; i < size; i += 7) {
                size_t rem = size - i, num = min_t(size_t, rem, 4);
 
                value = tegra_hdmi_subpack(&ptr[i], num);
index 21f3dfdcc5c9576580b9aa9990dd1bedcdeb4482..bc7dd562cf6b6b081a945bc432346f65b712c1c5 100644 (file)
@@ -1864,7 +1864,7 @@ static void tegra_sor_hdmi_write_infopack(struct tegra_sor *sor,
 {
        const u8 *ptr = data;
        unsigned long offset;
-       size_t i, j;
+       size_t i;
        u32 value;
 
        switch (ptr[0]) {
@@ -1897,7 +1897,7 @@ static void tegra_sor_hdmi_write_infopack(struct tegra_sor *sor,
         * - subpack_low: bytes 0 - 3
         * - subpack_high: bytes 4 - 6 (with byte 7 padded to 0x00)
         */
-       for (i = 3, j = 0; i < size; i += 7, j += 8) {
+       for (i = 3; i < size; i += 7) {
                size_t rem = size - i, num = min_t(size_t, rem, 4);
 
                value = tegra_sor_hdmi_subpack(&ptr[i], num);