From: Dan Carpenter <dan.carpenter@linaro.org>
To: oe-kbuild@lists.linux.dev,
Pengjie Zhang <zhangpengjie2@huawei.com>,
myungjoo.ham@samsung.com, kyungmin.park@samsung.com,
cw00.choi@samsung.com
Cc: lkp@intel.com, oe-kbuild-all@lists.linux.dev,
linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org,
zhanjie9@hisilicon.com, zhenglifeng1@huawei.com,
lihuisong@huawei.com, yubowen8@huawei.com,
linhongye@h-partners.com, linuxarm@huawei.com,
jonathan.cameron@huawei.com, zhangpengjie2@huawei.com
Subject: Re: [PATCH] PM / devfreq: use _visible attribute to replace create/remove_sysfs_files()
Date: Mon, 27 Oct 2025 17:12:00 +0300 [thread overview]
Message-ID: <202510272106.x7zgW7pK-lkp@intel.com> (raw)
In-Reply-To: <20251025135238.3576861-1-zhangpengjie2@huawei.com>
Hi Pengjie,
kernel test robot noticed the following build warnings:
https://git-scm.com/docs/git-format-patch#_base_tree_information]
url: https://github.com/intel-lab-lkp/linux/commits/Pengjie-Zhang/PM-devfreq-use-_visible-attribute-to-replace-create-remove_sysfs_files/20251025-215510
base: https://git.kernel.org/pub/scm/linux/kernel/git/chanwoo/linux.git devfreq-testing
patch link: https://lore.kernel.org/r/20251025135238.3576861-1-zhangpengjie2%40huawei.com
patch subject: [PATCH] PM / devfreq: use _visible attribute to replace create/remove_sysfs_files()
config: loongarch-randconfig-r072-20251026 (https://download.01.org/0day-ci/archive/20251027/202510272106.x7zgW7pK-lkp@intel.com/config)
compiler: clang version 22.0.0git (https://github.com/llvm/llvm-project e1ae12640102fd2b05bc567243580f90acb1135f)
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>
| Reported-by: Dan Carpenter <dan.carpenter@linaro.org>
| Closes: https://lore.kernel.org/r/202510272106.x7zgW7pK-lkp@intel.com/
smatch warnings:
drivers/devfreq/devfreq.c:1927 timer_store() warn: inconsistent returns 'global &devfreq_list_lock'.
vim +1927 drivers/devfreq/devfreq.c
4dc3bab8687f1e Chanwoo Choi 2020-07-02 1874 static ssize_t timer_store(struct device *dev, struct device_attribute *attr,
4dc3bab8687f1e Chanwoo Choi 2020-07-02 1875 const char *buf, size_t count)
4dc3bab8687f1e Chanwoo Choi 2020-07-02 1876 {
4dc3bab8687f1e Chanwoo Choi 2020-07-02 1877 struct devfreq *df = to_devfreq(dev);
4dc3bab8687f1e Chanwoo Choi 2020-07-02 1878 char str_timer[DEVFREQ_NAME_LEN + 1];
4dc3bab8687f1e Chanwoo Choi 2020-07-02 1879 int timer = -1;
4dc3bab8687f1e Chanwoo Choi 2020-07-02 1880 int ret = 0, i;
4dc3bab8687f1e Chanwoo Choi 2020-07-02 1881
88ea5f098ddcf4 Pengjie Zhang 2025-10-25 1882 mutex_lock(&devfreq_list_lock);
88ea5f098ddcf4 Pengjie Zhang 2025-10-25 1883 if (!df->governor || !df->profile ||
88ea5f098ddcf4 Pengjie Zhang 2025-10-25 1884 !IS_SUPPORTED_ATTR(df->governor->attrs, TIMER)) {
88ea5f098ddcf4 Pengjie Zhang 2025-10-25 1885 mutex_unlock(&devfreq_list_lock);
4dc3bab8687f1e Chanwoo Choi 2020-07-02 1886 return -EINVAL;
88ea5f098ddcf4 Pengjie Zhang 2025-10-25 1887 }
4dc3bab8687f1e Chanwoo Choi 2020-07-02 1888
4dc3bab8687f1e Chanwoo Choi 2020-07-02 1889 ret = sscanf(buf, "%16s", str_timer);
4dc3bab8687f1e Chanwoo Choi 2020-07-02 1890 if (ret != 1)
4dc3bab8687f1e Chanwoo Choi 2020-07-02 1891 return -EINVAL;
mutex_unlock(&devfreq_list_lock);
4dc3bab8687f1e Chanwoo Choi 2020-07-02 1892
4dc3bab8687f1e Chanwoo Choi 2020-07-02 1893 for (i = 0; i < DEVFREQ_TIMER_NUM; i++) {
4dc3bab8687f1e Chanwoo Choi 2020-07-02 1894 if (!strncmp(timer_name[i], str_timer, DEVFREQ_NAME_LEN)) {
4dc3bab8687f1e Chanwoo Choi 2020-07-02 1895 timer = i;
4dc3bab8687f1e Chanwoo Choi 2020-07-02 1896 break;
4dc3bab8687f1e Chanwoo Choi 2020-07-02 1897 }
4dc3bab8687f1e Chanwoo Choi 2020-07-02 1898 }
4dc3bab8687f1e Chanwoo Choi 2020-07-02 1899
4dc3bab8687f1e Chanwoo Choi 2020-07-02 1900 if (timer < 0) {
4dc3bab8687f1e Chanwoo Choi 2020-07-02 1901 ret = -EINVAL;
4dc3bab8687f1e Chanwoo Choi 2020-07-02 1902 goto out;
4dc3bab8687f1e Chanwoo Choi 2020-07-02 1903 }
4dc3bab8687f1e Chanwoo Choi 2020-07-02 1904
4dc3bab8687f1e Chanwoo Choi 2020-07-02 1905 if (df->profile->timer == timer) {
4dc3bab8687f1e Chanwoo Choi 2020-07-02 1906 ret = 0;
4dc3bab8687f1e Chanwoo Choi 2020-07-02 1907 goto out;
4dc3bab8687f1e Chanwoo Choi 2020-07-02 1908 }
4dc3bab8687f1e Chanwoo Choi 2020-07-02 1909
4dc3bab8687f1e Chanwoo Choi 2020-07-02 1910 mutex_lock(&df->lock);
4dc3bab8687f1e Chanwoo Choi 2020-07-02 1911 df->profile->timer = timer;
4dc3bab8687f1e Chanwoo Choi 2020-07-02 1912 mutex_unlock(&df->lock);
4dc3bab8687f1e Chanwoo Choi 2020-07-02 1913
4dc3bab8687f1e Chanwoo Choi 2020-07-02 1914 ret = df->governor->event_handler(df, DEVFREQ_GOV_STOP, NULL);
4dc3bab8687f1e Chanwoo Choi 2020-07-02 1915 if (ret) {
4dc3bab8687f1e Chanwoo Choi 2020-07-02 1916 dev_warn(dev, "%s: Governor %s not stopped(%d)\n",
4dc3bab8687f1e Chanwoo Choi 2020-07-02 1917 __func__, df->governor->name, ret);
4dc3bab8687f1e Chanwoo Choi 2020-07-02 1918 goto out;
4dc3bab8687f1e Chanwoo Choi 2020-07-02 1919 }
4dc3bab8687f1e Chanwoo Choi 2020-07-02 1920
4dc3bab8687f1e Chanwoo Choi 2020-07-02 1921 ret = df->governor->event_handler(df, DEVFREQ_GOV_START, NULL);
4dc3bab8687f1e Chanwoo Choi 2020-07-02 1922 if (ret)
4dc3bab8687f1e Chanwoo Choi 2020-07-02 1923 dev_warn(dev, "%s: Governor %s not started(%d)\n",
4dc3bab8687f1e Chanwoo Choi 2020-07-02 1924 __func__, df->governor->name, ret);
4dc3bab8687f1e Chanwoo Choi 2020-07-02 1925 out:
88ea5f098ddcf4 Pengjie Zhang 2025-10-25 1926 mutex_unlock(&devfreq_list_lock);
4dc3bab8687f1e Chanwoo Choi 2020-07-02 @1927 return ret ? ret : count;
4dc3bab8687f1e Chanwoo Choi 2020-07-02 1928 }
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
prev parent reply other threads:[~2025-10-27 14:12 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-10-25 13:52 Pengjie Zhang
2025-10-27 14:12 ` Dan Carpenter [this message]
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=202510272106.x7zgW7pK-lkp@intel.com \
--to=dan.carpenter@linaro.org \
--cc=cw00.choi@samsung.com \
--cc=jonathan.cameron@huawei.com \
--cc=kyungmin.park@samsung.com \
--cc=lihuisong@huawei.com \
--cc=linhongye@h-partners.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=linuxarm@huawei.com \
--cc=lkp@intel.com \
--cc=myungjoo.ham@samsung.com \
--cc=oe-kbuild-all@lists.linux.dev \
--cc=oe-kbuild@lists.linux.dev \
--cc=yubowen8@huawei.com \
--cc=zhangpengjie2@huawei.com \
--cc=zhanjie9@hisilicon.com \
--cc=zhenglifeng1@huawei.com \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®