From: kernel test robot <lkp@intel.com>
To: "Stefan Dösinger " <stefandoesinger@gmail.com>
Cc: oe-kbuild-all@lists.linux.dev
Subject: [stefandoesinger-zx297520:dlink 132/132] drivers/misc/cardreader/infineon_usim.c:190:21: warning: unused variable 'i'
Date: Wed, 09 Sep 2026 13:22:49 +0200 [thread overview]
Message-ID: <202609091356.2pWHOzol-lkp@intel.com> (raw)
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
reply other threads:[~2026-09-09 11:23 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=202609091356.2pWHOzol-lkp@intel.com \
--to=lkp@intel.com \
--cc=oe-kbuild-all@lists.linux.dev \
--cc=stefandoesinger@gmail.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 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.