diff options
author | Marc-André Lureau <marcandre.lureau@redhat.com> | 2018-02-28 10:06:07 -0500 |
---|---|---|
committer | Michael S. Tsirkin <mst@redhat.com> | 2018-03-19 21:17:38 -0400 |
commit | f295c8dba71841f007e2154143109d1517670a08 (patch) | |
tree | 86e6993d59f2067799588dcca915c08858d27136 | |
parent | d174ea7d38bccb6a10aca036014ec74ea8f73d1c (diff) |
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: Marc-André Lureau <marcandre.lureau@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
-rw-r--r-- | drivers/firmware/qemu_fw_cfg.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/firmware/qemu_fw_cfg.c b/drivers/firmware/qemu_fw_cfg.c index 7978844f6b37..0eb155fdfb35 100644 --- a/drivers/firmware/qemu_fw_cfg.c +++ b/drivers/firmware/qemu_fw_cfg.c | |||
@@ -530,6 +530,7 @@ static inline void fw_cfg_kobj_cleanup(struct kobject *kobj) | |||
530 | static int fw_cfg_sysfs_probe(struct platform_device *pdev) | 530 | static int fw_cfg_sysfs_probe(struct platform_device *pdev) |
531 | { | 531 | { |
532 | int err; | 532 | int err; |
533 | __le32 rev; | ||
533 | 534 | ||
534 | /* NOTE: If we supported multiple fw_cfg devices, we'd first create | 535 | /* NOTE: If we supported multiple fw_cfg devices, we'd first create |
535 | * a subdirectory named after e.g. pdev->id, then hang per-device | 536 | * 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 | goto err_probe; | 556 | goto err_probe; |
556 | 557 | ||
557 | /* get revision number, add matching top-level attribute */ | 558 | /* get revision number, add matching top-level attribute */ |
558 | fw_cfg_read_blob(FW_CFG_ID, &fw_cfg_rev, 0, sizeof(fw_cfg_rev)); | 559 | fw_cfg_read_blob(FW_CFG_ID, &rev, 0, sizeof(rev)); |
559 | fw_cfg_rev = le32_to_cpu(fw_cfg_rev); | 560 | fw_cfg_rev = le32_to_cpu(rev); |
560 | err = sysfs_create_file(fw_cfg_top_ko, &fw_cfg_rev_attr.attr); | 561 | err = sysfs_create_file(fw_cfg_top_ko, &fw_cfg_rev_attr.attr); |
561 | if (err) | 562 | if (err) |
562 | goto err_rev; | 563 | goto err_rev; |