linux-media.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [bug report] media: atomisp: re-enable warnings again
@ 2020-08-25 11:31 Dan Carpenter
  0 siblings, 0 replies; only message in thread
From: Dan Carpenter @ 2020-08-25 11:31 UTC (permalink / raw)
  To: mchehab+huawei; +Cc: linux-media

Hello Mauro Carvalho Chehab,

The patch 5b552b198c25: "media: atomisp: re-enable warnings again"
from May 30, 2020, leads to the following static checker warning:

	drivers/staging/media/atomisp/pci/atomisp_compat_css20.c:714 is_pipe_valid_to_current_run_mode()
	warn: ignoring unreachable code.

drivers/staging/media/atomisp/pci/atomisp_compat_css20.c
   694          switch (asd->run_mode->val) {
   695          case ATOMISP_RUN_MODE_STILL_CAPTURE:
   696                  if (pipe_id == IA_CSS_PIPE_ID_CAPTURE)
   697                          return true;
   698  
   699                  return false;
   700          case ATOMISP_RUN_MODE_PREVIEW:
   701                  if (!asd->continuous_mode->val) {
   702                          if (pipe_id == IA_CSS_PIPE_ID_PREVIEW)
   703                                  return true;
   704  
   705                          return false;
   706                  }
   707                  fallthrough;

I bet all these fallthrough annotations should just be "return false;"

   708          case ATOMISP_RUN_MODE_CONTINUOUS_CAPTURE:
   709                  if (pipe_id == IA_CSS_PIPE_ID_CAPTURE ||
   710                      pipe_id == IA_CSS_PIPE_ID_PREVIEW)
   711                          return true;
   712  
   713                  return false;
   714                  fallthrough;

Either way, this one is clearly unreachable.

   715          case ATOMISP_RUN_MODE_VIDEO:
   716                  if (!asd->continuous_mode->val) {
   717                          if (pipe_id == IA_CSS_PIPE_ID_VIDEO ||
   718                              pipe_id == IA_CSS_PIPE_ID_YUVPP)
   719                                  return true;
   720                          else
   721                                  return false;
   722                  }
   723                  fallthrough;
   724          case ATOMISP_RUN_MODE_SDV:
   725                  if (pipe_id == IA_CSS_PIPE_ID_CAPTURE ||
   726                      pipe_id == IA_CSS_PIPE_ID_VIDEO)
   727                          return true;
   728  
   729                  return false;
   730          }

regards,
dan carpenter

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

only message in thread, other threads:[~2020-08-25 11:32 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-08-25 11:31 [bug report] media: atomisp: re-enable warnings again Dan Carpenter

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).