mirror of
https://github.com/torvalds/linux.git
synced 2026-05-25 15:41:52 +02:00
pds_core: devlink health: use retained error fmsg API
Drop unneeded error checking. devlink_fmsg_*() family of functions is now retaining errors, so there is no need to check for them after each call. Reviewed-by: Jesse Brandeburg <jesse.brandeburg@intel.com> Reviewed-by: Jiri Pirko <jiri@nvidia.com> Reviewed-by: Shannon Nelson <shannon.nelson@amd.com> Signed-off-by: Przemek Kitszel <przemyslaw.kitszel@intel.com> Reviewed-by: Simon Horman <horms@kernel.org> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
20f9b9d385
commit
47957bb3f7
|
|
@ -154,33 +154,20 @@ int pdsc_fw_reporter_diagnose(struct devlink_health_reporter *reporter,
|
|||
struct netlink_ext_ack *extack)
|
||||
{
|
||||
struct pdsc *pdsc = devlink_health_reporter_priv(reporter);
|
||||
int err;
|
||||
|
||||
mutex_lock(&pdsc->config_lock);
|
||||
|
||||
if (test_bit(PDSC_S_FW_DEAD, &pdsc->state))
|
||||
err = devlink_fmsg_string_pair_put(fmsg, "Status", "dead");
|
||||
devlink_fmsg_string_pair_put(fmsg, "Status", "dead");
|
||||
else if (!pdsc_is_fw_good(pdsc))
|
||||
err = devlink_fmsg_string_pair_put(fmsg, "Status", "unhealthy");
|
||||
devlink_fmsg_string_pair_put(fmsg, "Status", "unhealthy");
|
||||
else
|
||||
err = devlink_fmsg_string_pair_put(fmsg, "Status", "healthy");
|
||||
|
||||
devlink_fmsg_string_pair_put(fmsg, "Status", "healthy");
|
||||
mutex_unlock(&pdsc->config_lock);
|
||||
|
||||
if (err)
|
||||
return err;
|
||||
devlink_fmsg_u32_pair_put(fmsg, "State",
|
||||
pdsc->fw_status & ~PDS_CORE_FW_STS_F_GENERATION);
|
||||
devlink_fmsg_u32_pair_put(fmsg, "Generation", pdsc->fw_generation >> 4);
|
||||
devlink_fmsg_u32_pair_put(fmsg, "Recoveries", pdsc->fw_recoveries);
|
||||
|
||||
err = devlink_fmsg_u32_pair_put(fmsg, "State",
|
||||
pdsc->fw_status &
|
||||
~PDS_CORE_FW_STS_F_GENERATION);
|
||||
if (err)
|
||||
return err;
|
||||
|
||||
err = devlink_fmsg_u32_pair_put(fmsg, "Generation",
|
||||
pdsc->fw_generation >> 4);
|
||||
if (err)
|
||||
return err;
|
||||
|
||||
return devlink_fmsg_u32_pair_put(fmsg, "Recoveries",
|
||||
pdsc->fw_recoveries);
|
||||
return 0;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user