* [stefandoesinger-zx297520:dlink 132/132] drivers/misc/cardreader/infineon_usim.c:190:21: warning: unused variable 'i'
@ 2026-09-09 11:22 kernel test robot
0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2026-09-09 11:22 UTC (permalink / raw)
To: Stefan Dösinger ; +Cc: oe-kbuild-all
tree: https://gitlab.com/stefandoesinger/zx297520-kernel dlink
head: ac919b52585145716ddb9d8154ca104ff2ea271b
commit: ac919b52585145716ddb9d8154ca104ff2ea271b [132/132] Sloppy APDU
config: sh-allmodconfig (https://download.01.org/0day-ci/archive/20260909/202609091356.2pWHOzol-lkp@intel.com/config)
compiler: sh4-linux-gcc (GCC) 16.1.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260909/202609091356.2pWHOzol-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/oe-kbuild-all/202609091356.2pWHOzol-lkp@intel.com/
All warnings (new ones prefixed by >>):
drivers/misc/cardreader/infineon_usim.c: In function 'usim_read_atr':
>> drivers/misc/cardreader/infineon_usim.c:190:21: warning: unused variable 'i' [-Wunused-variable]
190 | size_t len, i;
| ^
vim +/i +190 drivers/misc/cardreader/infineon_usim.c
184
185 static int usim_read_atr(struct usim_drv *usim, u8 *atr, u32 *atr_length, u32 *flags_inout)
186 {
187 u32 control, flags = *flags_inout;
188 const char *convention = "error";
189 int ret = 0;
> 190 size_t len, i;
191 u8 value;
192
193 /* Read the ATR solely based on timeout. Don't try to be smart and parse incoming values to
194 * deduce a length. It is complicated logic and userspace validated the ATR anyway.
195 */
196 flags &= (INFINEON_USIM_DIRECT_CONVENTION | INFINEON_USIM_INVERSE_CONVENTION);
197
198 for (len = 0; len < INFINEON_USIM_ATR_MAX; ++len) {
199 ret = usim_receive_char(usim, &value, USIM_ATR_TIMEOUT_MS);
200
201 if (ret == -ETIMEDOUT)
202 break;
203
204 atr[len] = value;
205 if (len)
206 continue;
207
208 /* Direct / Indirect convention handling: If specified by the client, apply it after
209 * reading the first byte.
210 *
211 * If left automatic, try to detect it based on the first byte: If it read without
212 * a parity error, assume direct. Otherwise, check for 0x03 ox 0x3f, fix it u and
213 * ignore the parity error.
214 */
215 if (flags & INFINEON_USIM_DIRECT_CONVENTION) {
216 /* do nothing */
217 convention = "direct (requested)";
218 } else if (!ret) {
219 convention = "direct (detected)";
220 flags |= INFINEON_USIM_DIRECT_CONVENTION;
221 } else if (ret == -EBADMSG && (value == 0x03 || value == 0x3f)) {
222 ret = 0;
223 value = 0x3f;
224
225 if (!flags) {
226 convention = "inverse (detected)";
227 flags |= INFINEON_USIM_INVERSE_CONVENTION;
228 } else {
229 convention = "inverse (requested)";
230 }
231
232 control = usim_readl(usim, USIM_REG_CONTROL);
233 control |= USIM_CONTROL_INVERSE_CONVENTION;
234 usim_writel(usim, control, USIM_REG_CONTROL);
235 }
236 }
237 dev_dbg(usim->dev, "received ATR with %zu bytes, convention %s\n", len, convention);
238
239 if (len == INFINEON_USIM_ATR_MAX)
240 return -EOVERFLOW;
241
242 *atr_length = len;
243 *flags_inout |= flags;
244
245 return 0;
246 }
247
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2026-09-09 11:23 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-09-09 11:22 [stefandoesinger-zx297520:dlink 132/132] drivers/misc/cardreader/infineon_usim.c:190:21: warning: unused variable 'i' kernel test robot
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.