Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1569689
| Path | csiph.com!news.redatomik.org!aioe.org!bofh.it!news.nic.it!robomod |
|---|---|
| From | Colin King <colin.king@canonical.com> |
| Newsgroups | linux.kernel |
| Subject | [PATCH][V2] acpi: nfit: use %u format string specifier for unsigned ints |
| Date | Mon, 30 Jan 2017 13:20:02 +0100 |
| Message-ID | <t5j6a-3SD-7@gated-at.bofh.it> (permalink) |
| X-Original-To | "Rafael J . Wysocki" <rjw@rjwysocki.net>, Len Brown <lenb@kernel.org>, Dan Williams <dan.j.williams@intel.com>, Vishal Verma <vishal.l.verma@intel.com>, joeyli.kernel@gmail.com, Toshi Kani <toshi.kani@hpe.com>, linux-acpi@vger.kernel.org |
| X-Mailer | git-send-email 2.10.2 |
| MIME-Version | 1.0 |
| Content-Type | text/plain; charset="utf-8" |
| Content-Transfer-Encoding | 8bit |
| Sender | robomod@news.nic.it |
| List-ID | <linux-kernel.vger.kernel.org> |
| X-Mailing-List | linux-kernel@vger.kernel.org |
| Approved | robomod@news.nic.it |
| Lines | 38 |
| Organization | linux.* mail to news gateway |
| X-Original-Cc | kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org |
| X-Original-Date | Mon, 30 Jan 2017 12:08:08 +0000 |
| X-Original-Message-ID | <20170130120808.27691-1-colin.king@canonical.com> |
| X-Original-Sender | linux-kernel-owner@vger.kernel.org |
| Xref | csiph.com linux.kernel:1569689 |
Show key headers only | View raw
From: Colin Ian King <colin.king@canonical.com>
scrub_mode and scrub_count are both unsigned ints, however, the %d
format string specifier is being used instead of %u. Trivial fix,
use %u. Also move the \n into the format string rather in both
literal strings.
Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
drivers/acpi/nfit/core.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/acpi/nfit/core.c b/drivers/acpi/nfit/core.c
index 2f82b8e..5193b03 100644
--- a/drivers/acpi/nfit/core.c
+++ b/drivers/acpi/nfit/core.c
@@ -906,7 +906,7 @@ static ssize_t hw_error_scrub_show(struct device *dev,
struct nvdimm_bus_descriptor *nd_desc = to_nd_desc(nvdimm_bus);
struct acpi_nfit_desc *acpi_desc = to_acpi_desc(nd_desc);
- return sprintf(buf, "%d\n", acpi_desc->scrub_mode);
+ return sprintf(buf, "%u\n", acpi_desc->scrub_mode);
}
/*
@@ -967,8 +967,8 @@ static ssize_t scrub_show(struct device *dev,
if (nd_desc) {
struct acpi_nfit_desc *acpi_desc = to_acpi_desc(nd_desc);
- rc = sprintf(buf, "%d%s", acpi_desc->scrub_count,
- (work_busy(&acpi_desc->work)) ? "+\n" : "\n");
+ rc = sprintf(buf, "%u%s\n", acpi_desc->scrub_count,
+ (work_busy(&acpi_desc->work)) ? "+" : "");
}
device_unlock(dev);
return rc;
--
2.10.2
Back to linux.kernel | Previous | Next | Find similar | Unroll thread
[PATCH][V2] acpi: nfit: use %u format string specifier for unsigned ints Colin King <colin.king@canonical.com> - 2017-01-30 13:20 +0100
csiph-web