All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@oracle.com>
To: mchehab+huawei@kernel.org
Cc: linux-media@vger.kernel.org
Subject: [bug report] media: atomisp: re-enable warnings again
Date: Tue, 25 Aug 2020 14:31:40 +0300	[thread overview]
Message-ID: <20200825113140.GA287498@mwanda> (raw)

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

                 reply	other threads:[~2020-08-25 11:32 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=20200825113140.GA287498@mwanda \
    --to=dan.carpenter@oracle.com \
    --cc=linux-media@vger.kernel.org \
    --cc=mchehab+huawei@kernel.org \
    /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.