All of lore.kernel.org
 help / color / mirror / Atom feed
* [bug report] mmc: mediatek: Use data tune for CMD line tune
@ 2017-04-03 14:34 Dan Carpenter
  0 siblings, 0 replies; only message in thread
From: Dan Carpenter @ 2017-04-03 14:34 UTC (permalink / raw)
  To: yong.mao-NuS5LvNUpcJWk0Htik3J/w
  Cc: linux-mediatek-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r

[  You didn't really add this but since you touched it maybe that means
   you know how to silence this static checker warning?  - dan ]

Hello yong mao,

The patch a768529d73a1: "mmc: mediatek: Use data tune for CMD line
tune" from Mar 15, 2017, leads to the following static checker
warning:

	drivers/mmc/host/mtk-sd.c:1466 hs400_tune_response()
	error: uninitialized symbol 'cmd_err'.

drivers/mmc/host/mtk-sd.c
  1456          for (i = 0 ; i < PAD_DELAY_MAX; i++) {
  1457                  sdr_set_field(host->base + PAD_CMD_TUNE,
  1458                                PAD_CMD_TUNE_RX_DLY3, i);
  1459                  /*
  1460                   * Using the same parameters, it may sometimes pass the test,
  1461                   * but sometimes it may fail. To make sure the parameters are
  1462                   * more stable, we test each set of parameters 3 times.
  1463                   */
  1464                  for (j = 0; j < 3; j++) {
  1465                          mmc_send_tuning(mmc, opcode, &cmd_err);
                                                              ^^^^^^^
If kzalloc() fails then cmd_err isn't initialized.  We could probably
check for errors here?

  1466                          if (!cmd_err) {
  1467                                  cmd_delay |= (1 << i);
  1468                          } else {
  1469                                  cmd_delay &= ~(1 << i);
  1470                                  break;
  1471                          }
  1472                  }
  1473          }

regards,
dan carpenter

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2017-04-03 14:34 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-04-03 14:34 [bug report] mmc: mediatek: Use data tune for CMD line tune Dan Carpenter

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.