| .. | .. |
|---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-or-later |
|---|
| 1 | 2 | /* |
|---|
| 2 | 3 | * IBM PowerNV platform sensors for temperature/fan/voltage/power |
|---|
| 3 | 4 | * Copyright (C) 2014 IBM |
|---|
| 4 | | - * |
|---|
| 5 | | - * This program is free software; you can redistribute it and/or modify |
|---|
| 6 | | - * it under the terms of the GNU General Public License as published by |
|---|
| 7 | | - * the Free Software Foundation; either version 2 of the License, or |
|---|
| 8 | | - * (at your option) any later version. |
|---|
| 9 | | - * |
|---|
| 10 | | - * This program is distributed in the hope that it will be useful, |
|---|
| 11 | | - * but WITHOUT ANY WARRANTY; without even the implied warranty of |
|---|
| 12 | | - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|---|
| 13 | | - * GNU General Public License for more details. |
|---|
| 14 | | - * |
|---|
| 15 | | - * You should have received a copy of the GNU General Public License |
|---|
| 16 | | - * along with this program. |
|---|
| 17 | 5 | */ |
|---|
| 18 | 6 | |
|---|
| 19 | 7 | #define DRVNAME "ibmpowernv" |
|---|
| .. | .. |
|---|
| 198 | 186 | u32 id; |
|---|
| 199 | 187 | size_t n; |
|---|
| 200 | 188 | |
|---|
| 201 | | - n = snprintf(sdata->label, sizeof(sdata->label), "%s", label); |
|---|
| 189 | + n = scnprintf(sdata->label, sizeof(sdata->label), "%s", label); |
|---|
| 202 | 190 | |
|---|
| 203 | 191 | /* |
|---|
| 204 | 192 | * Core temp pretty print |
|---|
| .. | .. |
|---|
| 211 | 199 | * The digital thermal sensors are associated |
|---|
| 212 | 200 | * with a core. |
|---|
| 213 | 201 | */ |
|---|
| 214 | | - n += snprintf(sdata->label + n, |
|---|
| 202 | + n += scnprintf(sdata->label + n, |
|---|
| 215 | 203 | sizeof(sdata->label) - n, " %d", |
|---|
| 216 | 204 | cpuid); |
|---|
| 217 | 205 | else |
|---|
| 218 | | - n += snprintf(sdata->label + n, |
|---|
| 206 | + n += scnprintf(sdata->label + n, |
|---|
| 219 | 207 | sizeof(sdata->label) - n, " phy%d", id); |
|---|
| 220 | 208 | } |
|---|
| 221 | 209 | |
|---|
| .. | .. |
|---|
| 223 | 211 | * Membuffer pretty print |
|---|
| 224 | 212 | */ |
|---|
| 225 | 213 | if (!of_property_read_u32(np, "ibm,chip-id", &id)) |
|---|
| 226 | | - n += snprintf(sdata->label + n, sizeof(sdata->label) - n, |
|---|
| 214 | + n += scnprintf(sdata->label + n, sizeof(sdata->label) - n, |
|---|
| 227 | 215 | " %d", id & 0xffff); |
|---|
| 228 | 216 | } |
|---|
| 229 | 217 | |
|---|
| .. | .. |
|---|
| 457 | 445 | for_each_child_of_node(opal, np) { |
|---|
| 458 | 446 | const char *label; |
|---|
| 459 | 447 | |
|---|
| 460 | | - if (np->name == NULL) |
|---|
| 461 | | - continue; |
|---|
| 462 | | - |
|---|
| 463 | 448 | type = get_sensor_type(np); |
|---|
| 464 | 449 | if (type == MAX_SENSOR_TYPE) |
|---|
| 465 | 450 | continue; |
|---|
| .. | .. |
|---|
| 588 | 573 | const char *label; |
|---|
| 589 | 574 | enum sensors type; |
|---|
| 590 | 575 | |
|---|
| 591 | | - if (np->name == NULL) |
|---|
| 592 | | - continue; |
|---|
| 593 | | - |
|---|
| 594 | 576 | type = get_sensor_type(np); |
|---|
| 595 | 577 | if (type == MAX_SENSOR_TYPE) |
|---|
| 596 | 578 | continue; |
|---|
| .. | .. |
|---|
| 602 | 584 | if (of_property_read_u32(np, "sensor-id", &sensor_id) && |
|---|
| 603 | 585 | of_property_read_u32(np, "sensor-data", &sensor_id)) { |
|---|
| 604 | 586 | dev_info(&pdev->dev, |
|---|
| 605 | | - "'sensor-id' missing in the node '%s'\n", |
|---|
| 606 | | - np->name); |
|---|
| 587 | + "'sensor-id' missing in the node '%pOFn'\n", |
|---|
| 588 | + np); |
|---|
| 607 | 589 | continue; |
|---|
| 608 | 590 | } |
|---|
| 609 | 591 | |
|---|