All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@oracle.com>
To: alexander.deucher@amd.com
Cc: dri-devel@lists.freedesktop.org
Subject: re: drm/radeon/kms: add dpm support for KB/KV
Date: Tue, 3 May 2016 21:53:38 +0300	[thread overview]
Message-ID: <20160503185338.GA31761@mwanda> (raw)

Hello Alex Deucher,

The patch 41a524abff26: "drm/radeon/kms: add dpm support for KB/KV"
from Aug 14, 2013, leads to the following static checker warning:

	drivers/gpu/drm/radeon/kv_dpm.c:1376 kv_init_fps_limits()
	error: wrong number of bits for 'cpu_to_be16' (8 vs 16) left= 'pi->fps_low_t' pi->fps_low_t = (__builtin_bswap16(((tmp))))

drivers/gpu/drm/radeon/kv_dpm.c
  1359  static int kv_init_fps_limits(struct radeon_device *rdev)
  1360  {
  1361          struct kv_power_info *pi = kv_get_pi(rdev);
  1362          int ret = 0;
  1363  
  1364          if (pi->caps_fps) {
  1365                  u16 tmp;
  1366  
  1367                  tmp = 45;
  1368                  pi->fps_high_t = cpu_to_be16(tmp);
  1369                  ret = kv_copy_bytes_to_smc(rdev,
  1370                                             pi->dpm_table_start +
  1371                                             offsetof(SMU7_Fusion_DpmTable, FpsHighT),
  1372                                             (u8 *)&pi->fps_high_t,
  1373                                             sizeof(u16), pi->sram_end);
  1374  
  1375                  tmp = 30;
  1376                  pi->fps_low_t = cpu_to_be16(tmp);
                        ^^^^^^^^^^^^^
This is a u8 so it can't hold a be16.

  1377  
  1378                  ret = kv_copy_bytes_to_smc(rdev,
  1379                                             pi->dpm_table_start +
  1380                                             offsetof(SMU7_Fusion_DpmTable, FpsLowT),
  1381                                             (u8 *)&pi->fps_low_t,
                                                   ^^^^^^
This cast is not needed since it's already a u8 pointer.

  1382                                             sizeof(u16), pi->sram_end);
  1383  
  1384          }
  1385          return ret;
  1386  }

regards,
dan carpenter
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

             reply	other threads:[~2016-05-03 18:53 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-05-03 18:53 Dan Carpenter [this message]
2016-05-04  6:37 ` drm/radeon/kms: add dpm support for KB/KV Dan Carpenter

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20160503185338.GA31761@mwanda \
    --to=dan.carpenter@oracle.com \
    --cc=alexander.deucher@amd.com \
    --cc=dri-devel@lists.freedesktop.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.