Commit f295c8db authored by Marc-André Lureau's avatar Marc-André Lureau Committed by Michael S. Tsirkin

fw_cfg: fix sparse warning reading FW_CFG_ID

Use a restricted type for reading FW_CFG_ID, fixing sparse warning:

drivers/firmware/qemu_fw_cfg.c:540:22: warning: cast to restricted __le32
Signed-off-by: default avatarMarc-André Lureau <marcandre.lureau@redhat.com>
Signed-off-by: default avatarMichael S. Tsirkin <mst@redhat.com>
parent d174ea7d
...@@ -530,6 +530,7 @@ static inline void fw_cfg_kobj_cleanup(struct kobject *kobj) ...@@ -530,6 +530,7 @@ static inline void fw_cfg_kobj_cleanup(struct kobject *kobj)
static int fw_cfg_sysfs_probe(struct platform_device *pdev) static int fw_cfg_sysfs_probe(struct platform_device *pdev)
{ {
int err; int err;
__le32 rev;
/* NOTE: If we supported multiple fw_cfg devices, we'd first create /* NOTE: If we supported multiple fw_cfg devices, we'd first create
* a subdirectory named after e.g. pdev->id, then hang per-device * a subdirectory named after e.g. pdev->id, then hang per-device
...@@ -555,8 +556,8 @@ static int fw_cfg_sysfs_probe(struct platform_device *pdev) ...@@ -555,8 +556,8 @@ static int fw_cfg_sysfs_probe(struct platform_device *pdev)
goto err_probe; goto err_probe;
/* get revision number, add matching top-level attribute */ /* get revision number, add matching top-level attribute */
fw_cfg_read_blob(FW_CFG_ID, &fw_cfg_rev, 0, sizeof(fw_cfg_rev)); fw_cfg_read_blob(FW_CFG_ID, &rev, 0, sizeof(rev));
fw_cfg_rev = le32_to_cpu(fw_cfg_rev); fw_cfg_rev = le32_to_cpu(rev);
err = sysfs_create_file(fw_cfg_top_ko, &fw_cfg_rev_attr.attr); err = sysfs_create_file(fw_cfg_top_ko, &fw_cfg_rev_attr.attr);
if (err) if (err)
goto err_rev; goto err_rev;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment