From patchwork Tue Sep 13 05:47:41 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Michael Neuling X-Patchwork-Id: 9328391 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 2C80E60231 for ; Tue, 13 Sep 2016 05:48:54 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1D66C29111 for ; Tue, 13 Sep 2016 05:48:54 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 11EB729114; Tue, 13 Sep 2016 05:48:54 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4BB4229111 for ; Tue, 13 Sep 2016 05:48:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751198AbcIMFsw (ORCPT ); Tue, 13 Sep 2016 01:48:52 -0400 Received: from ozlabs.org ([103.22.144.67]:48397 "EHLO ozlabs.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751135AbcIMFsw (ORCPT ); Tue, 13 Sep 2016 01:48:52 -0400 Received: from localhost.localdomain (localhost [127.0.0.1]) by ozlabs.org (Postfix) with ESMTP id 3sYDJ238XLz9sXx; Tue, 13 Sep 2016 15:48:50 +1000 (AEST) Received: by localhost.localdomain (Postfix, from userid 1000) id 5E531EED4F5; Tue, 13 Sep 2016 15:48:50 +1000 (AEST) From: Michael Neuling To: Guenter Roeck Cc: =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= , linux-hwmon@vger.kernel.org, Andrew Jeffery , me@neuling.org Subject: [PATCH] hwmon: (ibmpowernv) Fix label for cores numbers not threads Date: Tue, 13 Sep 2016 15:47:41 +1000 Message-Id: <1473745661-11890-1-git-send-email-mikey@neuling.org> X-Mailer: git-send-email 2.7.4 Sender: linux-hwmon-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-hwmon@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Currently the label says "Core" but lists the thread numbers. This ends up looking like this: # cat /sys/class/hwmon/hwmon0/temp[1-4]_label Core 0-7 Core 8-15 Core 16-23 Core 24-31 This is misleading as it looks like it's cores 0-7 when it's actually threads 0-7. This changes the print to just give the core number, so the output now looks like this: # cat /sys/class/hwmon/hwmon0/temp[1-4]_label Core 0 Core 8 Core 16 Core 24 Signed-off-by: Michael Neuling Acked-by: Cédric Le Goater --- drivers/hwmon/ibmpowernv.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/drivers/hwmon/ibmpowernv.c b/drivers/hwmon/ibmpowernv.c index 55b5a8ff1c..6d2e660575 100644 --- a/drivers/hwmon/ibmpowernv.c +++ b/drivers/hwmon/ibmpowernv.c @@ -143,13 +143,11 @@ static void __init make_sensor_label(struct device_node *np, if (cpuid >= 0) /* * The digital thermal sensors are associated - * with a core. Let's print out the range of - * cpu ids corresponding to the hardware - * threads of the core. + * with a core. */ n += snprintf(sdata->label + n, - sizeof(sdata->label) - n, " %d-%d", - cpuid, cpuid + threads_per_core - 1); + sizeof(sdata->label) - n, " %d", + cpuid); else n += snprintf(sdata->label + n, sizeof(sdata->label) - n, " phy%d", id);