lkml.org 
[lkml]   [2016]   [Dec]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH 4/5] acpi, nfit: fix bus vs dimm confusion in xlat_status
On Tue, Dec 6, 2016 at 4:39 PM, Dan Williams <dan.j.williams@intel.com> wrote:
> Given dimms and bus commands share the same command number space we need
> to be careful that we are translating status in the correct context.
> Otherwise we can, for example, fail an ND_CMD_GET_CONFIG_SIZE command
> because max_xfer is zero. It fails because that condition erroneously
> correlates with the 'cleared == 0' failure of ND_CMD_CLEAR_ERROR.
>
> Cc: <stable@vger.kernel.org>
> Fixes: aef253382266 ("libnvdimm, nfit: centralize command status translation")
> Signed-off-by: Dan Williams <dan.j.williams@intel.com>
> ---
> drivers/acpi/nfit/core.c | 16 +++++++++++++---
> 1 file changed, 13 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/acpi/nfit/core.c b/drivers/acpi/nfit/core.c
> index 4b8b4f520d76..9690b28f0da7 100644
> --- a/drivers/acpi/nfit/core.c
> +++ b/drivers/acpi/nfit/core.c
> @@ -94,7 +94,7 @@ static struct acpi_device *to_acpi_dev(struct acpi_nfit_desc *acpi_desc)
> return to_acpi_device(acpi_desc->dev);
> }
>
> -static int xlat_status(void *buf, unsigned int cmd, u32 status)
> +static int xlat_bus_status(void *buf, unsigned int cmd, u32 status)
> {
> struct nd_cmd_clear_error *clear_err;
> struct nd_cmd_ars_status *ars_status;
> @@ -175,6 +175,15 @@ static int xlat_status(void *buf, unsigned int cmd, u32 status)
> return 0;
> }
>
> +static int xlat_status(struct nvdimm *nvdimm, void *buf, unsigned int cmd,
> + u32 status)
> +{
> + if (!nvdimm)
> + return xlat_bus_status(buf, cmd, status);
> + if (status)
> + return -EIO;

Here comes a 0day report:

drivers/acpi/nfit/core.c:185:1: warning: control reaches end of
non-void function [-Wreturn-type]

...fixed up the patch to add a return 0;

\
 
 \ /
  Last update: 2016-12-07 02:46    [W:0.055 / U:0.316 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site