From: kernel test robot <lkp@intel.com>
To: kbuild-all@lists.01.org
Subject: Re: [PATCH v6 1/5] counter: Internalize sysfs interface code
Date: Mon, 23 Nov 2020 07:57:44 +0800 [thread overview]
Message-ID: <202011230725.HkDWDSsk-lkp@intel.com> (raw)
In-Reply-To: <950660d49af7d12b09bc9d3b1db6f8ff74209c26.1606075915.git.vilhelm.gray@gmail.com>
[-- Attachment #1: Type: text/plain, Size: 4918 bytes --]
Hi William,
I love your patch! Perhaps something to improve:
[auto build test WARNING on stm32/stm32-next]
[also build test WARNING on linux/master linus/master v5.10-rc4 next-20201120]
[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]
url: https://github.com/0day-ci/linux/commits/William-Breathitt-Gray/Introduce-the-Counter-character-device-interface/20201123-043634
base: https://git.kernel.org/pub/scm/linux/kernel/git/atorgue/stm32.git stm32-next
config: x86_64-randconfig-a011-20201122 (attached as .config)
compiler: clang version 12.0.0 (https://github.com/llvm/llvm-project 3324fd8a7b1ab011513017ed8fd81e06928526d5)
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# install x86_64 cross compiling tool for clang build
# apt-get install binutils-x86-64-linux-gnu
# https://github.com/0day-ci/linux/commit/1bc8c3bb021f3736c23d97f1a965935821f0ac5a
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review William-Breathitt-Gray/Introduce-the-Counter-character-device-interface/20201123-043634
git checkout 1bc8c3bb021f3736c23d97f1a965935821f0ac5a
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=x86_64
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
All warnings (new ones prefixed by >>):
>> drivers/counter/counter-sysfs.c:180:7: warning: variable 'err' is used uninitialized whenever 'if' condition is false [-Wsometimes-uninitialized]
if (idx < 0)
^~~~~~~
drivers/counter/counter-sysfs.c:193:6: note: uninitialized use occurs here
if (err)
^~~
drivers/counter/counter-sysfs.c:180:3: note: remove the 'if' if its condition is always true
if (idx < 0)
^~~~~~~~~~~~
drivers/counter/counter-sysfs.c:158:9: note: initialize the variable 'err' to silence this warning
int err;
^
= 0
1 warning generated.
vim +180 drivers/counter/counter-sysfs.c
148
149 static ssize_t counter_comp_u8_store(struct device *dev,
150 struct device_attribute *attr,
151 const char *buf, size_t len)
152 {
153 const struct counter_attribute *const a = to_counter_attribute(attr);
154 struct counter_device *const counter = dev_get_drvdata(dev);
155 struct counter_count *const count = a->parent;
156 struct counter_synapse *const synapse = a->comp.priv;
157 const struct counter_available *const avail = a->comp.priv;
158 int err;
159 bool bool_data;
160 int idx;
161 u8 data;
162
163 switch (a->comp.type) {
164 case COUNTER_COMP_BOOL:
165 err = kstrtobool(buf, &bool_data);
166 data = bool_data;
167 break;
168 case COUNTER_COMP_FUNCTION:
169 err = find_in_string_array(&data, count->functions_list,
170 count->num_functions, buf,
171 counter_function_str);
172 break;
173 case COUNTER_COMP_SYNAPSE_ACTION:
174 err = find_in_string_array(&data, synapse->actions_list,
175 synapse->num_actions, buf,
176 counter_synapse_action_str);
177 break;
178 case COUNTER_COMP_ENUM:
179 idx = __sysfs_match_string(avail->strs, avail->num_items, buf);
> 180 if (idx < 0)
181 return idx;
182 data = idx;
183 break;
184 case COUNTER_COMP_COUNT_MODE:
185 err = find_in_string_array(&data, avail->enums,
186 avail->num_items, buf,
187 counter_count_mode_str);
188 break;
189 default:
190 err = kstrtou8(buf, 0, &data);
191 break;
192 }
193 if (err)
194 return err;
195
196 switch (a->scope) {
197 case COUNTER_SCOPE_DEVICE:
198 err = a->comp.device_u8_write(counter, data);
199 break;
200 case COUNTER_SCOPE_SIGNAL:
201 err = a->comp.signal_u8_write(counter, a->parent, data);
202 break;
203 case COUNTER_SCOPE_COUNT:
204 if (a->comp.type == COUNTER_COMP_SYNAPSE_ACTION)
205 err = a->comp.action_write(counter, count, synapse,
206 data);
207 else
208 err = a->comp.count_u8_write(counter, count, data);
209 break;
210 }
211 if (err)
212 return err;
213
214 return len;
215 }
216
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org
[-- Attachment #2: config.gz --]
[-- Type: application/gzip, Size: 37966 bytes --]
next prev parent reply other threads:[~2020-11-22 23:57 UTC|newest]
Thread overview: 38+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-11-22 20:29 [PATCH v6 0/5] Introduce the Counter character device interface William Breathitt Gray
2020-11-22 20:29 ` William Breathitt Gray
2020-11-22 20:29 ` [PATCH v6 1/5] counter: Internalize sysfs interface code William Breathitt Gray
2020-11-22 23:57 ` kernel test robot [this message]
2020-11-24 20:55 ` kernel test robot
2020-11-25 13:02 ` William Breathitt Gray
2020-11-25 13:07 ` William Breathitt Gray
2020-11-25 13:07 ` William Breathitt Gray
2020-12-13 23:15 ` David Lechner
2020-12-13 23:15 ` David Lechner
2020-12-20 22:11 ` William Breathitt Gray
2020-12-20 22:11 ` William Breathitt Gray
2020-12-21 15:26 ` David Lechner
2020-12-21 15:26 ` David Lechner
2020-11-22 20:29 ` [PATCH v6 2/5] docs: counter: Update to reflect sysfs internalization William Breathitt Gray
2020-11-22 20:29 ` William Breathitt Gray
2020-11-22 20:29 ` [PATCH v6 3/5] counter: Add character device interface William Breathitt Gray
2020-11-22 20:29 ` William Breathitt Gray
2020-12-13 23:58 ` David Lechner
2020-12-13 23:58 ` David Lechner
2020-12-25 17:30 ` William Breathitt Gray
2020-12-25 17:30 ` William Breathitt Gray
2021-01-19 9:20 ` Oleksij Rempel
2021-01-19 9:20 ` Oleksij Rempel
2021-01-21 8:03 ` William Breathitt Gray
2021-01-21 8:03 ` William Breathitt Gray
2021-01-21 18:26 ` Jonathan Cameron
2021-01-21 18:26 ` Jonathan Cameron
2020-11-22 20:29 ` [PATCH v6 4/5] docs: counter: Document " William Breathitt Gray
2020-11-22 20:29 ` William Breathitt Gray
2020-11-22 20:29 ` [PATCH v6 5/5] counter: 104-quad-8: Add IRQ support for the ACCES 104-QUAD-8 William Breathitt Gray
2020-11-22 20:29 ` William Breathitt Gray
2020-12-13 23:15 ` [PATCH v6 0/5] Introduce the Counter character device interface David Lechner
2020-12-13 23:15 ` David Lechner
2020-12-20 21:44 ` William Breathitt Gray
2020-12-20 21:44 ` William Breathitt Gray
2020-12-21 15:19 ` David Lechner
2020-12-21 15:19 ` David Lechner
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=202011230725.HkDWDSsk-lkp@intel.com \
--to=lkp@intel.com \
--cc=kbuild-all@lists.01.org \
/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.