All of lore.kernel.org
 help / color / mirror / Atom feed
* [bug report] drx: add initial drx-d driver
@ 2017-12-14  8:03 Dan Carpenter
  2017-12-14 21:55 ` Ralph Metzler
  0 siblings, 1 reply; 5+ messages in thread
From: Dan Carpenter @ 2017-12-14  8:03 UTC (permalink / raw)
  To: rjkm; +Cc: linux-media

Hello Ralph Metzler,

The patch 126f1e618870: "drx: add initial drx-d driver" from Mar 12,
2011, leads to the following static checker warning:

	drivers/media/dvb-frontends/drxd_hard.c:1305 SC_WaitForReady()
	info: return a literal instead of 'status'

drivers/media/dvb-frontends/drxd_hard.c
  1298  static int SC_WaitForReady(struct drxd_state *state)
  1299  {
  1300          int i;
  1301  
  1302          for (i = 0; i < DRXD_MAX_RETRIES; i += 1) {
  1303                  int status = Read16(state, SC_RA_RAM_CMD__A, NULL, 0);
  1304                  if (status == 0)
  1305                          return status;
                                ^^^^^^^^^^^^^
The register is set to zero when ready?  The answer should obviously be
yes, but it wouldn't totally surprise me if this function just always
looped 1000 times...  Few of the callers check the return.  Anyway, it's
more clear to just "return 0;"

  1306          }
  1307          return -1;
                       ^^
-1 is not a proper error code.

  1308  }

regards,
dan carpenter

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2017-12-16 13:58 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-12-14  8:03 [bug report] drx: add initial drx-d driver Dan Carpenter
2017-12-14 21:55 ` Ralph Metzler
2017-12-15  3:05   ` Devin Heitmueller
     [not found]   ` <CAGoCfiwkuznB71esUq00gj5+B_v37R3VfsJFHaOiPLD57veOkw@mail.gmail.com>
2017-12-16 12:04     ` Dan Carpenter
2017-12-16 13:58   ` Mauro Carvalho Chehab

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.