From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753007AbdA3MEu (ORCPT ); Mon, 30 Jan 2017 07:04:50 -0500 Received: from mx02-sz.bfs.de ([194.94.69.103]:9268 "EHLO mx02-sz.bfs.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753103AbdA3MEr (ORCPT ); Mon, 30 Jan 2017 07:04:47 -0500 X-Greylist: delayed 344 seconds by postgrey-1.27 at vger.kernel.org; Mon, 30 Jan 2017 07:04:46 EST Message-ID: <588F2A7F.8020501@bfs.de> Date: Mon, 30 Jan 2017 12:58:55 +0100 From: walter harms Reply-To: wharms@bfs.de User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; de; rv:1.9.1.16) Gecko/20101125 SUSE/3.0.11 Thunderbird/3.0.11 MIME-Version: 1.0 To: Colin King CC: "Rafael J . Wysocki" , Len Brown , Dan Williams , Vishal Verma , joeyli.kernel@gmail.com, Toshi Kani , linux-acpi@vger.kernel.org, kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] acpi: nfit: use %u format string specifier for unsigned ints References: <20170130112502.24426-1-colin.king@canonical.com> In-Reply-To: <20170130112502.24426-1-colin.king@canonical.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Am 30.01.2017 12:25, schrieb Colin King: > From: Colin Ian King > > 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. > > Signed-off-by: Colin Ian King > --- > drivers/acpi/nfit/core.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/drivers/acpi/nfit/core.c b/drivers/acpi/nfit/core.c > index 2f82b8e..093b768 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,7 +967,7 @@ 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, > + rc = sprintf(buf, "%u%s", acpi_desc->scrub_count, > (work_busy(&acpi_desc->work)) ? "+\n" : "\n"); > } > device_unlock(dev); looks ok, would it be an option to move the "\n" into the format string ? this is much more common (see sprintf() above). re, wh