From patchwork Tue Jan 21 06:44:59 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "lihuisong (C)" X-Patchwork-Id: 13945777 Received: from szxga06-in.huawei.com (szxga06-in.huawei.com [45.249.212.32]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 748361A83F4; Tue, 21 Jan 2025 06:57:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=45.249.212.32 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737442648; cv=none; b=fReSXRNXqfFy3WxNpU2GahB/wtt4xK9XQhLZOECxsNOx7g6MLq6YQQsnzHCsy+7nNSTqIjsir/4EVLEHz/6aWUHVXOZ/niPS4pGC6R+5arUvI4qYjRYBvlJJ2jMIEKFFmZ2BKBOUcZGAsIsrt+MdA626RVre3KCm8vR+aLfDqNA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737442648; c=relaxed/simple; bh=ersZ7svCfdCBBWOQ2aD9ovIVd7sskiWFwOEOCNa85Es=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=ucmYHSBFVIIaVXS0IiipCSOhiSmcfjzB050fsnkgF1PP7S8FoMpKkfPDXeBQ/fxtrX5pTs/Bek86aMmMb3PrC4OjG9yQ308Sf6yXIhdyLYCZuXmKryFMvxqtVHVJK5hmeOydziHOQ3KQ9oVi0bc4ktwilEsSVIK5uuOalee44aM= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com; spf=pass smtp.mailfrom=huawei.com; arc=none smtp.client-ip=45.249.212.32 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=huawei.com Received: from mail.maildlp.com (unknown [172.19.163.17]) by szxga06-in.huawei.com (SkyGuard) with ESMTP id 4YcdLy3R0Pz20pDJ; Tue, 21 Jan 2025 14:57:46 +0800 (CST) Received: from dggemv705-chm.china.huawei.com (unknown [10.3.19.32]) by mail.maildlp.com (Postfix) with ESMTPS id 4B2511A0188; Tue, 21 Jan 2025 14:57:21 +0800 (CST) Received: from kwepemn100009.china.huawei.com (7.202.194.112) by dggemv705-chm.china.huawei.com (10.3.19.32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.11; Tue, 21 Jan 2025 14:57:21 +0800 Received: from localhost.localdomain (10.28.79.22) by kwepemn100009.china.huawei.com (7.202.194.112) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.11; Tue, 21 Jan 2025 14:57:19 +0800 From: Huisong Li To: CC: , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , Subject: [PATCH v1 01/21] hwmon: Fix the type of 'config' in struct hwmon_channel_info to u64 Date: Tue, 21 Jan 2025 14:44:59 +0800 Message-ID: <20250121064519.18974-2-lihuisong@huawei.com> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20250121064519.18974-1-lihuisong@huawei.com> References: <20250121064519.18974-1-lihuisong@huawei.com> Precedence: bulk X-Mailing-List: linux-hwmon@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-ClientProxiedBy: dggems706-chm.china.huawei.com (10.3.19.183) To kwepemn100009.china.huawei.com (7.202.194.112) Currently, the maximum number of hwmon channel attributes is 32 which is limited by current hwmon core codes. And the power attributes are up to 31. It's already encountered the issue of not adding attribute name to power channel attribute. So fix the type of 'config' in struct hwmon_channel_info to u64 so as to support more attributes. For this goal, the following points are needed to be done: (1) Fix the type of 'config' in hwmon_channel_info structure to u64. (2) Modify hwmon_num_channel_attrs() with hweight64. (3) Type of BIT(xxx) in linux/hwmon.h is 'UL', need to modify to BIT_ULL. Signed-off-by: Huisong Li --- drivers/hwmon/hwmon.c | 4 +- include/linux/hwmon.h | 300 +++++++++++++++++++++--------------------- 2 files changed, 152 insertions(+), 152 deletions(-) diff --git a/drivers/hwmon/hwmon.c b/drivers/hwmon/hwmon.c index 9703d60e9bbf..1fe8fa12cc60 100644 --- a/drivers/hwmon/hwmon.c +++ b/drivers/hwmon/hwmon.c @@ -790,7 +790,7 @@ static int hwmon_num_channel_attrs(const struct hwmon_channel_info *info) int i, n; for (i = n = 0; info->config[i]; i++) - n += hweight32(info->config[i]); + n += hweight64(info->config[i]); return n; } @@ -811,7 +811,7 @@ static int hwmon_genattrs(const void *drvdata, template_size = __templates_size[info->type]; for (i = 0; info->config[i]; i++) { - u32 attr_mask = info->config[i]; + u64 attr_mask = info->config[i]; u32 attr; while (attr_mask) { diff --git a/include/linux/hwmon.h b/include/linux/hwmon.h index 3a63dff62d03..544266a58d07 100644 --- a/include/linux/hwmon.h +++ b/include/linux/hwmon.h @@ -48,20 +48,20 @@ enum hwmon_chip_attributes { hwmon_chip_pec, }; -#define HWMON_C_TEMP_RESET_HISTORY BIT(hwmon_chip_temp_reset_history) -#define HWMON_C_IN_RESET_HISTORY BIT(hwmon_chip_in_reset_history) -#define HWMON_C_CURR_RESET_HISTORY BIT(hwmon_chip_curr_reset_history) -#define HWMON_C_POWER_RESET_HISTORY BIT(hwmon_chip_power_reset_history) -#define HWMON_C_REGISTER_TZ BIT(hwmon_chip_register_tz) -#define HWMON_C_UPDATE_INTERVAL BIT(hwmon_chip_update_interval) -#define HWMON_C_ALARMS BIT(hwmon_chip_alarms) -#define HWMON_C_SAMPLES BIT(hwmon_chip_samples) -#define HWMON_C_CURR_SAMPLES BIT(hwmon_chip_curr_samples) -#define HWMON_C_IN_SAMPLES BIT(hwmon_chip_in_samples) -#define HWMON_C_POWER_SAMPLES BIT(hwmon_chip_power_samples) -#define HWMON_C_TEMP_SAMPLES BIT(hwmon_chip_temp_samples) -#define HWMON_C_BEEP_ENABLE BIT(hwmon_chip_beep_enable) -#define HWMON_C_PEC BIT(hwmon_chip_pec) +#define HWMON_C_TEMP_RESET_HISTORY BIT_ULL(hwmon_chip_temp_reset_history) +#define HWMON_C_IN_RESET_HISTORY BIT_ULL(hwmon_chip_in_reset_history) +#define HWMON_C_CURR_RESET_HISTORY BIT_ULL(hwmon_chip_curr_reset_history) +#define HWMON_C_POWER_RESET_HISTORY BIT_ULL(hwmon_chip_power_reset_history) +#define HWMON_C_REGISTER_TZ BIT_ULL(hwmon_chip_register_tz) +#define HWMON_C_UPDATE_INTERVAL BIT_ULL(hwmon_chip_update_interval) +#define HWMON_C_ALARMS BIT_ULL(hwmon_chip_alarms) +#define HWMON_C_SAMPLES BIT_ULL(hwmon_chip_samples) +#define HWMON_C_CURR_SAMPLES BIT_ULL(hwmon_chip_curr_samples) +#define HWMON_C_IN_SAMPLES BIT_ULL(hwmon_chip_in_samples) +#define HWMON_C_POWER_SAMPLES BIT_ULL(hwmon_chip_power_samples) +#define HWMON_C_TEMP_SAMPLES BIT_ULL(hwmon_chip_temp_samples) +#define HWMON_C_BEEP_ENABLE BIT_ULL(hwmon_chip_beep_enable) +#define HWMON_C_PEC BIT_ULL(hwmon_chip_pec) enum hwmon_temp_attributes { hwmon_temp_enable, @@ -94,34 +94,34 @@ enum hwmon_temp_attributes { hwmon_temp_beep, }; -#define HWMON_T_ENABLE BIT(hwmon_temp_enable) -#define HWMON_T_INPUT BIT(hwmon_temp_input) -#define HWMON_T_TYPE BIT(hwmon_temp_type) -#define HWMON_T_LCRIT BIT(hwmon_temp_lcrit) -#define HWMON_T_LCRIT_HYST BIT(hwmon_temp_lcrit_hyst) -#define HWMON_T_MIN BIT(hwmon_temp_min) -#define HWMON_T_MIN_HYST BIT(hwmon_temp_min_hyst) -#define HWMON_T_MAX BIT(hwmon_temp_max) -#define HWMON_T_MAX_HYST BIT(hwmon_temp_max_hyst) -#define HWMON_T_CRIT BIT(hwmon_temp_crit) -#define HWMON_T_CRIT_HYST BIT(hwmon_temp_crit_hyst) -#define HWMON_T_EMERGENCY BIT(hwmon_temp_emergency) -#define HWMON_T_EMERGENCY_HYST BIT(hwmon_temp_emergency_hyst) -#define HWMON_T_ALARM BIT(hwmon_temp_alarm) -#define HWMON_T_MIN_ALARM BIT(hwmon_temp_min_alarm) -#define HWMON_T_MAX_ALARM BIT(hwmon_temp_max_alarm) -#define HWMON_T_CRIT_ALARM BIT(hwmon_temp_crit_alarm) -#define HWMON_T_LCRIT_ALARM BIT(hwmon_temp_lcrit_alarm) -#define HWMON_T_EMERGENCY_ALARM BIT(hwmon_temp_emergency_alarm) -#define HWMON_T_FAULT BIT(hwmon_temp_fault) -#define HWMON_T_OFFSET BIT(hwmon_temp_offset) -#define HWMON_T_LABEL BIT(hwmon_temp_label) -#define HWMON_T_LOWEST BIT(hwmon_temp_lowest) -#define HWMON_T_HIGHEST BIT(hwmon_temp_highest) -#define HWMON_T_RESET_HISTORY BIT(hwmon_temp_reset_history) -#define HWMON_T_RATED_MIN BIT(hwmon_temp_rated_min) -#define HWMON_T_RATED_MAX BIT(hwmon_temp_rated_max) -#define HWMON_T_BEEP BIT(hwmon_temp_beep) +#define HWMON_T_ENABLE BIT_ULL(hwmon_temp_enable) +#define HWMON_T_INPUT BIT_ULL(hwmon_temp_input) +#define HWMON_T_TYPE BIT_ULL(hwmon_temp_type) +#define HWMON_T_LCRIT BIT_ULL(hwmon_temp_lcrit) +#define HWMON_T_LCRIT_HYST BIT_ULL(hwmon_temp_lcrit_hyst) +#define HWMON_T_MIN BIT_ULL(hwmon_temp_min) +#define HWMON_T_MIN_HYST BIT_ULL(hwmon_temp_min_hyst) +#define HWMON_T_MAX BIT_ULL(hwmon_temp_max) +#define HWMON_T_MAX_HYST BIT_ULL(hwmon_temp_max_hyst) +#define HWMON_T_CRIT BIT_ULL(hwmon_temp_crit) +#define HWMON_T_CRIT_HYST BIT_ULL(hwmon_temp_crit_hyst) +#define HWMON_T_EMERGENCY BIT_ULL(hwmon_temp_emergency) +#define HWMON_T_EMERGENCY_HYST BIT_ULL(hwmon_temp_emergency_hyst) +#define HWMON_T_ALARM BIT_ULL(hwmon_temp_alarm) +#define HWMON_T_MIN_ALARM BIT_ULL(hwmon_temp_min_alarm) +#define HWMON_T_MAX_ALARM BIT_ULL(hwmon_temp_max_alarm) +#define HWMON_T_CRIT_ALARM BIT_ULL(hwmon_temp_crit_alarm) +#define HWMON_T_LCRIT_ALARM BIT_ULL(hwmon_temp_lcrit_alarm) +#define HWMON_T_EMERGENCY_ALARM BIT_ULL(hwmon_temp_emergency_alarm) +#define HWMON_T_FAULT BIT_ULL(hwmon_temp_fault) +#define HWMON_T_OFFSET BIT_ULL(hwmon_temp_offset) +#define HWMON_T_LABEL BIT_ULL(hwmon_temp_label) +#define HWMON_T_LOWEST BIT_ULL(hwmon_temp_lowest) +#define HWMON_T_HIGHEST BIT_ULL(hwmon_temp_highest) +#define HWMON_T_RESET_HISTORY BIT_ULL(hwmon_temp_reset_history) +#define HWMON_T_RATED_MIN BIT_ULL(hwmon_temp_rated_min) +#define HWMON_T_RATED_MAX BIT_ULL(hwmon_temp_rated_max) +#define HWMON_T_BEEP BIT_ULL(hwmon_temp_beep) enum hwmon_in_attributes { hwmon_in_enable, @@ -146,26 +146,26 @@ enum hwmon_in_attributes { hwmon_in_fault, }; -#define HWMON_I_ENABLE BIT(hwmon_in_enable) -#define HWMON_I_INPUT BIT(hwmon_in_input) -#define HWMON_I_MIN BIT(hwmon_in_min) -#define HWMON_I_MAX BIT(hwmon_in_max) -#define HWMON_I_LCRIT BIT(hwmon_in_lcrit) -#define HWMON_I_CRIT BIT(hwmon_in_crit) -#define HWMON_I_AVERAGE BIT(hwmon_in_average) -#define HWMON_I_LOWEST BIT(hwmon_in_lowest) -#define HWMON_I_HIGHEST BIT(hwmon_in_highest) -#define HWMON_I_RESET_HISTORY BIT(hwmon_in_reset_history) -#define HWMON_I_LABEL BIT(hwmon_in_label) -#define HWMON_I_ALARM BIT(hwmon_in_alarm) -#define HWMON_I_MIN_ALARM BIT(hwmon_in_min_alarm) -#define HWMON_I_MAX_ALARM BIT(hwmon_in_max_alarm) -#define HWMON_I_LCRIT_ALARM BIT(hwmon_in_lcrit_alarm) -#define HWMON_I_CRIT_ALARM BIT(hwmon_in_crit_alarm) -#define HWMON_I_RATED_MIN BIT(hwmon_in_rated_min) -#define HWMON_I_RATED_MAX BIT(hwmon_in_rated_max) -#define HWMON_I_BEEP BIT(hwmon_in_beep) -#define HWMON_I_FAULT BIT(hwmon_in_fault) +#define HWMON_I_ENABLE BIT_ULL(hwmon_in_enable) +#define HWMON_I_INPUT BIT_ULL(hwmon_in_input) +#define HWMON_I_MIN BIT_ULL(hwmon_in_min) +#define HWMON_I_MAX BIT_ULL(hwmon_in_max) +#define HWMON_I_LCRIT BIT_ULL(hwmon_in_lcrit) +#define HWMON_I_CRIT BIT_ULL(hwmon_in_crit) +#define HWMON_I_AVERAGE BIT_ULL(hwmon_in_average) +#define HWMON_I_LOWEST BIT_ULL(hwmon_in_lowest) +#define HWMON_I_HIGHEST BIT_ULL(hwmon_in_highest) +#define HWMON_I_RESET_HISTORY BIT_ULL(hwmon_in_reset_history) +#define HWMON_I_LABEL BIT_ULL(hwmon_in_label) +#define HWMON_I_ALARM BIT_ULL(hwmon_in_alarm) +#define HWMON_I_MIN_ALARM BIT_ULL(hwmon_in_min_alarm) +#define HWMON_I_MAX_ALARM BIT_ULL(hwmon_in_max_alarm) +#define HWMON_I_LCRIT_ALARM BIT_ULL(hwmon_in_lcrit_alarm) +#define HWMON_I_CRIT_ALARM BIT_ULL(hwmon_in_crit_alarm) +#define HWMON_I_RATED_MIN BIT_ULL(hwmon_in_rated_min) +#define HWMON_I_RATED_MAX BIT_ULL(hwmon_in_rated_max) +#define HWMON_I_BEEP BIT_ULL(hwmon_in_beep) +#define HWMON_I_FAULT BIT_ULL(hwmon_in_fault) enum hwmon_curr_attributes { hwmon_curr_enable, @@ -189,25 +189,25 @@ enum hwmon_curr_attributes { hwmon_curr_beep, }; -#define HWMON_C_ENABLE BIT(hwmon_curr_enable) -#define HWMON_C_INPUT BIT(hwmon_curr_input) -#define HWMON_C_MIN BIT(hwmon_curr_min) -#define HWMON_C_MAX BIT(hwmon_curr_max) -#define HWMON_C_LCRIT BIT(hwmon_curr_lcrit) -#define HWMON_C_CRIT BIT(hwmon_curr_crit) -#define HWMON_C_AVERAGE BIT(hwmon_curr_average) -#define HWMON_C_LOWEST BIT(hwmon_curr_lowest) -#define HWMON_C_HIGHEST BIT(hwmon_curr_highest) -#define HWMON_C_RESET_HISTORY BIT(hwmon_curr_reset_history) -#define HWMON_C_LABEL BIT(hwmon_curr_label) -#define HWMON_C_ALARM BIT(hwmon_curr_alarm) -#define HWMON_C_MIN_ALARM BIT(hwmon_curr_min_alarm) -#define HWMON_C_MAX_ALARM BIT(hwmon_curr_max_alarm) -#define HWMON_C_LCRIT_ALARM BIT(hwmon_curr_lcrit_alarm) -#define HWMON_C_CRIT_ALARM BIT(hwmon_curr_crit_alarm) -#define HWMON_C_RATED_MIN BIT(hwmon_curr_rated_min) -#define HWMON_C_RATED_MAX BIT(hwmon_curr_rated_max) -#define HWMON_C_BEEP BIT(hwmon_curr_beep) +#define HWMON_C_ENABLE BIT_ULL(hwmon_curr_enable) +#define HWMON_C_INPUT BIT_ULL(hwmon_curr_input) +#define HWMON_C_MIN BIT_ULL(hwmon_curr_min) +#define HWMON_C_MAX BIT_ULL(hwmon_curr_max) +#define HWMON_C_LCRIT BIT_ULL(hwmon_curr_lcrit) +#define HWMON_C_CRIT BIT_ULL(hwmon_curr_crit) +#define HWMON_C_AVERAGE BIT_ULL(hwmon_curr_average) +#define HWMON_C_LOWEST BIT_ULL(hwmon_curr_lowest) +#define HWMON_C_HIGHEST BIT_ULL(hwmon_curr_highest) +#define HWMON_C_RESET_HISTORY BIT_ULL(hwmon_curr_reset_history) +#define HWMON_C_LABEL BIT_ULL(hwmon_curr_label) +#define HWMON_C_ALARM BIT_ULL(hwmon_curr_alarm) +#define HWMON_C_MIN_ALARM BIT_ULL(hwmon_curr_min_alarm) +#define HWMON_C_MAX_ALARM BIT_ULL(hwmon_curr_max_alarm) +#define HWMON_C_LCRIT_ALARM BIT_ULL(hwmon_curr_lcrit_alarm) +#define HWMON_C_CRIT_ALARM BIT_ULL(hwmon_curr_crit_alarm) +#define HWMON_C_RATED_MIN BIT_ULL(hwmon_curr_rated_min) +#define HWMON_C_RATED_MAX BIT_ULL(hwmon_curr_rated_max) +#define HWMON_C_BEEP BIT_ULL(hwmon_curr_beep) enum hwmon_power_attributes { hwmon_power_enable, @@ -243,37 +243,37 @@ enum hwmon_power_attributes { hwmon_power_rated_max, }; -#define HWMON_P_ENABLE BIT(hwmon_power_enable) -#define HWMON_P_AVERAGE BIT(hwmon_power_average) -#define HWMON_P_AVERAGE_INTERVAL BIT(hwmon_power_average_interval) -#define HWMON_P_AVERAGE_INTERVAL_MAX BIT(hwmon_power_average_interval_max) -#define HWMON_P_AVERAGE_INTERVAL_MIN BIT(hwmon_power_average_interval_min) -#define HWMON_P_AVERAGE_HIGHEST BIT(hwmon_power_average_highest) -#define HWMON_P_AVERAGE_LOWEST BIT(hwmon_power_average_lowest) -#define HWMON_P_AVERAGE_MAX BIT(hwmon_power_average_max) -#define HWMON_P_AVERAGE_MIN BIT(hwmon_power_average_min) -#define HWMON_P_INPUT BIT(hwmon_power_input) -#define HWMON_P_INPUT_HIGHEST BIT(hwmon_power_input_highest) -#define HWMON_P_INPUT_LOWEST BIT(hwmon_power_input_lowest) -#define HWMON_P_RESET_HISTORY BIT(hwmon_power_reset_history) -#define HWMON_P_ACCURACY BIT(hwmon_power_accuracy) -#define HWMON_P_CAP BIT(hwmon_power_cap) -#define HWMON_P_CAP_HYST BIT(hwmon_power_cap_hyst) -#define HWMON_P_CAP_MAX BIT(hwmon_power_cap_max) -#define HWMON_P_CAP_MIN BIT(hwmon_power_cap_min) -#define HWMON_P_MIN BIT(hwmon_power_min) -#define HWMON_P_MAX BIT(hwmon_power_max) -#define HWMON_P_LCRIT BIT(hwmon_power_lcrit) -#define HWMON_P_CRIT BIT(hwmon_power_crit) -#define HWMON_P_LABEL BIT(hwmon_power_label) -#define HWMON_P_ALARM BIT(hwmon_power_alarm) -#define HWMON_P_CAP_ALARM BIT(hwmon_power_cap_alarm) -#define HWMON_P_MIN_ALARM BIT(hwmon_power_min_alarm) -#define HWMON_P_MAX_ALARM BIT(hwmon_power_max_alarm) -#define HWMON_P_LCRIT_ALARM BIT(hwmon_power_lcrit_alarm) -#define HWMON_P_CRIT_ALARM BIT(hwmon_power_crit_alarm) -#define HWMON_P_RATED_MIN BIT(hwmon_power_rated_min) -#define HWMON_P_RATED_MAX BIT(hwmon_power_rated_max) +#define HWMON_P_ENABLE BIT_ULL(hwmon_power_enable) +#define HWMON_P_AVERAGE BIT_ULL(hwmon_power_average) +#define HWMON_P_AVERAGE_INTERVAL BIT_ULL(hwmon_power_average_interval) +#define HWMON_P_AVERAGE_INTERVAL_MAX BIT_ULL(hwmon_power_average_interval_max) +#define HWMON_P_AVERAGE_INTERVAL_MIN BIT_ULL(hwmon_power_average_interval_min) +#define HWMON_P_AVERAGE_HIGHEST BIT_ULL(hwmon_power_average_highest) +#define HWMON_P_AVERAGE_LOWEST BIT_ULL(hwmon_power_average_lowest) +#define HWMON_P_AVERAGE_MAX BIT_ULL(hwmon_power_average_max) +#define HWMON_P_AVERAGE_MIN BIT_ULL(hwmon_power_average_min) +#define HWMON_P_INPUT BIT_ULL(hwmon_power_input) +#define HWMON_P_INPUT_HIGHEST BIT_ULL(hwmon_power_input_highest) +#define HWMON_P_INPUT_LOWEST BIT_ULL(hwmon_power_input_lowest) +#define HWMON_P_RESET_HISTORY BIT_ULL(hwmon_power_reset_history) +#define HWMON_P_ACCURACY BIT_ULL(hwmon_power_accuracy) +#define HWMON_P_CAP BIT_ULL(hwmon_power_cap) +#define HWMON_P_CAP_HYST BIT_ULL(hwmon_power_cap_hyst) +#define HWMON_P_CAP_MAX BIT_ULL(hwmon_power_cap_max) +#define HWMON_P_CAP_MIN BIT_ULL(hwmon_power_cap_min) +#define HWMON_P_MIN BIT_ULL(hwmon_power_min) +#define HWMON_P_MAX BIT_ULL(hwmon_power_max) +#define HWMON_P_LCRIT BIT_ULL(hwmon_power_lcrit) +#define HWMON_P_CRIT BIT_ULL(hwmon_power_crit) +#define HWMON_P_LABEL BIT_ULL(hwmon_power_label) +#define HWMON_P_ALARM BIT_ULL(hwmon_power_alarm) +#define HWMON_P_CAP_ALARM BIT_ULL(hwmon_power_cap_alarm) +#define HWMON_P_MIN_ALARM BIT_ULL(hwmon_power_min_alarm) +#define HWMON_P_MAX_ALARM BIT_ULL(hwmon_power_max_alarm) +#define HWMON_P_LCRIT_ALARM BIT_ULL(hwmon_power_lcrit_alarm) +#define HWMON_P_CRIT_ALARM BIT_ULL(hwmon_power_crit_alarm) +#define HWMON_P_RATED_MIN BIT_ULL(hwmon_power_rated_min) +#define HWMON_P_RATED_MAX BIT_ULL(hwmon_power_rated_max) enum hwmon_energy_attributes { hwmon_energy_enable, @@ -281,9 +281,9 @@ enum hwmon_energy_attributes { hwmon_energy_label, }; -#define HWMON_E_ENABLE BIT(hwmon_energy_enable) -#define HWMON_E_INPUT BIT(hwmon_energy_input) -#define HWMON_E_LABEL BIT(hwmon_energy_label) +#define HWMON_E_ENABLE BIT_ULL(hwmon_energy_enable) +#define HWMON_E_INPUT BIT_ULL(hwmon_energy_input) +#define HWMON_E_LABEL BIT_ULL(hwmon_energy_label) enum hwmon_humidity_attributes { hwmon_humidity_enable, @@ -301,19 +301,19 @@ enum hwmon_humidity_attributes { hwmon_humidity_max_alarm, }; -#define HWMON_H_ENABLE BIT(hwmon_humidity_enable) -#define HWMON_H_INPUT BIT(hwmon_humidity_input) -#define HWMON_H_LABEL BIT(hwmon_humidity_label) -#define HWMON_H_MIN BIT(hwmon_humidity_min) -#define HWMON_H_MIN_HYST BIT(hwmon_humidity_min_hyst) -#define HWMON_H_MAX BIT(hwmon_humidity_max) -#define HWMON_H_MAX_HYST BIT(hwmon_humidity_max_hyst) -#define HWMON_H_ALARM BIT(hwmon_humidity_alarm) -#define HWMON_H_FAULT BIT(hwmon_humidity_fault) -#define HWMON_H_RATED_MIN BIT(hwmon_humidity_rated_min) -#define HWMON_H_RATED_MAX BIT(hwmon_humidity_rated_max) -#define HWMON_H_MIN_ALARM BIT(hwmon_humidity_min_alarm) -#define HWMON_H_MAX_ALARM BIT(hwmon_humidity_max_alarm) +#define HWMON_H_ENABLE BIT_ULL(hwmon_humidity_enable) +#define HWMON_H_INPUT BIT_ULL(hwmon_humidity_input) +#define HWMON_H_LABEL BIT_ULL(hwmon_humidity_label) +#define HWMON_H_MIN BIT_ULL(hwmon_humidity_min) +#define HWMON_H_MIN_HYST BIT_ULL(hwmon_humidity_min_hyst) +#define HWMON_H_MAX BIT_ULL(hwmon_humidity_max) +#define HWMON_H_MAX_HYST BIT_ULL(hwmon_humidity_max_hyst) +#define HWMON_H_ALARM BIT_ULL(hwmon_humidity_alarm) +#define HWMON_H_FAULT BIT_ULL(hwmon_humidity_fault) +#define HWMON_H_RATED_MIN BIT_ULL(hwmon_humidity_rated_min) +#define HWMON_H_RATED_MAX BIT_ULL(hwmon_humidity_rated_max) +#define HWMON_H_MIN_ALARM BIT_ULL(hwmon_humidity_min_alarm) +#define HWMON_H_MAX_ALARM BIT_ULL(hwmon_humidity_max_alarm) enum hwmon_fan_attributes { hwmon_fan_enable, @@ -331,19 +331,19 @@ enum hwmon_fan_attributes { hwmon_fan_beep, }; -#define HWMON_F_ENABLE BIT(hwmon_fan_enable) -#define HWMON_F_INPUT BIT(hwmon_fan_input) -#define HWMON_F_LABEL BIT(hwmon_fan_label) -#define HWMON_F_MIN BIT(hwmon_fan_min) -#define HWMON_F_MAX BIT(hwmon_fan_max) -#define HWMON_F_DIV BIT(hwmon_fan_div) -#define HWMON_F_PULSES BIT(hwmon_fan_pulses) -#define HWMON_F_TARGET BIT(hwmon_fan_target) -#define HWMON_F_ALARM BIT(hwmon_fan_alarm) -#define HWMON_F_MIN_ALARM BIT(hwmon_fan_min_alarm) -#define HWMON_F_MAX_ALARM BIT(hwmon_fan_max_alarm) -#define HWMON_F_FAULT BIT(hwmon_fan_fault) -#define HWMON_F_BEEP BIT(hwmon_fan_beep) +#define HWMON_F_ENABLE BIT_ULL(hwmon_fan_enable) +#define HWMON_F_INPUT BIT_ULL(hwmon_fan_input) +#define HWMON_F_LABEL BIT_ULL(hwmon_fan_label) +#define HWMON_F_MIN BIT_ULL(hwmon_fan_min) +#define HWMON_F_MAX BIT_ULL(hwmon_fan_max) +#define HWMON_F_DIV BIT_ULL(hwmon_fan_div) +#define HWMON_F_PULSES BIT_ULL(hwmon_fan_pulses) +#define HWMON_F_TARGET BIT_ULL(hwmon_fan_target) +#define HWMON_F_ALARM BIT_ULL(hwmon_fan_alarm) +#define HWMON_F_MIN_ALARM BIT_ULL(hwmon_fan_min_alarm) +#define HWMON_F_MAX_ALARM BIT_ULL(hwmon_fan_max_alarm) +#define HWMON_F_FAULT BIT_ULL(hwmon_fan_fault) +#define HWMON_F_BEEP BIT_ULL(hwmon_fan_beep) enum hwmon_pwm_attributes { hwmon_pwm_input, @@ -353,18 +353,18 @@ enum hwmon_pwm_attributes { hwmon_pwm_auto_channels_temp, }; -#define HWMON_PWM_INPUT BIT(hwmon_pwm_input) -#define HWMON_PWM_ENABLE BIT(hwmon_pwm_enable) -#define HWMON_PWM_MODE BIT(hwmon_pwm_mode) -#define HWMON_PWM_FREQ BIT(hwmon_pwm_freq) -#define HWMON_PWM_AUTO_CHANNELS_TEMP BIT(hwmon_pwm_auto_channels_temp) +#define HWMON_PWM_INPUT BIT_ULL(hwmon_pwm_input) +#define HWMON_PWM_ENABLE BIT_ULL(hwmon_pwm_enable) +#define HWMON_PWM_MODE BIT_ULL(hwmon_pwm_mode) +#define HWMON_PWM_FREQ BIT_ULL(hwmon_pwm_freq) +#define HWMON_PWM_AUTO_CHANNELS_TEMP BIT_ULL(hwmon_pwm_auto_channels_temp) enum hwmon_intrusion_attributes { hwmon_intrusion_alarm, hwmon_intrusion_beep, }; -#define HWMON_INTRUSION_ALARM BIT(hwmon_intrusion_alarm) -#define HWMON_INTRUSION_BEEP BIT(hwmon_intrusion_beep) +#define HWMON_INTRUSION_ALARM BIT_ULL(hwmon_intrusion_alarm) +#define HWMON_INTRUSION_BEEP BIT_ULL(hwmon_intrusion_beep) /** * struct hwmon_ops - hwmon device operations @@ -433,13 +433,13 @@ struct hwmon_ops { */ struct hwmon_channel_info { enum hwmon_sensor_types type; - const u32 *config; + const u64 *config; }; #define HWMON_CHANNEL_INFO(stype, ...) \ (&(const struct hwmon_channel_info) { \ .type = hwmon_##stype, \ - .config = (const u32 []) { \ + .config = (const u64 []) { \ __VA_ARGS__, 0 \ } \ }) From patchwork Tue Jan 21 06:45:00 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "lihuisong (C)" X-Patchwork-Id: 13945779 Received: from szxga01-in.huawei.com (szxga01-in.huawei.com [45.249.212.187]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B11061B372C; Tue, 21 Jan 2025 06:57:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=45.249.212.187 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737442652; cv=none; b=M796uJZ4sc74pD7/pJr442D3VzeAzAFE0GmwtuDFYlVQDT1PzWrK8n/kraESDYvnNlSNA1m4M3EVrFQciqZF+k5zWWwowwM11rrF1ZyFa7+OhFZdkxwQimcHn7NW0Jv9WzO9pK5AV5ooazvGHuY1sQKoyQfQ9stPUOaiX2k1nrc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737442652; c=relaxed/simple; bh=PKFWxvHFx9wxQ8urCnfMAZp5c1gBL8z/TIwH0zZIVCs=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=pnbnqHdY+oV71j+cAaRxR4dRG4ooW5KMHFYSU7+Fjev5PXjzc9cXmHFX2hYPVO/83r3hLw3BnC1r4DhtIgPtuRljUl5YTDtGRiBKM62gs3RS0XjVsOcxSPwozH+pPtttpmvrnDaC2NgmIkLO/qJ2BE3tCG713HNHijHdTt1ps8Q= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com; spf=pass smtp.mailfrom=huawei.com; arc=none smtp.client-ip=45.249.212.187 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=huawei.com Received: from mail.maildlp.com (unknown [172.19.162.254]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4YcdGt0X8Czbp8L; Tue, 21 Jan 2025 14:54:14 +0800 (CST) Received: from dggemv706-chm.china.huawei.com (unknown [10.3.19.33]) by mail.maildlp.com (Postfix) with ESMTPS id B7C3D180105; Tue, 21 Jan 2025 14:57:22 +0800 (CST) Received: from kwepemn100009.china.huawei.com (7.202.194.112) by dggemv706-chm.china.huawei.com (10.3.19.33) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.11; Tue, 21 Jan 2025 14:57:22 +0800 Received: from localhost.localdomain (10.28.79.22) by kwepemn100009.china.huawei.com (7.202.194.112) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.11; Tue, 21 Jan 2025 14:57:20 +0800 From: Huisong Li To: CC: , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , Subject: [PATCH v1 02/21] media: video-i2c: Use HWMON_CHANNEL_INFO macro to simplify code Date: Tue, 21 Jan 2025 14:45:00 +0800 Message-ID: <20250121064519.18974-3-lihuisong@huawei.com> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20250121064519.18974-1-lihuisong@huawei.com> References: <20250121064519.18974-1-lihuisong@huawei.com> Precedence: bulk X-Mailing-List: linux-hwmon@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-ClientProxiedBy: dggems706-chm.china.huawei.com (10.3.19.183) To kwepemn100009.china.huawei.com (7.202.194.112) Use HWMON_CHANNEL_INFO macro to simplify code. Signed-off-by: Huisong Li --- drivers/media/i2c/video-i2c.c | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/drivers/media/i2c/video-i2c.c b/drivers/media/i2c/video-i2c.c index 036a6375627a..0dd991d70d53 100644 --- a/drivers/media/i2c/video-i2c.c +++ b/drivers/media/i2c/video-i2c.c @@ -264,18 +264,8 @@ static int amg88xx_set_power(struct video_i2c_data *data, bool on) #if IS_REACHABLE(CONFIG_HWMON) -static const u32 amg88xx_temp_config[] = { - HWMON_T_INPUT, - 0 -}; - -static const struct hwmon_channel_info amg88xx_temp = { - .type = hwmon_temp, - .config = amg88xx_temp_config, -}; - static const struct hwmon_channel_info * const amg88xx_info[] = { - &amg88xx_temp, + HWMON_CHANNEL_INFO(temp, HWMON_T_INPUT), NULL }; From patchwork Tue Jan 21 06:45:01 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "lihuisong (C)" X-Patchwork-Id: 13945784 Received: from szxga04-in.huawei.com (szxga04-in.huawei.com [45.249.212.190]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id AE8D91B041B; Tue, 21 Jan 2025 06:57:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=45.249.212.190 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737442658; cv=none; b=g2PWY6pP6AU5b8XF/UZ6no6M08VKgbA+JTXNrUAU6WWPX8a6epP3bUA41xN5Rx09z0/Ro/p3juM2rdCyS+humBdF+PIW2zyv1rlgfSsenuGlwoS6tmhiKDXU4vQuY6dKJe5KT2Anm68IXU1L7hvSscuuAsrSRkOGhtlsOXN8ppY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737442658; c=relaxed/simple; bh=MHb9TyuXgUHeuarU9Yir/7RmkDw32ubVkuACnX19mig=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=j5XtzGt88s/a4zQj/JjShdMXVvYX0f+4TwtpfreSKhYptTwJcfsYPdyzyQ1cm3x93AMlb95SG3t16I78wdZ5SeI+WcS+UYH6ZH946woipur59SFQvxqVLCe6B6MbQdKnUKNkwaHdE18bl0BQVcuQEvg2PAnGbRrjHsUnKuB0zd8= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com; spf=pass smtp.mailfrom=huawei.com; arc=none smtp.client-ip=45.249.212.190 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=huawei.com Received: from mail.maildlp.com (unknown [172.19.162.112]) by szxga04-in.huawei.com (SkyGuard) with ESMTP id 4YcdHq4py9z22lgZ; Tue, 21 Jan 2025 14:55:03 +0800 (CST) Received: from dggemv712-chm.china.huawei.com (unknown [10.1.198.32]) by mail.maildlp.com (Postfix) with ESMTPS id 956551402C3; Tue, 21 Jan 2025 14:57:32 +0800 (CST) Received: from kwepemn100009.china.huawei.com (7.202.194.112) by dggemv712-chm.china.huawei.com (10.1.198.32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.11; Tue, 21 Jan 2025 14:57:32 +0800 Received: from localhost.localdomain (10.28.79.22) by kwepemn100009.china.huawei.com (7.202.194.112) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.11; Tue, 21 Jan 2025 14:57:22 +0800 From: Huisong Li To: CC: , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , Subject: [PATCH v1 03/21] net: aquantia: Use HWMON_CHANNEL_INFO macro to simplify code Date: Tue, 21 Jan 2025 14:45:01 +0800 Message-ID: <20250121064519.18974-4-lihuisong@huawei.com> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20250121064519.18974-1-lihuisong@huawei.com> References: <20250121064519.18974-1-lihuisong@huawei.com> Precedence: bulk X-Mailing-List: linux-hwmon@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-ClientProxiedBy: dggems706-chm.china.huawei.com (10.3.19.183) To kwepemn100009.china.huawei.com (7.202.194.112) Use HWMON_CHANNEL_INFO macro to simplify code. Signed-off-by: Huisong Li --- .../net/ethernet/aquantia/atlantic/aq_drvinfo.c | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/drivers/net/ethernet/aquantia/atlantic/aq_drvinfo.c b/drivers/net/ethernet/aquantia/atlantic/aq_drvinfo.c index 414b2e448d59..787ea91802e7 100644 --- a/drivers/net/ethernet/aquantia/atlantic/aq_drvinfo.c +++ b/drivers/net/ethernet/aquantia/atlantic/aq_drvinfo.c @@ -113,19 +113,9 @@ static const struct hwmon_ops aq_hwmon_ops = { .read_string = aq_hwmon_read_string, }; -static u32 aq_hwmon_temp_config[] = { - HWMON_T_INPUT | HWMON_T_LABEL, - HWMON_T_INPUT | HWMON_T_LABEL, - 0, -}; - -static const struct hwmon_channel_info aq_hwmon_temp = { - .type = hwmon_temp, - .config = aq_hwmon_temp_config, -}; - static const struct hwmon_channel_info * const aq_hwmon_info[] = { - &aq_hwmon_temp, + HWMON_CHANNEL_INFO(temp, HWMON_T_INPUT | HWMON_T_LABEL, + HWMON_T_INPUT | HWMON_T_LABEL), NULL, }; From patchwork Tue Jan 21 06:45:02 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "lihuisong (C)" X-Patchwork-Id: 13945781 Received: from szxga04-in.huawei.com (szxga04-in.huawei.com [45.249.212.190]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id AE9411B0424; Tue, 21 Jan 2025 06:57:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=45.249.212.190 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737442657; cv=none; b=KuikS32Bhk2Uu+VKcZOOi7KG+0C3Ucsd0FA7dIux0oMd3psW9IUV8jvEULVJrZ80Dg1Lmna1yqU1VqMvkfzbqjJUyQT1HuOMcgzHL9EZwZAen12xZ0N3jUdmVKq9PtylaO6MDPpKqDZ9eiBdptqpJ0fFmCoFL5IzOb7u2krsjNM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737442657; c=relaxed/simple; bh=mWX/fp1URit59PoIjt60VZfGFkJQZLYn2jvxHT7rK+c=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=sJBY60LbnmI8EP3P9VRlxvk9MPmK/ZVIhFbqjDspeFhxAR581OhJmoNeVd7QQfZSlUi4a077XZbyFIjb3CtyaPPgX/hhwjhyZkk2Pqb7ZTHyei6dEI/4KU6CH9XWUX6a9SpDAZsayhcktfkCX3GkKaxcuTpXseJdQ17SGmGpGrE= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com; spf=pass smtp.mailfrom=huawei.com; arc=none smtp.client-ip=45.249.212.190 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=huawei.com Received: from mail.maildlp.com (unknown [172.19.163.44]) by szxga04-in.huawei.com (SkyGuard) with ESMTP id 4YcdGv0jWZz2FcW9; Tue, 21 Jan 2025 14:54:15 +0800 (CST) Received: from dggemv712-chm.china.huawei.com (unknown [10.1.198.32]) by mail.maildlp.com (Postfix) with ESMTPS id CD2F41402C3; Tue, 21 Jan 2025 14:57:32 +0800 (CST) Received: from kwepemn100009.china.huawei.com (7.202.194.112) by dggemv712-chm.china.huawei.com (10.1.198.32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.11; Tue, 21 Jan 2025 14:57:32 +0800 Received: from localhost.localdomain (10.28.79.22) by kwepemn100009.china.huawei.com (7.202.194.112) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.11; Tue, 21 Jan 2025 14:57:23 +0800 From: Huisong Li To: CC: , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , Subject: [PATCH v1 04/21] net: nfp: Use HWMON_CHANNEL_INFO macro to simplify code Date: Tue, 21 Jan 2025 14:45:02 +0800 Message-ID: <20250121064519.18974-5-lihuisong@huawei.com> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20250121064519.18974-1-lihuisong@huawei.com> References: <20250121064519.18974-1-lihuisong@huawei.com> Precedence: bulk X-Mailing-List: linux-hwmon@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-ClientProxiedBy: dggems706-chm.china.huawei.com (10.3.19.183) To kwepemn100009.china.huawei.com (7.202.194.112) Use HWMON_CHANNEL_INFO macro to simplify code. Signed-off-by: Huisong Li --- .../net/ethernet/netronome/nfp/nfp_hwmon.c | 40 +++---------------- 1 file changed, 5 insertions(+), 35 deletions(-) diff --git a/drivers/net/ethernet/netronome/nfp/nfp_hwmon.c b/drivers/net/ethernet/netronome/nfp/nfp_hwmon.c index 0d6c59d6d4ae..ea6a288c0d5e 100644 --- a/drivers/net/ethernet/netronome/nfp/nfp_hwmon.c +++ b/drivers/net/ethernet/netronome/nfp/nfp_hwmon.c @@ -83,42 +83,12 @@ nfp_hwmon_is_visible(const void *data, enum hwmon_sensor_types type, u32 attr, return 0; } -static u32 nfp_chip_config[] = { - HWMON_C_REGISTER_TZ, - 0 -}; - -static const struct hwmon_channel_info nfp_chip = { - .type = hwmon_chip, - .config = nfp_chip_config, -}; - -static u32 nfp_temp_config[] = { - HWMON_T_INPUT | HWMON_T_MAX | HWMON_T_CRIT, - 0 -}; - -static const struct hwmon_channel_info nfp_temp = { - .type = hwmon_temp, - .config = nfp_temp_config, -}; - -static u32 nfp_power_config[] = { - HWMON_P_INPUT | HWMON_P_MAX, - HWMON_P_INPUT, - HWMON_P_INPUT, - 0 -}; - -static const struct hwmon_channel_info nfp_power = { - .type = hwmon_power, - .config = nfp_power_config, -}; - static const struct hwmon_channel_info * const nfp_hwmon_info[] = { - &nfp_chip, - &nfp_temp, - &nfp_power, + HWMON_CHANNEL_INFO(chip, HWMON_C_REGISTER_TZ), + HWMON_CHANNEL_INFO(temp, HWMON_T_INPUT | HWMON_T_MAX | HWMON_T_CRIT), + HWMON_CHANNEL_INFO(power, HWMON_P_INPUT | HWMON_P_MAX, + HWMON_P_INPUT, + HWMON_P_INPUT), NULL }; From patchwork Tue Jan 21 06:45:03 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "lihuisong (C)" X-Patchwork-Id: 13945782 Received: from szxga05-in.huawei.com (szxga05-in.huawei.com [45.249.212.191]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E43F51B87F8; Tue, 21 Jan 2025 06:57:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=45.249.212.191 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737442657; cv=none; b=LSDyFD9LJE/gKPJOgpULfMkujgA9F/HSoLv/s5uXpwCBGSXcr95rutesP8N22iIsbi+np+CUffAvPkXMBl55oNwmviX95jRMhikvj2xjXA9CYjrKacbCxxTEO2ln8wK8rlwVJDzd1Q+9YTJ7Cn66bH0detF6k303eXR5mYeMdVM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737442657; c=relaxed/simple; bh=9R4EBb0QHSNQehDQA1zgOuXZJ9e4ixUJtG9sqepfvAs=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=LLeWeovm1sMUnwhQsbj+Kd1Jm66Ex3zV23eDuGzWE6WZa9KPwDLOtxJaqsHshp8pPFOmqHjM2YLVC59Hl4YP4zU/bbn8rOMHMIzzrz4iSNYpkPbYrd4BiOx6o+RPBG6iafhX5x9Bpk+KV8hb8AonOrOD2he31Lp2sFkDtGF5yT8= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com; spf=pass smtp.mailfrom=huawei.com; arc=none smtp.client-ip=45.249.212.191 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=huawei.com Received: from mail.maildlp.com (unknown [172.19.88.234]) by szxga05-in.huawei.com (SkyGuard) with ESMTP id 4YcdGv5HzSz1kygl; Tue, 21 Jan 2025 14:54:15 +0800 (CST) Received: from dggemv712-chm.china.huawei.com (unknown [10.1.198.32]) by mail.maildlp.com (Postfix) with ESMTPS id 0AA851400D5; Tue, 21 Jan 2025 14:57:33 +0800 (CST) Received: from kwepemn100009.china.huawei.com (7.202.194.112) by dggemv712-chm.china.huawei.com (10.1.198.32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.11; Tue, 21 Jan 2025 14:57:32 +0800 Received: from localhost.localdomain (10.28.79.22) by kwepemn100009.china.huawei.com (7.202.194.112) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.11; Tue, 21 Jan 2025 14:57:25 +0800 From: Huisong Li To: CC: , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , Subject: [PATCH v1 05/21] net: phy: marvell: Use HWMON_CHANNEL_INFO macro to simplify code Date: Tue, 21 Jan 2025 14:45:03 +0800 Message-ID: <20250121064519.18974-6-lihuisong@huawei.com> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20250121064519.18974-1-lihuisong@huawei.com> References: <20250121064519.18974-1-lihuisong@huawei.com> Precedence: bulk X-Mailing-List: linux-hwmon@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-ClientProxiedBy: dggems706-chm.china.huawei.com (10.3.19.183) To kwepemn100009.china.huawei.com (7.202.194.112) Use HWMON_CHANNEL_INFO macro to simplify code. Signed-off-by: Huisong Li --- drivers/net/phy/marvell.c | 24 ++---------------------- 1 file changed, 2 insertions(+), 22 deletions(-) diff --git a/drivers/net/phy/marvell.c b/drivers/net/phy/marvell.c index 44e1927de499..dd254e36ca8a 100644 --- a/drivers/net/phy/marvell.c +++ b/drivers/net/phy/marvell.c @@ -3124,33 +3124,13 @@ static umode_t marvell_hwmon_is_visible(const void *data, } } -static u32 marvell_hwmon_chip_config[] = { - HWMON_C_REGISTER_TZ, - 0 -}; - -static const struct hwmon_channel_info marvell_hwmon_chip = { - .type = hwmon_chip, - .config = marvell_hwmon_chip_config, -}; - /* we can define HWMON_T_CRIT and HWMON_T_MAX_ALARM even though these are not * defined for all PHYs, because the hwmon code checks whether the attributes * exists via the .is_visible method */ -static u32 marvell_hwmon_temp_config[] = { - HWMON_T_INPUT | HWMON_T_CRIT | HWMON_T_MAX_ALARM, - 0 -}; - -static const struct hwmon_channel_info marvell_hwmon_temp = { - .type = hwmon_temp, - .config = marvell_hwmon_temp_config, -}; - static const struct hwmon_channel_info * const marvell_hwmon_info[] = { - &marvell_hwmon_chip, - &marvell_hwmon_temp, + HWMON_CHANNEL_INFO(chip, HWMON_C_REGISTER_TZ), + HWMON_CHANNEL_INFO(temp, HWMON_T_INPUT | HWMON_T_CRIT | HWMON_T_MAX_ALARM), NULL }; From patchwork Tue Jan 21 06:45:04 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "lihuisong (C)" X-Patchwork-Id: 13945780 Received: from szxga04-in.huawei.com (szxga04-in.huawei.com [45.249.212.190]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id CA69D1B78F3; Tue, 21 Jan 2025 06:57:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=45.249.212.190 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737442657; cv=none; b=sEf6gLrSODCJaFQqBmPijR3pX6Ilo14PJObPxAlk4YyWEVssPBMI68bjnEozvrSgbxI09OKWQv8sONrBptOTiqfBdRobaEZO+72KgsjIafEuq/h39my5Xyj/n66+nfF7O+Rp9eynfNIAfxxsBmHKAfIX/I+UuS7KRTdr4wNv/sw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737442657; c=relaxed/simple; bh=xKblWWGxTE5azXr82EvnLeeQK5P/EFTNCVtLQSBacDk=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=lMVJh8C/T8zCQdUdRaCwhpBI4Yh2Qe1UTtGprFGtnjqM4E8OzYc1Gyfzx2G2cA27a1gnTthhUOLHf1YkjUc9cwrY+5KIuPrOkDEuCQ8SjT3+aBuqOXxT5SHXxTulM/oQZvW+zgVLH1TR8QCf0Y1mi7vs+zpyUSwAzqxrXe6xaK4= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com; spf=pass smtp.mailfrom=huawei.com; arc=none smtp.client-ip=45.249.212.190 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=huawei.com Received: from mail.maildlp.com (unknown [172.19.88.234]) by szxga04-in.huawei.com (SkyGuard) with ESMTP id 4YcdGv4Kbnz2FcWN; Tue, 21 Jan 2025 14:54:15 +0800 (CST) Received: from dggemv712-chm.china.huawei.com (unknown [10.1.198.32]) by mail.maildlp.com (Postfix) with ESMTPS id 5432C140361; Tue, 21 Jan 2025 14:57:33 +0800 (CST) Received: from kwepemn100009.china.huawei.com (7.202.194.112) by dggemv712-chm.china.huawei.com (10.1.198.32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.11; Tue, 21 Jan 2025 14:57:33 +0800 Received: from localhost.localdomain (10.28.79.22) by kwepemn100009.china.huawei.com (7.202.194.112) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.11; Tue, 21 Jan 2025 14:57:26 +0800 From: Huisong Li To: CC: , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , Subject: [PATCH v1 06/21] net: phy: marvell10g: Use HWMON_CHANNEL_INFO macro to simplify code Date: Tue, 21 Jan 2025 14:45:04 +0800 Message-ID: <20250121064519.18974-7-lihuisong@huawei.com> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20250121064519.18974-1-lihuisong@huawei.com> References: <20250121064519.18974-1-lihuisong@huawei.com> Precedence: bulk X-Mailing-List: linux-hwmon@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-ClientProxiedBy: dggems706-chm.china.huawei.com (10.3.19.183) To kwepemn100009.china.huawei.com (7.202.194.112) Use HWMON_CHANNEL_INFO macro to simplify code. Signed-off-by: Huisong Li --- drivers/net/phy/marvell10g.c | 24 ++---------------------- 1 file changed, 2 insertions(+), 22 deletions(-) diff --git a/drivers/net/phy/marvell10g.c b/drivers/net/phy/marvell10g.c index 623bdb8466b8..5354c8895163 100644 --- a/drivers/net/phy/marvell10g.c +++ b/drivers/net/phy/marvell10g.c @@ -230,29 +230,9 @@ static const struct hwmon_ops mv3310_hwmon_ops = { .read = mv3310_hwmon_read, }; -static u32 mv3310_hwmon_chip_config[] = { - HWMON_C_REGISTER_TZ | HWMON_C_UPDATE_INTERVAL, - 0, -}; - -static const struct hwmon_channel_info mv3310_hwmon_chip = { - .type = hwmon_chip, - .config = mv3310_hwmon_chip_config, -}; - -static u32 mv3310_hwmon_temp_config[] = { - HWMON_T_INPUT, - 0, -}; - -static const struct hwmon_channel_info mv3310_hwmon_temp = { - .type = hwmon_temp, - .config = mv3310_hwmon_temp_config, -}; - static const struct hwmon_channel_info * const mv3310_hwmon_info[] = { - &mv3310_hwmon_chip, - &mv3310_hwmon_temp, + HWMON_CHANNEL_INFO(chip, HWMON_C_REGISTER_TZ | HWMON_C_UPDATE_INTERVAL), + HWMON_CHANNEL_INFO(temp, HWMON_T_INPUT), NULL, }; From patchwork Tue Jan 21 06:45:05 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "lihuisong (C)" X-Patchwork-Id: 13945785 Received: from szxga04-in.huawei.com (szxga04-in.huawei.com [45.249.212.190]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id CA6321B0426; Tue, 21 Jan 2025 06:57:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=45.249.212.190 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737442658; cv=none; b=kEPPMk9cdwftq8Xm/menrMaoKj1QE2Gz3wb/Y8d5V/cNm03TO6zqBIyjqlGgIutB5eYQan+HrZEPFuh2NJZBz994DQyTEOwrD7UoQJcnq4M9eRR6WTEdKRYIYnc1pq3YP3rNDXQzXdZ9Pt7pQc38AT2HxqBze6fg/yLcQ33Obvs= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737442658; c=relaxed/simple; bh=26KYzChB3hECJWOSy+Gbb0c0qlL5k0uZ8wlfZh/AObY=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=VLdLGEp+FSIwJpaxKfy1yHYa2O1/CEHtAT6W9k4VM5EEepUswl8W5PkdQPLbbVK7ZbWfMi/ivTUEn81VcbbiQq4GV3+ERTrRNH4LHXNXMWzFgr0UaYTZgw2FSp3TjOdTAmBnjwolEkorRbV1rhVeBzhoUZ44C4gE2A5Cz0fGyOc= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com; spf=pass smtp.mailfrom=huawei.com; arc=none smtp.client-ip=45.249.212.190 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=huawei.com Received: from mail.maildlp.com (unknown [172.19.88.163]) by szxga04-in.huawei.com (SkyGuard) with ESMTP id 4YcdHr40szz22lgr; Tue, 21 Jan 2025 14:55:04 +0800 (CST) Received: from dggemv712-chm.china.huawei.com (unknown [10.1.198.32]) by mail.maildlp.com (Postfix) with ESMTPS id 7940F180042; Tue, 21 Jan 2025 14:57:33 +0800 (CST) Received: from kwepemn100009.china.huawei.com (7.202.194.112) by dggemv712-chm.china.huawei.com (10.1.198.32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.11; Tue, 21 Jan 2025 14:57:33 +0800 Received: from localhost.localdomain (10.28.79.22) by kwepemn100009.china.huawei.com (7.202.194.112) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.11; Tue, 21 Jan 2025 14:57:27 +0800 From: Huisong Li To: CC: , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , Subject: [PATCH v1 07/21] rtc: ab-eoz9: Use HWMON_CHANNEL_INFO macro to simplify code Date: Tue, 21 Jan 2025 14:45:05 +0800 Message-ID: <20250121064519.18974-8-lihuisong@huawei.com> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20250121064519.18974-1-lihuisong@huawei.com> References: <20250121064519.18974-1-lihuisong@huawei.com> Precedence: bulk X-Mailing-List: linux-hwmon@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-ClientProxiedBy: dggems706-chm.china.huawei.com (10.3.19.183) To kwepemn100009.china.huawei.com (7.202.194.112) Use HWMON_CHANNEL_INFO macro to simplify code. Signed-off-by: Huisong Li --- drivers/rtc/rtc-ab-eoz9.c | 24 ++---------------------- 1 file changed, 2 insertions(+), 22 deletions(-) diff --git a/drivers/rtc/rtc-ab-eoz9.c b/drivers/rtc/rtc-ab-eoz9.c index d2b60487d462..de002f7a39bf 100644 --- a/drivers/rtc/rtc-ab-eoz9.c +++ b/drivers/rtc/rtc-ab-eoz9.c @@ -426,29 +426,9 @@ static umode_t abeoz9_is_visible(const void *data, } } -static const u32 abeoz9_chip_config[] = { - HWMON_C_REGISTER_TZ, - 0 -}; - -static const struct hwmon_channel_info abeoz9_chip = { - .type = hwmon_chip, - .config = abeoz9_chip_config, -}; - -static const u32 abeoz9_temp_config[] = { - HWMON_T_INPUT | HWMON_T_MAX | HWMON_T_MIN, - 0 -}; - -static const struct hwmon_channel_info abeoz9_temp = { - .type = hwmon_temp, - .config = abeoz9_temp_config, -}; - static const struct hwmon_channel_info * const abeoz9_info[] = { - &abeoz9_chip, - &abeoz9_temp, + HWMON_CHANNEL_INFO(chip, HWMON_C_REGISTER_TZ), + HWMON_CHANNEL_INFO(temp, HWMON_T_INPUT | HWMON_T_MAX | HWMON_T_MIN), NULL }; From patchwork Tue Jan 21 06:45:06 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "lihuisong (C)" X-Patchwork-Id: 13945787 Received: from szxga02-in.huawei.com (szxga02-in.huawei.com [45.249.212.188]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 9BE3A1B043E; Tue, 21 Jan 2025 06:57:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=45.249.212.188 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737442658; cv=none; b=ahLnSIdypQJ44WpvhX5QZqUuhS92xAoolzUDBZqzw5utx1Ov899ImPXTH+8bgbZyJpV4YjesEHDlKEHZikGvImd6Ed91SilEY674Umo1QnbzRosZ1kXNulm7+WI67bcxlbOTLgYULM8qbte4AYZis0nXnD2Mg7VHJpus7uT5JeE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737442658; c=relaxed/simple; bh=ab/y7cXj9QgjxXLU8g2+XSI1lA7YeSRH875MKtzI1Vs=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=LCF4Io9reNsVlKevh2/KhCpleW29DqpI+5cj7Wz7JXXlw74Manryx7/4jHbgYGxGpypfcwcQcAGM814pTvL7JMRYUlensPOQ/mtKpNer5KlYJEj63U1sDQ6HJuUfUEp2ydoMnvQeUvfp411Y2cTnJbm4jJNMMa/s+wkyOO2HuTA= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com; spf=pass smtp.mailfrom=huawei.com; arc=none smtp.client-ip=45.249.212.188 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=huawei.com Received: from mail.maildlp.com (unknown [172.19.163.48]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4YcdJp4hPHzrRgP; Tue, 21 Jan 2025 14:55:54 +0800 (CST) Received: from dggemv712-chm.china.huawei.com (unknown [10.1.198.32]) by mail.maildlp.com (Postfix) with ESMTPS id B3C491802D0; Tue, 21 Jan 2025 14:57:33 +0800 (CST) Received: from kwepemn100009.china.huawei.com (7.202.194.112) by dggemv712-chm.china.huawei.com (10.1.198.32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.11; Tue, 21 Jan 2025 14:57:33 +0800 Received: from localhost.localdomain (10.28.79.22) by kwepemn100009.china.huawei.com (7.202.194.112) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.11; Tue, 21 Jan 2025 14:57:29 +0800 From: Huisong Li To: CC: , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , Subject: [PATCH v1 08/21] rtc: ds3232: Use HWMON_CHANNEL_INFO macro to simplify code Date: Tue, 21 Jan 2025 14:45:06 +0800 Message-ID: <20250121064519.18974-9-lihuisong@huawei.com> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20250121064519.18974-1-lihuisong@huawei.com> References: <20250121064519.18974-1-lihuisong@huawei.com> Precedence: bulk X-Mailing-List: linux-hwmon@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-ClientProxiedBy: dggems706-chm.china.huawei.com (10.3.19.183) To kwepemn100009.china.huawei.com (7.202.194.112) Use HWMON_CHANNEL_INFO macro to simplify code. Signed-off-by: Huisong Li --- drivers/rtc/rtc-ds3232.c | 24 ++---------------------- 1 file changed, 2 insertions(+), 22 deletions(-) diff --git a/drivers/rtc/rtc-ds3232.c b/drivers/rtc/rtc-ds3232.c index 19c09c418746..18f35823b4b5 100644 --- a/drivers/rtc/rtc-ds3232.c +++ b/drivers/rtc/rtc-ds3232.c @@ -339,29 +339,9 @@ static int ds3232_hwmon_read(struct device *dev, return err; } -static u32 ds3232_hwmon_chip_config[] = { - HWMON_C_REGISTER_TZ, - 0 -}; - -static const struct hwmon_channel_info ds3232_hwmon_chip = { - .type = hwmon_chip, - .config = ds3232_hwmon_chip_config, -}; - -static u32 ds3232_hwmon_temp_config[] = { - HWMON_T_INPUT, - 0 -}; - -static const struct hwmon_channel_info ds3232_hwmon_temp = { - .type = hwmon_temp, - .config = ds3232_hwmon_temp_config, -}; - static const struct hwmon_channel_info * const ds3232_hwmon_info[] = { - &ds3232_hwmon_chip, - &ds3232_hwmon_temp, + HWMON_CHANNEL_INFO(chip, HWMON_C_REGISTER_TZ), + HWMON_CHANNEL_INFO(temp, HWMON_T_INPUT), NULL }; From patchwork Tue Jan 21 06:45:07 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "lihuisong (C)" X-Patchwork-Id: 13945783 Received: from szxga01-in.huawei.com (szxga01-in.huawei.com [45.249.212.187]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 1153C1B982C; Tue, 21 Jan 2025 06:57:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=45.249.212.187 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737442658; cv=none; b=oa8YsSOmNomOvgBc1W7VGlv5/J2OkjL9q+2Uz6CDcb6NL1dF7Brw2thfLfXRlZN7KXVSuJd+549LjaHMcKQIbuzy4K8awQh0By++Pft95Li/Ie6VWOypUdro5mnU5BbSOJqsKIwruCEamhgQtU5IHhgzzseo0AtRUuTrVjFHDJM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737442658; c=relaxed/simple; bh=EQa6knGNTXwE+k/NBuFUYcjA25b13DYZO9d6G+7TX/k=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=azWeBdiPGxFgBxp+L45mQfQmxaY2Ou6uX7UGmjobs0DGDgHII2U7+0wRGl+7kp0kTtSzWBbeiMZIF46bVwwc2jY8hlQ++AhG8/4iybmh8bqUxLN0MuEE+AdQsEf/L5BHoEhOaHj1Gq/HcU4tgLsdfMuPwV8UqpudD7hDflf1t/I= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com; spf=pass smtp.mailfrom=huawei.com; arc=none smtp.client-ip=45.249.212.187 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=huawei.com Received: from mail.maildlp.com (unknown [172.19.162.254]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4YcdH52006zbp8N; Tue, 21 Jan 2025 14:54:25 +0800 (CST) Received: from dggemv712-chm.china.huawei.com (unknown [10.1.198.32]) by mail.maildlp.com (Postfix) with ESMTPS id EA3A0180105; Tue, 21 Jan 2025 14:57:33 +0800 (CST) Received: from kwepemn100009.china.huawei.com (7.202.194.112) by dggemv712-chm.china.huawei.com (10.1.198.32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.11; Tue, 21 Jan 2025 14:57:33 +0800 Received: from localhost.localdomain (10.28.79.22) by kwepemn100009.china.huawei.com (7.202.194.112) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.11; Tue, 21 Jan 2025 14:57:30 +0800 From: Huisong Li To: CC: , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , Subject: [PATCH v1 09/21] w1: w1_therm: w1: Use HWMON_CHANNEL_INFO macro to simplify code Date: Tue, 21 Jan 2025 14:45:07 +0800 Message-ID: <20250121064519.18974-10-lihuisong@huawei.com> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20250121064519.18974-1-lihuisong@huawei.com> References: <20250121064519.18974-1-lihuisong@huawei.com> Precedence: bulk X-Mailing-List: linux-hwmon@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-ClientProxiedBy: dggems706-chm.china.huawei.com (10.3.19.183) To kwepemn100009.china.huawei.com (7.202.194.112) Use HWMON_CHANNEL_INFO macro to simplify code. Signed-off-by: Huisong Li --- drivers/w1/slaves/w1_therm.c | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/drivers/w1/slaves/w1_therm.c b/drivers/w1/slaves/w1_therm.c index c85e80c7e130..9ccedb3264fb 100644 --- a/drivers/w1/slaves/w1_therm.c +++ b/drivers/w1/slaves/w1_therm.c @@ -444,18 +444,8 @@ static int w1_read(struct device *dev, enum hwmon_sensor_types type, } } -static const u32 w1_temp_config[] = { - HWMON_T_INPUT, - 0 -}; - -static const struct hwmon_channel_info w1_temp = { - .type = hwmon_temp, - .config = w1_temp_config, -}; - static const struct hwmon_channel_info * const w1_info[] = { - &w1_temp, + HWMON_CHANNEL_INFO(temp, HWMON_T_INPUT), NULL }; From patchwork Tue Jan 21 06:45:08 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "lihuisong (C)" X-Patchwork-Id: 13945786 Received: from szxga01-in.huawei.com (szxga01-in.huawei.com [45.249.212.187]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 56F891B043D; Tue, 21 Jan 2025 06:57:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=45.249.212.187 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737442658; cv=none; b=fur7ULmUZumX/d+eHMyyZ1+BntfTxHdIJM/lisiC9/6WlYSYRRqOzo5j3N3UMcbY2mZQPHyDnGf0ua1I8szrz63NWREBC2NWyo19yioQCDfrYB8u2nCmLQK3QltseUuFVog9Vx5vHSoS7/NjWX8TUStkGH8dnV5k4gmsjIQCt0Q= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737442658; c=relaxed/simple; bh=58yZtom8YkhzuN+i9B1U2m3skibCey3Ih9LllGAW7Rw=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=buQtow8WjL25nePAte+G/ucp3SEKmTDipCatOfppCEjvz3vRhtUlBRgxV0f5ENbhj4V+KMdwnAv+lwTRPn1K6z95IvuldlsHp2UwPUq/KJOEiggx4g2dGNHDbscy7WBQXzssrZhvYwfdB3RCwaNiJPBtdLcn0AUeRjegybHZpQ8= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com; spf=pass smtp.mailfrom=huawei.com; arc=none smtp.client-ip=45.249.212.187 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=huawei.com Received: from mail.maildlp.com (unknown [172.19.163.174]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4YcdH53WRMzbp8P; Tue, 21 Jan 2025 14:54:25 +0800 (CST) Received: from dggemv712-chm.china.huawei.com (unknown [10.1.198.32]) by mail.maildlp.com (Postfix) with ESMTPS id 2DE4A140203; Tue, 21 Jan 2025 14:57:34 +0800 (CST) Received: from kwepemn100009.china.huawei.com (7.202.194.112) by dggemv712-chm.china.huawei.com (10.1.198.32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.11; Tue, 21 Jan 2025 14:57:33 +0800 Received: from localhost.localdomain (10.28.79.22) by kwepemn100009.china.huawei.com (7.202.194.112) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.11; Tue, 21 Jan 2025 14:57:32 +0800 From: Huisong Li To: CC: , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , Subject: [PATCH v1 10/21] net: phy: aquantia: Use HWMON_CHANNEL_INFO macro to simplify code Date: Tue, 21 Jan 2025 14:45:08 +0800 Message-ID: <20250121064519.18974-11-lihuisong@huawei.com> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20250121064519.18974-1-lihuisong@huawei.com> References: <20250121064519.18974-1-lihuisong@huawei.com> Precedence: bulk X-Mailing-List: linux-hwmon@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-ClientProxiedBy: dggems706-chm.china.huawei.com (10.3.19.183) To kwepemn100009.china.huawei.com (7.202.194.112) Use HWMON_CHANNEL_INFO macro to simplify code. Signed-off-by: Huisong Li --- drivers/net/phy/aquantia/aquantia_hwmon.c | 32 +++++------------------ 1 file changed, 6 insertions(+), 26 deletions(-) diff --git a/drivers/net/phy/aquantia/aquantia_hwmon.c b/drivers/net/phy/aquantia/aquantia_hwmon.c index 7b3c49c3bf49..02b7a2639bbb 100644 --- a/drivers/net/phy/aquantia/aquantia_hwmon.c +++ b/drivers/net/phy/aquantia/aquantia_hwmon.c @@ -172,33 +172,13 @@ static const struct hwmon_ops aqr_hwmon_ops = { .write = aqr_hwmon_write, }; -static u32 aqr_hwmon_chip_config[] = { - HWMON_C_REGISTER_TZ, - 0, -}; - -static const struct hwmon_channel_info aqr_hwmon_chip = { - .type = hwmon_chip, - .config = aqr_hwmon_chip_config, -}; - -static u32 aqr_hwmon_temp_config[] = { - HWMON_T_INPUT | - HWMON_T_MAX | HWMON_T_MIN | - HWMON_T_MAX_ALARM | HWMON_T_MIN_ALARM | - HWMON_T_CRIT | HWMON_T_LCRIT | - HWMON_T_CRIT_ALARM | HWMON_T_LCRIT_ALARM, - 0, -}; - -static const struct hwmon_channel_info aqr_hwmon_temp = { - .type = hwmon_temp, - .config = aqr_hwmon_temp_config, -}; - static const struct hwmon_channel_info * const aqr_hwmon_info[] = { - &aqr_hwmon_chip, - &aqr_hwmon_temp, + HWMON_CHANNEL_INFO(chip, HWMON_C_REGISTER_TZ), + HWMON_CHANNEL_INFO(temp, HWMON_T_INPUT | + HWMON_T_MAX | HWMON_T_MIN | + HWMON_T_MAX_ALARM | HWMON_T_MIN_ALARM | + HWMON_T_CRIT | HWMON_T_LCRIT | + HWMON_T_CRIT_ALARM | HWMON_T_LCRIT_ALARM), NULL, }; From patchwork Tue Jan 21 06:45:09 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "lihuisong (C)" X-Patchwork-Id: 13945788 Received: from szxga02-in.huawei.com (szxga02-in.huawei.com [45.249.212.188]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id EC2841BC065; Tue, 21 Jan 2025 06:57:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=45.249.212.188 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737442660; cv=none; b=nrKw3fJ/Y/WURVA3dlJrFqXlWdKSgNw1yuyWBWYWQEwt8GaiWPTnAEHk0olbG1/CY3V/Zij22ql6879yWp5VvfklVpDP/8YQeg4mSofAUGVVEO6MlnVQU42GRpZOMO+VjY4JAuboQqwhf9nn4uZEZHmAXJMRA2/vA4+OdOxyBEQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737442660; c=relaxed/simple; bh=GHaNzCy9ObieR/bSrLhA7NlrWGfCEwNrqE6XUPHHQKU=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=QdjeGyj4BXvayu8/1U6cKiy/YsQk2EEdAQuLk1wb40Fjk3tOmcnP9mNOqb3RkvVQjMWazVoV2SJ2f7ZVTaLarIjYeAO/HYdewFAWtNWDZEZTnvhk8YU05btcv4Kf+KP+/u9CkEzbWDROj8dVLOwpFMEPoQtM4KDXthSwbgUnQFc= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com; spf=pass smtp.mailfrom=huawei.com; arc=none smtp.client-ip=45.249.212.188 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=huawei.com Received: from mail.maildlp.com (unknown [172.19.163.174]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4YcdJr3NG6zrRgr; Tue, 21 Jan 2025 14:55:56 +0800 (CST) Received: from dggemv711-chm.china.huawei.com (unknown [10.1.198.66]) by mail.maildlp.com (Postfix) with ESMTPS id 8C292140203; Tue, 21 Jan 2025 14:57:35 +0800 (CST) Received: from kwepemn100009.china.huawei.com (7.202.194.112) by dggemv711-chm.china.huawei.com (10.1.198.66) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.39; Tue, 21 Jan 2025 14:57:35 +0800 Received: from localhost.localdomain (10.28.79.22) by kwepemn100009.china.huawei.com (7.202.194.112) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.11; Tue, 21 Jan 2025 14:57:33 +0800 From: Huisong Li To: CC: , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , Subject: [PATCH v1 11/21] hwmon: (asus_wmi_sensors) Fix type of 'config' in struct hwmon_channel_info to u64 Date: Tue, 21 Jan 2025 14:45:09 +0800 Message-ID: <20250121064519.18974-12-lihuisong@huawei.com> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20250121064519.18974-1-lihuisong@huawei.com> References: <20250121064519.18974-1-lihuisong@huawei.com> Precedence: bulk X-Mailing-List: linux-hwmon@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-ClientProxiedBy: dggems706-chm.china.huawei.com (10.3.19.183) To kwepemn100009.china.huawei.com (7.202.194.112) The type of 'config' in struct hwmon_channel_info has been fixed to u64. Modify the related code in driver to avoid compiling failure. Signed-off-by: Huisong Li --- drivers/hwmon/asus_wmi_sensors.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/hwmon/asus_wmi_sensors.c b/drivers/hwmon/asus_wmi_sensors.c index c2dd7ff882f2..9593674fc5df 100644 --- a/drivers/hwmon/asus_wmi_sensors.c +++ b/drivers/hwmon/asus_wmi_sensors.c @@ -126,7 +126,7 @@ static enum hwmon_sensor_types asus_data_types[] = { [WATER_FLOW] = hwmon_fan, }; -static u32 hwmon_attributes[hwmon_max] = { +static u64 hwmon_attributes[hwmon_max] = { [hwmon_chip] = HWMON_C_REGISTER_TZ, [hwmon_temp] = HWMON_T_INPUT | HWMON_T_LABEL, [hwmon_in] = HWMON_I_INPUT | HWMON_I_LABEL, @@ -248,9 +248,9 @@ static int asus_wmi_get_item_count(u32 *count) static int asus_wmi_hwmon_add_chan_info(struct hwmon_channel_info *asus_wmi_hwmon_chan, struct device *dev, int num, - enum hwmon_sensor_types type, u32 config) + enum hwmon_sensor_types type, u64 config) { - u32 *cfg; + u64 *cfg; cfg = devm_kcalloc(dev, num + 1, sizeof(*cfg), GFP_KERNEL); if (!cfg) @@ -258,7 +258,7 @@ static int asus_wmi_hwmon_add_chan_info(struct hwmon_channel_info *asus_wmi_hwmo asus_wmi_hwmon_chan->type = type; asus_wmi_hwmon_chan->config = cfg; - memset32(cfg, config, num); + memset64(cfg, config, num); return 0; } From patchwork Tue Jan 21 06:45:10 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "lihuisong (C)" X-Patchwork-Id: 13945789 Received: from szxga04-in.huawei.com (szxga04-in.huawei.com [45.249.212.190]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3128F1EF085; Tue, 21 Jan 2025 06:57:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=45.249.212.190 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737442660; cv=none; b=PDea9zt4d0WWbtN9NwLnxwFp3COzNHXTl/SvBZQM6s8Rcx7QozACy7wY9AtgIj9zv4PO9tFoKkZ1/pdftDWMMp0O3ix2BN4vHbzuo2UPiPzypEWA4KJ1slS62giT6FtlstCAP2UbA0ph587QoBZOwN4bkkGIvCGO18y1BLTXSh8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737442660; c=relaxed/simple; bh=VdcCCHr2Fx3J7DPh0cZGnBX8YgdWaqBT/4N42zLcHUs=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=ZxysEt4qm+gZnpkedlR+ZyW2S+Ff8uAkSvxhF8QxQ3r1eWPvF2IdWheyxLHFFEdF+TfwSPOW9hvl/tVabhME+n/pMZ6KMcVE3VXpOLzss7qZ405vcZZRT9Nh/7wYG7z6yH/hmzQEzhp8uTpQdcfKPnGe+Qg2al0V8nZ5NeOZrlU= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com; spf=pass smtp.mailfrom=huawei.com; arc=none smtp.client-ip=45.249.212.190 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=huawei.com Received: from mail.maildlp.com (unknown [172.19.163.17]) by szxga04-in.huawei.com (SkyGuard) with ESMTP id 4YcdGz1YGsz2FcWQ; Tue, 21 Jan 2025 14:54:19 +0800 (CST) Received: from dggemv704-chm.china.huawei.com (unknown [10.3.19.47]) by mail.maildlp.com (Postfix) with ESMTPS id EA2C41A0188; Tue, 21 Jan 2025 14:57:36 +0800 (CST) Received: from kwepemn100009.china.huawei.com (7.202.194.112) by dggemv704-chm.china.huawei.com (10.3.19.47) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.39; Tue, 21 Jan 2025 14:57:36 +0800 Received: from localhost.localdomain (10.28.79.22) by kwepemn100009.china.huawei.com (7.202.194.112) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.11; Tue, 21 Jan 2025 14:57:35 +0800 From: Huisong Li To: CC: , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , Subject: [PATCH v1 12/21] hwmon: (hp-wmi-sensors) Fix type of 'config' in struct hwmon_channel_info to u64 Date: Tue, 21 Jan 2025 14:45:10 +0800 Message-ID: <20250121064519.18974-13-lihuisong@huawei.com> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20250121064519.18974-1-lihuisong@huawei.com> References: <20250121064519.18974-1-lihuisong@huawei.com> Precedence: bulk X-Mailing-List: linux-hwmon@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-ClientProxiedBy: dggems706-chm.china.huawei.com (10.3.19.183) To kwepemn100009.china.huawei.com (7.202.194.112) The type of 'config' in struct hwmon_channel_info has been fixed to u64. Modify the related code in driver to avoid compiling failure. Signed-off-by: Huisong Li --- drivers/hwmon/hp-wmi-sensors.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/hwmon/hp-wmi-sensors.c b/drivers/hwmon/hp-wmi-sensors.c index d6bdad26feb1..b0d7c7de0565 100644 --- a/drivers/hwmon/hp-wmi-sensors.c +++ b/drivers/hwmon/hp-wmi-sensors.c @@ -1921,8 +1921,8 @@ static int make_chip_info(struct hp_wmi_sensors *state, bool has_events) struct device *dev = &state->wdev->dev; enum hwmon_sensor_types type; u8 type_count = 0; - u32 *config; - u32 attr; + u64 *config; + u64 attr; u8 count; u8 i; @@ -1961,7 +1961,7 @@ static int make_chip_info(struct hp_wmi_sensors *state, bool has_events) attr = hp_wmi_hwmon_attributes[type]; channel_info->type = type; channel_info->config = config; - memset32(config, attr, count); + memset64(config, attr, count); *ptr_channel_info++ = channel_info++; From patchwork Tue Jan 21 06:45:11 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "lihuisong (C)" X-Patchwork-Id: 13945790 Received: from szxga04-in.huawei.com (szxga04-in.huawei.com [45.249.212.190]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 73D671F1902; Tue, 21 Jan 2025 06:57:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=45.249.212.190 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737442662; cv=none; b=cImB/JjtJ4jqpJiD2QsZufchOxXUWnBjTS6x73vJKRRoE/FCronE3HVX7KZkL7DTikfqDRMQwHJSuHH9rDi952QF5pYvLpg9pJLIUja+RwYuZsveslmpPITp506pngB5DrWfEbxGRn0RshWsSoBRR/Y9R3gRSFzOr8cJtJkuADg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737442662; c=relaxed/simple; bh=CwGLieQ2c5AcvmBnAGimS4omrJne12mWQI1Y8WGlp2Q=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=utQVhgrm9mgJ26emQTz4EGa9GwKPN4LMJ+FPUx8raK20wKjixBXiMuQJ9lrsJuGNTPdkWiTFD80iEPS9rGUIufS6YXekIqiUqfk5wH7Q8YhCXRoMKaM1ybAfYH0fprKbl7FK2vzC6w7GNh29mDX27KxY3RFolw+lb0sf+qFRz9A= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com; spf=pass smtp.mailfrom=huawei.com; arc=none smtp.client-ip=45.249.212.190 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=huawei.com Received: from mail.maildlp.com (unknown [172.19.162.112]) by szxga04-in.huawei.com (SkyGuard) with ESMTP id 4YcdHx38Wmz22lhR; Tue, 21 Jan 2025 14:55:09 +0800 (CST) Received: from dggemv703-chm.china.huawei.com (unknown [10.3.19.46]) by mail.maildlp.com (Postfix) with ESMTPS id 5CED71402C3; Tue, 21 Jan 2025 14:57:38 +0800 (CST) Received: from kwepemn100009.china.huawei.com (7.202.194.112) by dggemv703-chm.china.huawei.com (10.3.19.46) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.39; Tue, 21 Jan 2025 14:57:38 +0800 Received: from localhost.localdomain (10.28.79.22) by kwepemn100009.china.huawei.com (7.202.194.112) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.11; Tue, 21 Jan 2025 14:57:36 +0800 From: Huisong Li To: CC: , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , Subject: [PATCH v1 13/21] hwmon: (mr75203) Fix the type of 'config' in struct hwmon_channel_info to u64 Date: Tue, 21 Jan 2025 14:45:11 +0800 Message-ID: <20250121064519.18974-14-lihuisong@huawei.com> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20250121064519.18974-1-lihuisong@huawei.com> References: <20250121064519.18974-1-lihuisong@huawei.com> Precedence: bulk X-Mailing-List: linux-hwmon@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-ClientProxiedBy: dggems706-chm.china.huawei.com (10.3.19.183) To kwepemn100009.china.huawei.com (7.202.194.112) The type of 'config' in struct hwmon_channel_info has been fixed to u64. Modify the related code in driver to avoid compiling failure. Signed-off-by: Huisong Li --- drivers/hwmon/mr75203.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/hwmon/mr75203.c b/drivers/hwmon/mr75203.c index 7848198f8996..82d399b719a9 100644 --- a/drivers/hwmon/mr75203.c +++ b/drivers/hwmon/mr75203.c @@ -769,7 +769,7 @@ static int mr75203_probe(struct platform_device *pdev) u32 ts_num, vm_num, pd_num, ch_num, val, index, i; const struct hwmon_channel_info **pvt_info; struct device *dev = &pdev->dev; - u32 *temp_config, *in_config; + u64 *temp_config, *in_config; struct device *hwmon_dev; struct pvt_device *pvt; int ret; @@ -837,7 +837,7 @@ static int mr75203_probe(struct platform_device *pdev) if (!temp_config) return -ENOMEM; - memset32(temp_config, HWMON_T_INPUT, ts_num); + memset64(temp_config, HWMON_T_INPUT, ts_num); pvt_temp.config = temp_config; pvt_info[index++] = &pvt_temp; @@ -888,7 +888,7 @@ static int mr75203_probe(struct platform_device *pdev) if (!in_config) return -ENOMEM; - memset32(in_config, HWMON_I_INPUT, pvt->vm_channels.total); + memset64(in_config, HWMON_I_INPUT, pvt->vm_channels.total); in_config[pvt->vm_channels.total] = 0; pvt_in.config = in_config; From patchwork Tue Jan 21 06:45:12 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "lihuisong (C)" X-Patchwork-Id: 13945791 Received: from szxga03-in.huawei.com (szxga03-in.huawei.com [45.249.212.189]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 94E5A1F37D4; Tue, 21 Jan 2025 06:57:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=45.249.212.189 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737442664; cv=none; b=qYtwjn5MeElxPQb92yc0x0DyAICWaRTZ+JaMoVEueKyRCuKfHRNUEFFHxZm1sBZOwFfTY1E+4t688FBXPGO/5IuwXPnOJKdWcAgPX7MnM05Ku7T4+WWserWnZ6UbBI89Hgr2cZmGapBL9aH9U6+eXf1YtA+HgxU0L0dnonedTdY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737442664; c=relaxed/simple; bh=9QpnncAYEGL/R1ZpJFaCXmpN7BRyTIcAv/iKRtqMnGY=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=saxQHXfHZkd9yor/xvi/kkQUBEcLc/cYD4jA3UBbrEmaElrnPYpdHrjzA6VZjUu5qUZ5pGKmKajhr86ZVJysBLC4ISSZu9f7xCJsKu4k3w8HurGuiAVXckaLMxsikPyhV7SQcmmqhGtvpd1SjyYRr3cdzZA7LnFs6I8swJ5v2Os= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com; spf=pass smtp.mailfrom=huawei.com; arc=none smtp.client-ip=45.249.212.189 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=huawei.com Received: from mail.maildlp.com (unknown [172.19.163.48]) by szxga03-in.huawei.com (SkyGuard) with ESMTP id 4YcdHy51YmzRlYj; Tue, 21 Jan 2025 14:55:10 +0800 (CST) Received: from dggemv705-chm.china.huawei.com (unknown [10.3.19.32]) by mail.maildlp.com (Postfix) with ESMTPS id CC2101802D0; Tue, 21 Jan 2025 14:57:39 +0800 (CST) Received: from kwepemn100009.china.huawei.com (7.202.194.112) by dggemv705-chm.china.huawei.com (10.3.19.32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.11; Tue, 21 Jan 2025 14:57:39 +0800 Received: from localhost.localdomain (10.28.79.22) by kwepemn100009.china.huawei.com (7.202.194.112) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.11; Tue, 21 Jan 2025 14:57:37 +0800 From: Huisong Li To: CC: , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , Subject: [PATCH v1 14/21] hwmon: (pwm-fan) Fix the type of 'config' in struct hwmon_channel_info to u64 Date: Tue, 21 Jan 2025 14:45:12 +0800 Message-ID: <20250121064519.18974-15-lihuisong@huawei.com> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20250121064519.18974-1-lihuisong@huawei.com> References: <20250121064519.18974-1-lihuisong@huawei.com> Precedence: bulk X-Mailing-List: linux-hwmon@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-ClientProxiedBy: dggems706-chm.china.huawei.com (10.3.19.183) To kwepemn100009.china.huawei.com (7.202.194.112) The type of 'config' in struct hwmon_channel_info has been fixed to u64. Modify the related code in driver to avoid compiling failure. Signed-off-by: Huisong Li --- drivers/hwmon/pwm-fan.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/hwmon/pwm-fan.c b/drivers/hwmon/pwm-fan.c index 579d31bb9ac7..91bb6d590a36 100644 --- a/drivers/hwmon/pwm-fan.c +++ b/drivers/hwmon/pwm-fan.c @@ -498,7 +498,7 @@ static int pwm_fan_probe(struct platform_device *pdev) int ret; const struct hwmon_channel_info **channels; u32 initial_pwm, pwm_min_from_stopped = 0; - u32 *fan_channel_config; + u64 *fan_channel_config; int channel_count = 1; /* We always have a PWM channel. */ int i; @@ -586,7 +586,7 @@ static int pwm_fan_probe(struct platform_device *pdev) ctx->fan_channel.type = hwmon_fan; fan_channel_config = devm_kcalloc(dev, ctx->tach_count + 1, - sizeof(u32), GFP_KERNEL); + sizeof(u64), GFP_KERNEL); if (!fan_channel_config) return -ENOMEM; ctx->fan_channel.config = fan_channel_config; From patchwork Tue Jan 21 06:45:13 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "lihuisong (C)" X-Patchwork-Id: 13945792 Received: from szxga04-in.huawei.com (szxga04-in.huawei.com [45.249.212.190]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 2D4431E9B3A; Tue, 21 Jan 2025 06:57:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=45.249.212.190 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737442664; cv=none; b=dQbcHovC5bxFLDqAtNhCGIrmNcWXPpdR4QFxl21EPPDthkT7TDn+lfa+DId9437quBsG0MO4kmV+PExYBEGYv1G0vCV+lnTLRfww/Afhf5fn2KYcFdEtGgQAuAYQ1W6N2QZa2dQkcsWjqxsPndaH9F2Odn5AHEHSdZ5VMZPQHP4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737442664; c=relaxed/simple; bh=rcnh1ObECijeP1gO6p6MULduz0XxyvXO9hQO++xYpFc=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=LC7J/XfpLrA0QTEQ9frGaU6o3jnnkQpyi8Q5k9G6lh2Wsq1FpNLyg1wlBntgs9VJvUE0EtAllAdgXaltpsOiBFtfGcTg/7O0KlVt1q5xO3WpewRTawwFx8qEkpofZ/OZw6Lel98gtr6d6MLe/uN/n5RUmArK+Os1BbBLRnTkO4o= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com; spf=pass smtp.mailfrom=huawei.com; arc=none smtp.client-ip=45.249.212.190 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=huawei.com Received: from mail.maildlp.com (unknown [172.19.88.163]) by szxga04-in.huawei.com (SkyGuard) with ESMTP id 4YcdH335Wxz2FcWT; Tue, 21 Jan 2025 14:54:23 +0800 (CST) Received: from dggemv706-chm.china.huawei.com (unknown [10.3.19.33]) by mail.maildlp.com (Postfix) with ESMTPS id 2FB21180042; Tue, 21 Jan 2025 14:57:41 +0800 (CST) Received: from kwepemn100009.china.huawei.com (7.202.194.112) by dggemv706-chm.china.huawei.com (10.3.19.33) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.11; Tue, 21 Jan 2025 14:57:41 +0800 Received: from localhost.localdomain (10.28.79.22) by kwepemn100009.china.huawei.com (7.202.194.112) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.11; Tue, 21 Jan 2025 14:57:39 +0800 From: Huisong Li To: CC: , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , Subject: [PATCH v1 15/21] hwmon: (scmi-hwmon) Fix the type of 'config' in struct hwmon_channel_info to u64 Date: Tue, 21 Jan 2025 14:45:13 +0800 Message-ID: <20250121064519.18974-16-lihuisong@huawei.com> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20250121064519.18974-1-lihuisong@huawei.com> References: <20250121064519.18974-1-lihuisong@huawei.com> Precedence: bulk X-Mailing-List: linux-hwmon@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-ClientProxiedBy: dggems706-chm.china.huawei.com (10.3.19.183) To kwepemn100009.china.huawei.com (7.202.194.112) The type of 'config' in struct hwmon_channel_info has been fixed to u64. Modify the related code in driver to avoid compiling failure. Signed-off-by: Huisong Li --- drivers/hwmon/scmi-hwmon.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/hwmon/scmi-hwmon.c b/drivers/hwmon/scmi-hwmon.c index 364199b332c0..b4b43e200d2a 100644 --- a/drivers/hwmon/scmi-hwmon.c +++ b/drivers/hwmon/scmi-hwmon.c @@ -157,10 +157,10 @@ static const struct thermal_zone_device_ops scmi_hwmon_thermal_ops = { static int scmi_hwmon_add_chan_info(struct hwmon_channel_info *scmi_hwmon_chan, struct device *dev, int num, - enum hwmon_sensor_types type, u32 config) + enum hwmon_sensor_types type, u64 config) { int i; - u32 *cfg = devm_kcalloc(dev, num + 1, sizeof(*cfg), GFP_KERNEL); + u64 *cfg = devm_kcalloc(dev, num + 1, sizeof(*cfg), GFP_KERNEL); if (!cfg) return -ENOMEM; @@ -181,7 +181,7 @@ static enum hwmon_sensor_types scmi_types[] = { [ENERGY] = hwmon_energy, }; -static u32 hwmon_attributes[hwmon_max] = { +static u64 hwmon_attributes[hwmon_max] = { [hwmon_temp] = HWMON_T_INPUT | HWMON_T_LABEL, [hwmon_in] = HWMON_I_INPUT | HWMON_I_LABEL, [hwmon_curr] = HWMON_C_INPUT | HWMON_C_LABEL, From patchwork Tue Jan 21 06:45:14 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "lihuisong (C)" X-Patchwork-Id: 13945796 Received: from szxga07-in.huawei.com (szxga07-in.huawei.com [45.249.212.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id CA7221F4E56; Tue, 21 Jan 2025 06:57:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=45.249.212.35 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737442672; cv=none; b=da98ELM831hLl1rh/tqlbarXRpNdjPhOz/ieeQyLHKuNw0Ag2ly0I8vdje6FBoVECoe84Ja7/3ZTBhOHxOUMvYgZKSNZzQUTSJvia2elIXMuw3MwHbW0YVGFGGSN/LRByQrQvUqiRqYn8+jV8bJr8kNwVmwjnzNOhdeXhrUfJZ4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737442672; c=relaxed/simple; bh=03LFVz8QdFx6HhO55R6VxI5OCUcw5G4QFT9N+bO7Qbo=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=hMZtgZhbT+R5sg/JIhqZbf/TxHfyO7/3gytxxUelqelFVwDAXlkadbQTuSXy/t5Vbwnhb5xDiNJZpa3qy5KhoCnAzqOT+vx6lI3Jq2VQCLfGjhU6LUia+EdqByvKJ76PPEHeHs9G4XcDVEvfBbICutaO9HAos0597zkZshr125U= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com; spf=pass smtp.mailfrom=huawei.com; arc=none smtp.client-ip=45.249.212.35 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=huawei.com Received: from mail.maildlp.com (unknown [172.19.88.234]) by szxga07-in.huawei.com (SkyGuard) with ESMTP id 4YcdH42gSBz1V5Kv; Tue, 21 Jan 2025 14:54:24 +0800 (CST) Received: from dggemv712-chm.china.huawei.com (unknown [10.1.198.32]) by mail.maildlp.com (Postfix) with ESMTPS id A71D41400D5; Tue, 21 Jan 2025 14:57:42 +0800 (CST) Received: from kwepemn100009.china.huawei.com (7.202.194.112) by dggemv712-chm.china.huawei.com (10.1.198.32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.11; Tue, 21 Jan 2025 14:57:42 +0800 Received: from localhost.localdomain (10.28.79.22) by kwepemn100009.china.huawei.com (7.202.194.112) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.11; Tue, 21 Jan 2025 14:57:40 +0800 From: Huisong Li To: CC: , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , Subject: [PATCH v1 16/21] hwmon: (tmp401) Fix the type of 'config' in struct hwmon_channel_info to u64 Date: Tue, 21 Jan 2025 14:45:14 +0800 Message-ID: <20250121064519.18974-17-lihuisong@huawei.com> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20250121064519.18974-1-lihuisong@huawei.com> References: <20250121064519.18974-1-lihuisong@huawei.com> Precedence: bulk X-Mailing-List: linux-hwmon@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-ClientProxiedBy: dggems706-chm.china.huawei.com (10.3.19.183) To kwepemn100009.china.huawei.com (7.202.194.112) The type of 'config' in struct hwmon_channel_info has been fixed to u64. Modify the related code in driver to avoid compiling failure. Signed-off-by: Huisong Li --- drivers/hwmon/tmp401.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/hwmon/tmp401.c b/drivers/hwmon/tmp401.c index 02c5a3bb1071..e62df28a6e50 100644 --- a/drivers/hwmon/tmp401.c +++ b/drivers/hwmon/tmp401.c @@ -113,9 +113,9 @@ struct tmp401_data { bool extended_range; /* hwmon API configuration data */ - u32 chip_channel_config[4]; + u64 chip_channel_config[4]; struct hwmon_channel_info chip_info; - u32 temp_channel_config[4]; + u64 temp_channel_config[4]; struct hwmon_channel_info temp_info; const struct hwmon_channel_info *info[3]; struct hwmon_chip_info chip; From patchwork Tue Jan 21 06:45:15 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "lihuisong (C)" X-Patchwork-Id: 13945793 Received: from szxga03-in.huawei.com (szxga03-in.huawei.com [45.249.212.189]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 960BA1F37D4; Tue, 21 Jan 2025 06:57:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=45.249.212.189 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737442668; cv=none; b=VgCsCDiW0w6/Iz+EOQipv0/eIXOhBjMZEkagS67E60FB+ielWinRbq+fb1BOy+hZ4I9F1kwG3AULV+w57wvkc760ghgUttKsei0ppv4JVSS8G4REhcHezJyVoRNYOQKLZcBodPQjJxZiaMJsZGtPB2nuX7Wi2UfaYUmfV1ealdM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737442668; c=relaxed/simple; bh=nZ4/J8KMNP6TkpAGFQdOyK4w82kRclTB6tDx4Bt52FM=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=kv3O7pT/d7L+TscprQDbj8dNPs7zkYjFLdTomv0sb/fb2dcfR1x9bDGpKMWmN8bmQ2UeQNEtv0kVKvfPiZvA/kNc4/l78P6iOD+FdVy2vWHTmAKMF2cB+5fH2105dYPo63imSpT3pvWe4msvV3DRdpWciRULSuFBZUfotSBpBtQ= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com; spf=pass smtp.mailfrom=huawei.com; arc=none smtp.client-ip=45.249.212.189 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=huawei.com Received: from mail.maildlp.com (unknown [172.19.88.105]) by szxga03-in.huawei.com (SkyGuard) with ESMTP id 4YcdJ270mszRlkD; Tue, 21 Jan 2025 14:55:14 +0800 (CST) Received: from dggemv711-chm.china.huawei.com (unknown [10.1.198.66]) by mail.maildlp.com (Postfix) with ESMTPS id 1762D140155; Tue, 21 Jan 2025 14:57:44 +0800 (CST) Received: from kwepemn100009.china.huawei.com (7.202.194.112) by dggemv711-chm.china.huawei.com (10.1.198.66) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.39; Tue, 21 Jan 2025 14:57:43 +0800 Received: from localhost.localdomain (10.28.79.22) by kwepemn100009.china.huawei.com (7.202.194.112) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.11; Tue, 21 Jan 2025 14:57:42 +0800 From: Huisong Li To: CC: , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , Subject: [PATCH v1 17/21] hwmon: (tmp421) Fix the type of 'config' in struct hwmon_channel_info to u64 Date: Tue, 21 Jan 2025 14:45:15 +0800 Message-ID: <20250121064519.18974-18-lihuisong@huawei.com> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20250121064519.18974-1-lihuisong@huawei.com> References: <20250121064519.18974-1-lihuisong@huawei.com> Precedence: bulk X-Mailing-List: linux-hwmon@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-ClientProxiedBy: dggems706-chm.china.huawei.com (10.3.19.183) To kwepemn100009.china.huawei.com (7.202.194.112) The type of 'config' in struct hwmon_channel_info has been fixed to u64. Modify the related code in driver to avoid compiling failure. Signed-off-by: Huisong Li --- drivers/hwmon/tmp421.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/hwmon/tmp421.c b/drivers/hwmon/tmp421.c index 9537727aad9a..45bd04ec03b8 100644 --- a/drivers/hwmon/tmp421.c +++ b/drivers/hwmon/tmp421.c @@ -100,7 +100,7 @@ struct tmp421_channel { struct tmp421_data { struct i2c_client *client; struct mutex update_lock; - u32 temp_config[MAX_CHANNELS + 1]; + u64 temp_config[MAX_CHANNELS + 1]; struct hwmon_channel_info temp_info; const struct hwmon_channel_info *info[2]; struct hwmon_chip_info chip; From patchwork Tue Jan 21 06:45:16 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "lihuisong (C)" X-Patchwork-Id: 13945794 Received: from szxga02-in.huawei.com (szxga02-in.huawei.com [45.249.212.188]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E33991B218B; Tue, 21 Jan 2025 06:57:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=45.249.212.188 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737442669; cv=none; b=rxO//DPbqtzHJ7S9elTdnWGQh5DTCsIGlrLnfQQX1GPrml37wAQld73MbFi0mu97XoDs1RJFlMqANCjHEHWCuH6KGnIhmVzCoatnFBVyXRB0djrBHdbbWOzDYWK1aucWM8HoeKgXGLGO2CRUp9kIceJslPNM7uW+0JNk3ubppAU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737442669; c=relaxed/simple; bh=3EkVz02jQnSqLYxB/Hwwe223CTvBiIcVa+DqBc+/ipY=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=sYPVQi6PO2qSVsECMxccxZz+WHiiAcN1ZWFueWZccB2oe7fe07bI8hxiSQXyYMMLKlKHchJGonIS1h6xbrSzlvgpAte5lx6uvMVI+5zqXheaz7dQdamWyXdo8tzVJSHqdcEAr8Bs88JbFN3WQ/NlHVtv0GRgYSZpfWsIh4JLXFU= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com; spf=pass smtp.mailfrom=huawei.com; arc=none smtp.client-ip=45.249.212.188 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=huawei.com Received: from mail.maildlp.com (unknown [172.19.163.252]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4YcdHG4ZBczgbt5; Tue, 21 Jan 2025 14:54:34 +0800 (CST) Received: from dggemv704-chm.china.huawei.com (unknown [10.3.19.47]) by mail.maildlp.com (Postfix) with ESMTPS id 7A2FE1800D1; Tue, 21 Jan 2025 14:57:45 +0800 (CST) Received: from kwepemn100009.china.huawei.com (7.202.194.112) by dggemv704-chm.china.huawei.com (10.3.19.47) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.39; Tue, 21 Jan 2025 14:57:45 +0800 Received: from localhost.localdomain (10.28.79.22) by kwepemn100009.china.huawei.com (7.202.194.112) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.11; Tue, 21 Jan 2025 14:57:43 +0800 From: Huisong Li To: CC: , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , Subject: [PATCH v1 18/21] net/mlx5: Fix the type of 'config' in struct hwmon_channel_info to u64 Date: Tue, 21 Jan 2025 14:45:16 +0800 Message-ID: <20250121064519.18974-19-lihuisong@huawei.com> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20250121064519.18974-1-lihuisong@huawei.com> References: <20250121064519.18974-1-lihuisong@huawei.com> Precedence: bulk X-Mailing-List: linux-hwmon@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-ClientProxiedBy: dggems706-chm.china.huawei.com (10.3.19.183) To kwepemn100009.china.huawei.com (7.202.194.112) The type of 'config' in struct hwmon_channel_info has been fixed to u64. Modify the related code in driver to avoid compiling failure. Signed-off-by: Huisong Li --- drivers/net/ethernet/mellanox/mlx5/core/hwmon.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/net/ethernet/mellanox/mlx5/core/hwmon.c b/drivers/net/ethernet/mellanox/mlx5/core/hwmon.c index 353f81dccd1c..fe39b97d214e 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/hwmon.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/hwmon.c @@ -30,9 +30,9 @@ struct mlx5_hwmon { struct mlx5_core_dev *mdev; struct device *hwmon_dev; struct hwmon_channel_info chip_info; - u32 chip_channel_config[CHIP_CONFIG_NUM + 1]; + u64 chip_channel_config[CHIP_CONFIG_NUM + 1]; struct hwmon_channel_info temp_info; - u32 *temp_channel_config; + u64 *temp_channel_config; const struct hwmon_channel_info *channel_info[CHANNELS_TYPE_NUM + 1]; struct hwmon_chip_info chip; struct temp_channel_desc *temp_channel_desc; @@ -233,14 +233,14 @@ static void mlx5_hwmon_channel_info_init(struct mlx5_hwmon *hwmon) hwmon->channel_info[1] = &hwmon->temp_info; hwmon->chip_channel_config[0] = HWMON_C_REGISTER_TZ; - hwmon->chip_info.config = (const u32 *)hwmon->chip_channel_config; + hwmon->chip_info.config = (const u64 *)hwmon->chip_channel_config; hwmon->chip_info.type = hwmon_chip; for (i = 0; i < hwmon->asic_platform_scount + hwmon->module_scount; i++) hwmon->temp_channel_config[i] = HWMON_T_INPUT | HWMON_T_HIGHEST | HWMON_T_CRIT | HWMON_T_RESET_HISTORY | HWMON_T_LABEL; - hwmon->temp_info.config = (const u32 *)hwmon->temp_channel_config; + hwmon->temp_info.config = (const u64 *)hwmon->temp_channel_config; hwmon->temp_info.type = hwmon_temp; } From patchwork Tue Jan 21 06:45:17 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "lihuisong (C)" X-Patchwork-Id: 13945795 Received: from szxga05-in.huawei.com (szxga05-in.huawei.com [45.249.212.191]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 493591F4737; Tue, 21 Jan 2025 06:57:49 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=45.249.212.191 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737442671; cv=none; b=iTyzS8GMB0toAN/smhvy8ZLSIc6cMs7M4pxhodjvP2IjTgNHtwEZifjhQdhjfGZrr0FoMAfKdAjy7IAxtB4o1z1ynOoJeLbfwTz1+N9EVWvfvgV6wTQ3qQPDjJlD6UMi12GA5pRYvFNWEVWCNPK2w87O2/Lsb/+4hGJVW+N3L38= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737442671; c=relaxed/simple; bh=CY/LA6wV3F32vjCuvAOt1fgOjyoJxl6MWIXDZZK3KrY=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=Gy2Y7POAsXmf3tRJfVxIRGhidM3G0l+P93Dj8oMa6leiF4NPovqF3L5YW0j4sLpMNBRbcarhZKnwBqNaKSTjH2+QuC6Ho24kXymF329GXuOpdBAxl4rTqyyaEeBSbGv1zlMC9DdGaZIIj43TRxK5boBXPogZln8LvF7C+mI/VR0= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com; spf=pass smtp.mailfrom=huawei.com; arc=none smtp.client-ip=45.249.212.191 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=huawei.com Received: from mail.maildlp.com (unknown [172.19.88.214]) by szxga05-in.huawei.com (SkyGuard) with ESMTP id 4YcdH92N4Cz1kysr; Tue, 21 Jan 2025 14:54:29 +0800 (CST) Received: from dggemv703-chm.china.huawei.com (unknown [10.3.19.46]) by mail.maildlp.com (Postfix) with ESMTPS id D91471A016C; Tue, 21 Jan 2025 14:57:46 +0800 (CST) Received: from kwepemn100009.china.huawei.com (7.202.194.112) by dggemv703-chm.china.huawei.com (10.3.19.46) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.39; Tue, 21 Jan 2025 14:57:46 +0800 Received: from localhost.localdomain (10.28.79.22) by kwepemn100009.china.huawei.com (7.202.194.112) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.11; Tue, 21 Jan 2025 14:57:45 +0800 From: Huisong Li To: CC: , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , Subject: [PATCH v1 19/21] platform/x86: dell-ddv: Fix the type of 'config' in struct hwmon_channel_info to u64 Date: Tue, 21 Jan 2025 14:45:17 +0800 Message-ID: <20250121064519.18974-20-lihuisong@huawei.com> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20250121064519.18974-1-lihuisong@huawei.com> References: <20250121064519.18974-1-lihuisong@huawei.com> Precedence: bulk X-Mailing-List: linux-hwmon@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-ClientProxiedBy: dggems706-chm.china.huawei.com (10.3.19.183) To kwepemn100009.china.huawei.com (7.202.194.112) The type of 'config' in struct hwmon_channel_info has been fixed to u64. Modify the related code in driver to avoid compiling failure. Signed-off-by: Huisong Li --- drivers/platform/x86/dell/dell-wmi-ddv.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/platform/x86/dell/dell-wmi-ddv.c b/drivers/platform/x86/dell/dell-wmi-ddv.c index e75cd6e1efe6..efb2278aabb9 100644 --- a/drivers/platform/x86/dell/dell-wmi-ddv.c +++ b/drivers/platform/x86/dell/dell-wmi-ddv.c @@ -86,7 +86,7 @@ struct thermal_sensor_entry { struct combined_channel_info { struct hwmon_channel_info info; - u32 config[]; + u64 config[]; }; struct combined_chip_info { @@ -500,7 +500,7 @@ static const struct hwmon_ops dell_wmi_ddv_ops = { static struct hwmon_channel_info *dell_wmi_ddv_channel_create(struct device *dev, u64 count, enum hwmon_sensor_types type, - u32 config) + u64 config) { struct combined_channel_info *cinfo; int i; @@ -543,7 +543,7 @@ static struct hwmon_channel_info *dell_wmi_ddv_channel_init(struct wmi_device *w struct dell_wmi_ddv_sensors *sensors, size_t entry_size, enum hwmon_sensor_types type, - u32 config) + u64 config) { struct hwmon_channel_info *info; int ret; From patchwork Tue Jan 21 06:45:18 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "lihuisong (C)" X-Patchwork-Id: 13945797 Received: from szxga07-in.huawei.com (szxga07-in.huawei.com [45.249.212.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B3A921F4721; Tue, 21 Jan 2025 06:57:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=45.249.212.35 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737442673; cv=none; b=jgM5+U2Jv0O6JIWFWJvKBsIKUOI6du+F2acZauPRJXPwNhgmbnZ2FONsMwny8O10NVyJdNi+Je6YgQOHXQ/BfcVpAjvBJTbqFVy+rG4xLZa+vSlSxcx1bCgykyCuzsWSf5rsK2phHtLhI+s++S/vWICbqk3PzsKymJ4v7oVo2C4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737442673; c=relaxed/simple; bh=0ao+MPNNhgn9hCP05EgHBrPet8ca4uc5weVhLKMjyXw=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=Ipd8UPabcMjYidJ1XZMo8Jfpf1c8HSmwMp6Cyl2IgloIFcLtPmRh/nMnvIKU5+oUDuH3g0vQzSekF7tBlnDfRnQQb7DRJ7B9++oDJNCqjvf6Pb9KzyWAl2QkSpQRrmh2+MCNfgbZEf72RuRaXC2ZhT0OsxDDUCYzP+r7AETARK0= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com; spf=pass smtp.mailfrom=huawei.com; arc=none smtp.client-ip=45.249.212.35 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=huawei.com Received: from mail.maildlp.com (unknown [172.19.162.112]) by szxga07-in.huawei.com (SkyGuard) with ESMTP id 4YcdHB002Gz1V5Kp; Tue, 21 Jan 2025 14:54:29 +0800 (CST) Received: from dggemv705-chm.china.huawei.com (unknown [10.3.19.32]) by mail.maildlp.com (Postfix) with ESMTPS id 52BCB1402C3; Tue, 21 Jan 2025 14:57:48 +0800 (CST) Received: from kwepemn100009.china.huawei.com (7.202.194.112) by dggemv705-chm.china.huawei.com (10.3.19.32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.11; Tue, 21 Jan 2025 14:57:48 +0800 Received: from localhost.localdomain (10.28.79.22) by kwepemn100009.china.huawei.com (7.202.194.112) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.11; Tue, 21 Jan 2025 14:57:46 +0800 From: Huisong Li To: CC: , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , Subject: [PATCH v1 20/21] hwmon: (asus-ec-sensors) Fix the type of 'config' in struct hwmon_channel_info to u64 Date: Tue, 21 Jan 2025 14:45:18 +0800 Message-ID: <20250121064519.18974-21-lihuisong@huawei.com> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20250121064519.18974-1-lihuisong@huawei.com> References: <20250121064519.18974-1-lihuisong@huawei.com> Precedence: bulk X-Mailing-List: linux-hwmon@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-ClientProxiedBy: dggems706-chm.china.huawei.com (10.3.19.183) To kwepemn100009.china.huawei.com (7.202.194.112) The type of 'config' in struct hwmon_channel_info has been fixed to u64. Modify the related code in driver to avoid compiling failure. Signed-off-by: Huisong Li --- drivers/hwmon/asus-ec-sensors.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/hwmon/asus-ec-sensors.c b/drivers/hwmon/asus-ec-sensors.c index 43e54dc513da..a4e0a2975a3a 100644 --- a/drivers/hwmon/asus-ec-sensors.c +++ b/drivers/hwmon/asus-ec-sensors.c @@ -77,7 +77,7 @@ typedef union { .value = (size << 16) + (bank << 8) + index \ } -static u32 hwmon_attributes[hwmon_max] = { +static u64 hwmon_attributes[hwmon_max] = { [hwmon_chip] = HWMON_C_REGISTER_TZ, [hwmon_temp] = HWMON_T_INPUT | HWMON_T_LABEL, [hwmon_in] = HWMON_I_INPUT | HWMON_I_LABEL, @@ -940,10 +940,10 @@ static umode_t asus_ec_hwmon_is_visible(const void *drvdata, static int asus_ec_hwmon_add_chan_info(struct hwmon_channel_info *asus_ec_hwmon_chan, struct device *dev, int num, - enum hwmon_sensor_types type, u32 config) + enum hwmon_sensor_types type, u64 config) { int i; - u32 *cfg = devm_kcalloc(dev, num + 1, sizeof(*cfg), GFP_KERNEL); + u64 *cfg = devm_kcalloc(dev, num + 1, sizeof(*cfg), GFP_KERNEL); if (!cfg) return -ENOMEM; From patchwork Tue Jan 21 06:45:19 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "lihuisong (C)" X-Patchwork-Id: 13945798 Received: from szxga07-in.huawei.com (szxga07-in.huawei.com [45.249.212.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 210B61F5438; Tue, 21 Jan 2025 06:57:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=45.249.212.35 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737442673; cv=none; b=skZ/8YH75J21pvjW2zvh4jCkG8rHr4HWCfYEXN/NiMwhMM4IsLH0yPMqgzU7d0SbpKatuCtql+BwksdKyuvX7SB7c/70C348aMYUI0SpVgDhi53SFnA5qrOhc8VMX09s8kieZa7X0M/GlxjKIlTgy5QJEZ4gZd+/6K6h1LD9kzg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737442673; c=relaxed/simple; bh=YkRd+xHCLD6q0d2S2JBzbICmoqmN0zwFRptJFB4Cdfs=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=BOFL3dPRhJL4PBjSC9y3v0zgFIfJqdcMjezgazdWwXBgDYDi/Drl7C4Ex37LhhMJykUOgWzwG+seCjwIYIumaYuUX8/5gzpA6fzm92wuNZh49jJXhV28RYwn0pL210rSSFhLPg4wUUSn7WlUHxOZYiGy+LGvCOkh+YsvyDrpSJ0= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com; spf=pass smtp.mailfrom=huawei.com; arc=none smtp.client-ip=45.249.212.35 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=huawei.com Received: from mail.maildlp.com (unknown [172.19.88.234]) by szxga07-in.huawei.com (SkyGuard) with ESMTP id 4YcdHC3g37z1V5L4; Tue, 21 Jan 2025 14:54:31 +0800 (CST) Received: from dggemv706-chm.china.huawei.com (unknown [10.3.19.33]) by mail.maildlp.com (Postfix) with ESMTPS id C910B1400D5; Tue, 21 Jan 2025 14:57:49 +0800 (CST) Received: from kwepemn100009.china.huawei.com (7.202.194.112) by dggemv706-chm.china.huawei.com (10.3.19.33) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.11; Tue, 21 Jan 2025 14:57:49 +0800 Received: from localhost.localdomain (10.28.79.22) by kwepemn100009.china.huawei.com (7.202.194.112) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.11; Tue, 21 Jan 2025 14:57:47 +0800 From: Huisong Li To: CC: , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , Subject: [PATCH v1 21/21] hwmon: (lm90) Fix the type of 'config' in struct hwmon_channel_info to u64 Date: Tue, 21 Jan 2025 14:45:19 +0800 Message-ID: <20250121064519.18974-22-lihuisong@huawei.com> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20250121064519.18974-1-lihuisong@huawei.com> References: <20250121064519.18974-1-lihuisong@huawei.com> Precedence: bulk X-Mailing-List: linux-hwmon@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-ClientProxiedBy: dggems706-chm.china.huawei.com (10.3.19.183) To kwepemn100009.china.huawei.com (7.202.194.112) The type of 'config' in struct hwmon_channel_info has been fixed to u64. Modify the related code in driver to avoid compiling failure. Signed-off-by: Huisong Li --- drivers/hwmon/lm90.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/hwmon/lm90.c b/drivers/hwmon/lm90.c index 511d95a0efb3..dbb9d976284f 100644 --- a/drivers/hwmon/lm90.c +++ b/drivers/hwmon/lm90.c @@ -685,8 +685,8 @@ enum lm90_temp_reg_index { struct lm90_data { struct i2c_client *client; struct device *hwmon_dev; - u32 chip_config[2]; - u32 channel_config[MAX_CHANNELS + 1]; + u64 chip_config[2]; + u64 channel_config[MAX_CHANNELS + 1]; const char *channel_label[MAX_CHANNELS]; struct hwmon_channel_info chip_info; struct hwmon_channel_info temp_info;