From: kernel test robot <lkp@intel.com>
To: oe-kbuild@lists.linux.dev
Cc: lkp@intel.com
Subject: Re: [PATCH v2 3/8] power: reset: Introduce PSCR Recording Framework for Non-Volatile Storage
Date: Sun, 28 Jan 2024 07:31:22 +0800 [thread overview]
Message-ID: <202401280712.O6FEvsAC-lkp@intel.com> (raw)
::::::
:::::: Manual check reason: "low confidence static check warning: drivers/power/reset/pscrr.c:132:9: sparse: sparse: statement expected after case label"
::::::
BCC: lkp@intel.com
CC: oe-kbuild-all@lists.linux.dev
In-Reply-To: <20240124122204.730370-4-o.rempel@pengutronix.de>
References: <20240124122204.730370-4-o.rempel@pengutronix.de>
TO: Oleksij Rempel <o.rempel@pengutronix.de>
TO: Sebastian Reichel <sre@kernel.org>
TO: Rob Herring <robh+dt@kernel.org>
TO: Krzysztof Kozlowski <krzk@kernel.org>
TO: Conor Dooley <conor+dt@kernel.org>
TO: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
CC: Oleksij Rempel <o.rempel@pengutronix.de>
CC: kernel@pengutronix.de
CC: linux-kernel@vger.kernel.org
CC: Liam Girdwood <lgirdwood@gmail.com>
CC: Mark Brown <broonie@kernel.org>
CC: "Rafael J. Wysocki" <rafael@kernel.org>
CC: Daniel Lezcano <daniel.lezcano@linaro.org>
CC: Zhang Rui <rui.zhang@intel.com>
CC: Lukasz Luba <lukasz.luba@arm.com>
CC: linux-pm@vger.kernel.org
CC: devicetree@vger.kernel.org
CC: "Søren Andersen" <san@skov.dk>
Hi Oleksij,
kernel test robot noticed the following build warnings:
[auto build test WARNING on robh/for-next]
[also build test WARNING on broonie-regulator/for-next rafael-pm/thermal linus/master v6.8-rc1 next-20240125]
[cannot apply to sre-power-supply/for-next]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]
url: https://github.com/intel-lab-lkp/linux/commits/Oleksij-Rempel/power-Extend-power_on_reason-h-for-upcoming-PSCRR-framework/20240124-202833
base: https://git.kernel.org/pub/scm/linux/kernel/git/robh/linux.git for-next
patch link: https://lore.kernel.org/r/20240124122204.730370-4-o.rempel%40pengutronix.de
patch subject: [PATCH v2 3/8] power: reset: Introduce PSCR Recording Framework for Non-Volatile Storage
:::::: branch date: 3 days ago
:::::: commit date: 3 days ago
config: i386-randconfig-062-20240128 (https://download.01.org/0day-ci/archive/20240128/202401280712.O6FEvsAC-lkp@intel.com/config)
compiler: clang version 17.0.6 (https://github.com/llvm/llvm-project 6009708b4367171ccdbf4b5905cb6a803753fe18)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240128/202401280712.O6FEvsAC-lkp@intel.com/reproduce)
If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/r/202401280712.O6FEvsAC-lkp@intel.com/
sparse warnings: (new ones prefixed by >>)
>> drivers/power/reset/pscrr.c:132:9: sparse: sparse: statement expected after case label
>> drivers/power/reset/pscrr.c:20:11: sparse: sparse: symbol 'system_pscr' was not declared. Should it be static?
>> drivers/power/reset/pscrr.c:57:17: sparse: sparse: symbol 'pscr_map_table' was not declared. Should it be static?
drivers/power/reset/pscrr.c: note: in included file (through include/linux/mmzone.h, include/linux/gfp.h, include/linux/xarray.h, ...):
include/linux/page-flags.h:242:46: sparse: sparse: self-comparison always evaluates to false
vim +132 drivers/power/reset/pscrr.c
3f484eec6730bd Oleksij Rempel 2024-01-24 19
3f484eec6730bd Oleksij Rempel 2024-01-24 @20 enum pscr system_pscr;
3f484eec6730bd Oleksij Rempel 2024-01-24 21
3f484eec6730bd Oleksij Rempel 2024-01-24 22 /*
3f484eec6730bd Oleksij Rempel 2024-01-24 23 * struct pscr_to_magic_entry - Entry for mapping PSCR to magic values.
3f484eec6730bd Oleksij Rempel 2024-01-24 24 *
3f484eec6730bd Oleksij Rempel 2024-01-24 25 * This structure represents a single entry in a list that maps Power State
3f484eec6730bd Oleksij Rempel 2024-01-24 26 * Change Reason (PSCR) values to corresponding magic values. Each entry
3f484eec6730bd Oleksij Rempel 2024-01-24 27 * associates a specific PSCR with a unique magic value, facilitating easy
3f484eec6730bd Oleksij Rempel 2024-01-24 28 * translation between the two.
3f484eec6730bd Oleksij Rempel 2024-01-24 29 *
3f484eec6730bd Oleksij Rempel 2024-01-24 30 * @pscr: The PSCR value.
3f484eec6730bd Oleksij Rempel 2024-01-24 31 * @magic: The corresponding magic value.
3f484eec6730bd Oleksij Rempel 2024-01-24 32 * @list: List head for chaining multiple such entries.
3f484eec6730bd Oleksij Rempel 2024-01-24 33 */
3f484eec6730bd Oleksij Rempel 2024-01-24 34 struct pscr_to_magic_entry {
3f484eec6730bd Oleksij Rempel 2024-01-24 35 enum pscr pscr;
3f484eec6730bd Oleksij Rempel 2024-01-24 36 u32 magic;
3f484eec6730bd Oleksij Rempel 2024-01-24 37 struct list_head list;
3f484eec6730bd Oleksij Rempel 2024-01-24 38 };
3f484eec6730bd Oleksij Rempel 2024-01-24 39
3f484eec6730bd Oleksij Rempel 2024-01-24 40 /*
3f484eec6730bd Oleksij Rempel 2024-01-24 41 * struct pscr_map - Maps device tree property names to PSCR values.
3f484eec6730bd Oleksij Rempel 2024-01-24 42 *
3f484eec6730bd Oleksij Rempel 2024-01-24 43 * @dt_prop_name: Device tree property name without the "pscr-" prefix.
3f484eec6730bd Oleksij Rempel 2024-01-24 44 * @pscr: The corresponding PSCR enum value for the given property name.
3f484eec6730bd Oleksij Rempel 2024-01-24 45 */
3f484eec6730bd Oleksij Rempel 2024-01-24 46 struct pscr_map {
3f484eec6730bd Oleksij Rempel 2024-01-24 47 const char *dt_prop_name;
3f484eec6730bd Oleksij Rempel 2024-01-24 48 enum pscr pscr;
3f484eec6730bd Oleksij Rempel 2024-01-24 49 };
3f484eec6730bd Oleksij Rempel 2024-01-24 50
3f484eec6730bd Oleksij Rempel 2024-01-24 51 /*
3f484eec6730bd Oleksij Rempel 2024-01-24 52 * struct pscr_map - Maps shortened DT property names to PSCR values.
3f484eec6730bd Oleksij Rempel 2024-01-24 53 *
3f484eec6730bd Oleksij Rempel 2024-01-24 54 * This structure maps device tree property names, with the "pscr-" prefix
3f484eec6730bd Oleksij Rempel 2024-01-24 55 * omitted, to their corresponding Power State Change Reason (PSCR) values.
3f484eec6730bd Oleksij Rempel 2024-01-24 56 */
3f484eec6730bd Oleksij Rempel 2024-01-24 @57 struct pscr_map pscr_map_table[] = {
3f484eec6730bd Oleksij Rempel 2024-01-24 58 { "under-voltage", PSCR_UNDER_VOLTAGE },
3f484eec6730bd Oleksij Rempel 2024-01-24 59 { "over-current", PSCR_OVER_CURRENT },
3f484eec6730bd Oleksij Rempel 2024-01-24 60 { "regulator-failure", PSCR_REGULATOR_FAILURE },
3f484eec6730bd Oleksij Rempel 2024-01-24 61 { "over-temperature", PSCR_OVERTEMPERATURE },
3f484eec6730bd Oleksij Rempel 2024-01-24 62 };
3f484eec6730bd Oleksij Rempel 2024-01-24 63
3f484eec6730bd Oleksij Rempel 2024-01-24 64 /*
3f484eec6730bd Oleksij Rempel 2024-01-24 65 * pscr_find_from_dt_name - Finds the PSCR value for a given DT property name.
3f484eec6730bd Oleksij Rempel 2024-01-24 66 *
3f484eec6730bd Oleksij Rempel 2024-01-24 67 * @dt_prop_name: The device tree property name, without the "pscr-" prefix, to
3f484eec6730bd Oleksij Rempel 2024-01-24 68 * look up.
3f484eec6730bd Oleksij Rempel 2024-01-24 69 * Returns the corresponding PSCR value or -ENOENT if not found.
3f484eec6730bd Oleksij Rempel 2024-01-24 70 */
3f484eec6730bd Oleksij Rempel 2024-01-24 71 static int find_pscr_by_string(const char *dt_prop_name)
3f484eec6730bd Oleksij Rempel 2024-01-24 72 {
3f484eec6730bd Oleksij Rempel 2024-01-24 73 int i;
3f484eec6730bd Oleksij Rempel 2024-01-24 74
3f484eec6730bd Oleksij Rempel 2024-01-24 75 for (i = 0; i < ARRAY_SIZE(pscr_map_table); i++) {
3f484eec6730bd Oleksij Rempel 2024-01-24 76 if (!strcmp(dt_prop_name, pscr_map_table[i].dt_prop_name))
3f484eec6730bd Oleksij Rempel 2024-01-24 77 return pscr_map_table[i].pscr;
3f484eec6730bd Oleksij Rempel 2024-01-24 78 }
3f484eec6730bd Oleksij Rempel 2024-01-24 79
3f484eec6730bd Oleksij Rempel 2024-01-24 80 return -ENOENT;
3f484eec6730bd Oleksij Rempel 2024-01-24 81 }
3f484eec6730bd Oleksij Rempel 2024-01-24 82
3f484eec6730bd Oleksij Rempel 2024-01-24 83 static enum pscr get_pscr_by_magic(struct pscrr_device *pscrr_dev, u32 magic)
3f484eec6730bd Oleksij Rempel 2024-01-24 84 {
3f484eec6730bd Oleksij Rempel 2024-01-24 85 struct pscr_to_magic_entry *map_entry;
3f484eec6730bd Oleksij Rempel 2024-01-24 86
3f484eec6730bd Oleksij Rempel 2024-01-24 87 list_for_each_entry(map_entry, &pscrr_dev->pscr_map_list, list) {
3f484eec6730bd Oleksij Rempel 2024-01-24 88 if (map_entry->magic == magic)
3f484eec6730bd Oleksij Rempel 2024-01-24 89 return map_entry->pscr;
3f484eec6730bd Oleksij Rempel 2024-01-24 90 }
3f484eec6730bd Oleksij Rempel 2024-01-24 91
3f484eec6730bd Oleksij Rempel 2024-01-24 92 return 0;
3f484eec6730bd Oleksij Rempel 2024-01-24 93 }
3f484eec6730bd Oleksij Rempel 2024-01-24 94
3f484eec6730bd Oleksij Rempel 2024-01-24 95 static u32 get_magic_by_pscr(struct pscrr_device *pscrr_dev, enum pscr pscr)
3f484eec6730bd Oleksij Rempel 2024-01-24 96 {
3f484eec6730bd Oleksij Rempel 2024-01-24 97 struct pscr_to_magic_entry *map_entry;
3f484eec6730bd Oleksij Rempel 2024-01-24 98
3f484eec6730bd Oleksij Rempel 2024-01-24 99 list_for_each_entry(map_entry, &pscrr_dev->pscr_map_list, list) {
3f484eec6730bd Oleksij Rempel 2024-01-24 100 if (map_entry->pscr == pscr)
3f484eec6730bd Oleksij Rempel 2024-01-24 101 return map_entry->magic;
3f484eec6730bd Oleksij Rempel 2024-01-24 102 }
3f484eec6730bd Oleksij Rempel 2024-01-24 103
3f484eec6730bd Oleksij Rempel 2024-01-24 104 return 0;
3f484eec6730bd Oleksij Rempel 2024-01-24 105 }
3f484eec6730bd Oleksij Rempel 2024-01-24 106
3f484eec6730bd Oleksij Rempel 2024-01-24 107 /**
3f484eec6730bd Oleksij Rempel 2024-01-24 108 * set_power_state_change_reason() - Set the system's power state change reason
3f484eec6730bd Oleksij Rempel 2024-01-24 109 * @pscr: The enum value representing the power state change reason
3f484eec6730bd Oleksij Rempel 2024-01-24 110 *
3f484eec6730bd Oleksij Rempel 2024-01-24 111 * This function sets the system's power state change reason based on the
3f484eec6730bd Oleksij Rempel 2024-01-24 112 * provided enum value.
3f484eec6730bd Oleksij Rempel 2024-01-24 113 */
3f484eec6730bd Oleksij Rempel 2024-01-24 114 void set_power_state_change_reason(enum pscr pscr)
3f484eec6730bd Oleksij Rempel 2024-01-24 115 {
3f484eec6730bd Oleksij Rempel 2024-01-24 116 system_pscr = pscr;
3f484eec6730bd Oleksij Rempel 2024-01-24 117 }
3f484eec6730bd Oleksij Rempel 2024-01-24 118 EXPORT_SYMBOL_GPL(set_power_state_change_reason);
3f484eec6730bd Oleksij Rempel 2024-01-24 119
3f484eec6730bd Oleksij Rempel 2024-01-24 120 static const char *pscr_to_por_string(enum pscr pscr)
3f484eec6730bd Oleksij Rempel 2024-01-24 121 {
3f484eec6730bd Oleksij Rempel 2024-01-24 122 switch (pscr) {
3f484eec6730bd Oleksij Rempel 2024-01-24 123 case PSCR_UNDER_VOLTAGE:
3f484eec6730bd Oleksij Rempel 2024-01-24 124 return POWER_ON_REASON_BROWN_OUT;
3f484eec6730bd Oleksij Rempel 2024-01-24 125 case PSCR_OVER_CURRENT:
3f484eec6730bd Oleksij Rempel 2024-01-24 126 return POWER_ON_REASON_OVER_CURRENT;
3f484eec6730bd Oleksij Rempel 2024-01-24 127 case PSCR_REGULATOR_FAILURE:
3f484eec6730bd Oleksij Rempel 2024-01-24 128 return POWER_ON_REASON_REGULATOR_FAILURE;
3f484eec6730bd Oleksij Rempel 2024-01-24 129 case PSCR_OVERTEMPERATURE:
3f484eec6730bd Oleksij Rempel 2024-01-24 130 return POWER_ON_REASON_OVERTEMPERATURE;
3f484eec6730bd Oleksij Rempel 2024-01-24 131 default:
3f484eec6730bd Oleksij Rempel 2024-01-24 @132 }
3f484eec6730bd Oleksij Rempel 2024-01-24 133
3f484eec6730bd Oleksij Rempel 2024-01-24 134 return POWER_ON_REASON_UNKNOWN;
3f484eec6730bd Oleksij Rempel 2024-01-24 135 }
3f484eec6730bd Oleksij Rempel 2024-01-24 136
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
next reply other threads:[~2024-01-27 23:32 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-01-27 23:31 kernel test robot [this message]
-- strict thread matches above, loose matches on Subject: below --
2024-01-24 12:21 [RFC PATCH v1 0/8] Introduction of PSCR Framework and Related Components Oleksij Rempel
2024-01-24 12:21 ` [PATCH v2 3/8] power: reset: Introduce PSCR Recording Framework for Non-Volatile Storage Oleksij Rempel
2024-01-28 9:05 ` kernel test robot
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=202401280712.O6FEvsAC-lkp@intel.com \
--to=lkp@intel.com \
--cc=oe-kbuild@lists.linux.dev \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.