All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
To: unlisted-recipients:; (no To-header on input)
Cc: Nathan Chancellor <natechancellor@gmail.com>,
	Sakari Ailus <sakari.ailus@linux.intel.com>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	linux-media@vger.kernel.org, devel@driverdev.osuosl.org,
	linux-kernel@vger.kernel.org, clang-built-linux@googlegroups.com,
	Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Subject: [PATCH v2 26/41] media: atomisp: Remove binary_supports_input_format
Date: Sat, 30 May 2020 08:55:43 +0200	[thread overview]
Message-ID: <2e4b1cb050370ba37eb58be8ec7ea8b31705f847.1590821410.git.mchehab+huawei@kernel.org> (raw)
In-Reply-To: <cover.1590821410.git.mchehab+huawei@kernel.org>

From: Nathan Chancellor <natechancellor@gmail.com>

Clang warns:

drivers/staging/media/atomisp/pci/runtime/binary/src/binary.c:1707:64:
warning: implicit conversion from enumeration type 'const enum
ia_css_frame_format' to different enumeration type 'enum
atomisp_input_format' [-Wenum-conversion]
        binary_supports_input_format(xcandidate, req_in_info->format));
        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~             ~~~~~~~~~~~~~^~~~~~

As it turns out, binary_supports_input_format only asserts that
xcandidate is not NULL and just returns true so this call is never
actually made.

There are other functions that are called that assert info is not NULL
so this function actually serves no purpose. Remove it. It can be
brought back if needed later.

Link: https://github.com/ClangBuiltLinux/linux/issues/1036

Signed-off-by: Nathan Chancellor <natechancellor@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
---
 .../atomisp/pci/runtime/binary/src/binary.c   | 21 -------------------
 1 file changed, 21 deletions(-)

diff --git a/drivers/staging/media/atomisp/pci/runtime/binary/src/binary.c b/drivers/staging/media/atomisp/pci/runtime/binary/src/binary.c
index fd4ecd697868..85e8b45d5416 100644
--- a/drivers/staging/media/atomisp/pci/runtime/binary/src/binary.c
+++ b/drivers/staging/media/atomisp/pci/runtime/binary/src/binary.c
@@ -859,18 +859,6 @@ binary_supports_output_format(const struct ia_css_binary_xinfo *info,
 	return false;
 }
 
-#ifdef ISP2401
-static bool
-binary_supports_input_format(const struct ia_css_binary_xinfo *info,
-			     enum atomisp_input_format format)
-{
-	assert(info);
-	(void)format;
-
-	return true;
-}
-#endif
-
 static bool
 binary_supports_vf_format(const struct ia_css_binary_xinfo *info,
 			  enum ia_css_frame_format format)
@@ -1701,15 +1689,6 @@ ia_css_binary_find(struct ia_css_binary_descr *descr,
 					    binary_supports_output_format(xcandidate, req_bin_out_info->format));
 			continue;
 		}
-#ifdef ISP2401
-		if (!binary_supports_input_format(xcandidate, descr->stream_format)) {
-			ia_css_debug_dtrace(IA_CSS_DEBUG_TRACE,
-					    "ia_css_binary_find() [%d] continue: !%d\n",
-					    __LINE__,
-					    binary_supports_input_format(xcandidate, req_in_info->format));
-			continue;
-		}
-#endif
 		if (xcandidate->num_output_pins > 1 &&
 		    /* in case we have a second output pin, */
 		    req_vf_info                   && /* and we need vf output. */
-- 
2.26.2


WARNING: multiple messages have this Message-ID (diff)
From: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Cc: devel@driverdev.osuosl.org,
	Mauro Carvalho Chehab <mchehab+huawei@kernel.org>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	linux-kernel@vger.kernel.org, clang-built-linux@googlegroups.com,
	Sakari Ailus <sakari.ailus@linux.intel.com>,
	Nathan Chancellor <natechancellor@gmail.com>,
	linux-media@vger.kernel.org
Subject: [PATCH v2 26/41] media: atomisp: Remove binary_supports_input_format
Date: Sat, 30 May 2020 08:55:43 +0200	[thread overview]
Message-ID: <2e4b1cb050370ba37eb58be8ec7ea8b31705f847.1590821410.git.mchehab+huawei@kernel.org> (raw)
In-Reply-To: <cover.1590821410.git.mchehab+huawei@kernel.org>

From: Nathan Chancellor <natechancellor@gmail.com>

Clang warns:

drivers/staging/media/atomisp/pci/runtime/binary/src/binary.c:1707:64:
warning: implicit conversion from enumeration type 'const enum
ia_css_frame_format' to different enumeration type 'enum
atomisp_input_format' [-Wenum-conversion]
        binary_supports_input_format(xcandidate, req_in_info->format));
        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~             ~~~~~~~~~~~~~^~~~~~

As it turns out, binary_supports_input_format only asserts that
xcandidate is not NULL and just returns true so this call is never
actually made.

There are other functions that are called that assert info is not NULL
so this function actually serves no purpose. Remove it. It can be
brought back if needed later.

Link: https://github.com/ClangBuiltLinux/linux/issues/1036

Signed-off-by: Nathan Chancellor <natechancellor@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
---
 .../atomisp/pci/runtime/binary/src/binary.c   | 21 -------------------
 1 file changed, 21 deletions(-)

diff --git a/drivers/staging/media/atomisp/pci/runtime/binary/src/binary.c b/drivers/staging/media/atomisp/pci/runtime/binary/src/binary.c
index fd4ecd697868..85e8b45d5416 100644
--- a/drivers/staging/media/atomisp/pci/runtime/binary/src/binary.c
+++ b/drivers/staging/media/atomisp/pci/runtime/binary/src/binary.c
@@ -859,18 +859,6 @@ binary_supports_output_format(const struct ia_css_binary_xinfo *info,
 	return false;
 }
 
-#ifdef ISP2401
-static bool
-binary_supports_input_format(const struct ia_css_binary_xinfo *info,
-			     enum atomisp_input_format format)
-{
-	assert(info);
-	(void)format;
-
-	return true;
-}
-#endif
-
 static bool
 binary_supports_vf_format(const struct ia_css_binary_xinfo *info,
 			  enum ia_css_frame_format format)
@@ -1701,15 +1689,6 @@ ia_css_binary_find(struct ia_css_binary_descr *descr,
 					    binary_supports_output_format(xcandidate, req_bin_out_info->format));
 			continue;
 		}
-#ifdef ISP2401
-		if (!binary_supports_input_format(xcandidate, descr->stream_format)) {
-			ia_css_debug_dtrace(IA_CSS_DEBUG_TRACE,
-					    "ia_css_binary_find() [%d] continue: !%d\n",
-					    __LINE__,
-					    binary_supports_input_format(xcandidate, req_in_info->format));
-			continue;
-		}
-#endif
 		if (xcandidate->num_output_pins > 1 &&
 		    /* in case we have a second output pin, */
 		    req_vf_info                   && /* and we need vf output. */
-- 
2.26.2

_______________________________________________
devel mailing list
devel@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

  parent reply	other threads:[~2020-05-30  6:58 UTC|newest]

Thread overview: 84+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-30  6:55 [PATCH v2 00/41] More atomisp fixes and cleanups Mauro Carvalho Chehab
2020-05-30  6:55 ` Mauro Carvalho Chehab
2020-05-30  6:55 ` [PATCH v2 01/41] media: atomisp: simplify hive_isp_css_mm_hrt wrapper Mauro Carvalho Chehab
2020-05-30  6:55   ` Mauro Carvalho Chehab
2020-05-30  6:55 ` [PATCH v2 02/41] media: atomisp: get rid of the hrt/hive_isp_css_mm_hrt abstraction layer Mauro Carvalho Chehab
2020-05-30  6:55   ` Mauro Carvalho Chehab
2020-05-30  6:55 ` [PATCH v2 03/41] media: atomisp: reduce abstraction at ia_css_memory_access Mauro Carvalho Chehab
2020-05-30  6:55   ` Mauro Carvalho Chehab
2020-05-30  6:55 ` [PATCH v2 04/41] media: atomisp: go one step further to drop ia_css_memory_access.c Mauro Carvalho Chehab
2020-05-30  6:55   ` Mauro Carvalho Chehab
2020-05-30  6:55 ` [PATCH v2 05/41] media: atomisp: get rid of mmgr_load and mmgr_store Mauro Carvalho Chehab
2020-05-30  6:55   ` Mauro Carvalho Chehab
2020-05-30  6:55 ` [PATCH v2 06/41] media: atomisp: get rid of unused memory_realloc code Mauro Carvalho Chehab
2020-05-30  6:55   ` Mauro Carvalho Chehab
2020-05-30  6:55 ` [PATCH v2 07/41] media: atomisp: change the type returned by mmgr alloc Mauro Carvalho Chehab
2020-05-30  6:55   ` Mauro Carvalho Chehab
2020-05-30  6:55 ` [PATCH v2 08/41] media: atomisp: get rid of memory_access.c Mauro Carvalho Chehab
2020-05-30  6:55   ` Mauro Carvalho Chehab
2020-05-30  6:55 ` [PATCH v2 09/41] media: atomisp: hmm_bo: untag user pointers Mauro Carvalho Chehab
2020-05-30  6:55   ` Mauro Carvalho Chehab
2020-05-30  6:55 ` [PATCH v2 10/41] media: atomisp: add debug message to help debugging hmm code Mauro Carvalho Chehab
2020-05-30  6:55   ` Mauro Carvalho Chehab
2020-05-30  6:55 ` [PATCH v2 11/41] media: atomisp: use Yocto Aero default hmm pool sizes Mauro Carvalho Chehab
2020-05-30  6:55   ` Mauro Carvalho Chehab
2020-05-30  6:55 ` [PATCH v2 12/41] media: atomisp: get rid of a warning message Mauro Carvalho Chehab
2020-05-30  6:55   ` Mauro Carvalho Chehab
2020-05-30  6:55 ` [PATCH v2 13/41] media: atomisp: fix driver caps Mauro Carvalho Chehab
2020-05-30  6:55   ` Mauro Carvalho Chehab
2020-05-30  6:55 ` [PATCH v2 14/41] media: atomisp: use pin_user_pages() for memory allocation Mauro Carvalho Chehab
2020-05-30  6:55   ` Mauro Carvalho Chehab
2020-05-30  6:55 ` [PATCH v2 15/41] media: atomisp: add debug for hmm alloc Mauro Carvalho Chehab
2020-05-30  6:55   ` Mauro Carvalho Chehab
2020-05-30  6:55 ` [PATCH v2 16/41] media: atomisp: improve warning for IRQ enable function Mauro Carvalho Chehab
2020-05-30  6:55   ` Mauro Carvalho Chehab
2020-05-30  6:55 ` [PATCH v2 17/41] media: atomisp: add debug functions for received events Mauro Carvalho Chehab
2020-05-30  6:55   ` Mauro Carvalho Chehab
2020-05-30  6:55 ` [PATCH v2 18/41] media: atomisp: add more comments about frame allocation Mauro Carvalho Chehab
2020-05-30  6:55   ` Mauro Carvalho Chehab
2020-05-30  6:55 ` [PATCH v2 19/41] media: atomisp: remove kvmalloc/kvcalloc abstractions Mauro Carvalho Chehab
2020-05-30  6:55   ` Mauro Carvalho Chehab
2020-05-30  6:55 ` [PATCH v2 20/41] media: atomisp: avoid OOPS due to non-existing ref_frames Mauro Carvalho Chehab
2020-05-30  6:55   ` Mauro Carvalho Chehab
2020-05-30  6:55 ` [PATCH v2 21/41] media: atomisp: Clean up if block in sh_css_sp_init_stage Mauro Carvalho Chehab
2020-05-30  6:55   ` Mauro Carvalho Chehab
2020-05-30  6:55 ` [PATCH v2 22/41] media: atomisp: Remove second increment of count in atomisp_subdev_probe Mauro Carvalho Chehab
2020-05-30  6:55   ` Mauro Carvalho Chehab
2020-05-30  6:55 ` [PATCH v2 23/41] media: atomisp: Remove unnecessary NULL checks in ia_css_pipe_load_extension Mauro Carvalho Chehab
2020-05-30  6:55   ` Mauro Carvalho Chehab
2020-05-30  6:55 ` [PATCH v2 24/41] media: atomisp: Remove unnecessary NULL check in atomisp_param Mauro Carvalho Chehab
2020-05-30  6:55   ` Mauro Carvalho Chehab
2020-05-30  6:55 ` [PATCH v2 25/41] media: atomisp: Avoid overflow in compute_blending Mauro Carvalho Chehab
2020-05-30  6:55   ` Mauro Carvalho Chehab
2020-05-30  6:55 ` Mauro Carvalho Chehab [this message]
2020-05-30  6:55   ` [PATCH v2 26/41] media: atomisp: Remove binary_supports_input_format Mauro Carvalho Chehab
2020-05-30  6:55 ` [PATCH v2 27/41] media: atomisp: avoid an extra memset() when alloc memory Mauro Carvalho Chehab
2020-05-30  6:55   ` Mauro Carvalho Chehab
2020-05-30  6:55 ` [PATCH v2 28/41] media: atomisp: remove some trivial wrappers from compat css20 Mauro Carvalho Chehab
2020-05-30  6:55   ` Mauro Carvalho Chehab
2020-05-30  6:55 ` [PATCH v2 29/41] media: atomisp: do another round of coding style cleanup Mauro Carvalho Chehab
2020-05-30  6:55   ` Mauro Carvalho Chehab
2020-05-30  6:55 ` [PATCH v2 30/41] media: atomisp: get rid of non-Linux error codes Mauro Carvalho Chehab
2020-05-30  6:55   ` Mauro Carvalho Chehab
2020-05-30  6:55 ` [PATCH v2 31/41] media: atomisp: get rid of an error abstraction layer Mauro Carvalho Chehab
2020-05-30  6:55   ` Mauro Carvalho Chehab
2020-05-30  6:55 ` [PATCH v2 32/41] media: atomisp: don't cause a warn if probe failed Mauro Carvalho Chehab
2020-05-30  6:55   ` Mauro Carvalho Chehab
2020-05-30  6:55 ` [PATCH v2 33/41] media: atomisp: get rid of a bunch of other wrappers Mauro Carvalho Chehab
2020-05-30  6:55   ` Mauro Carvalho Chehab
2020-05-30  6:55 ` [PATCH v2 34/41] media: atomisp: get rid of system_types.h Mauro Carvalho Chehab
2020-05-30  6:55   ` Mauro Carvalho Chehab
2020-05-30  6:55 ` [PATCH v2 35/41] media: atomisp: provide more details about the firmware binaries Mauro Carvalho Chehab
2020-05-30  6:55   ` Mauro Carvalho Chehab
2020-05-30  6:55 ` [PATCH v2 36/41] media: atomisp: print firmware data during load Mauro Carvalho Chehab
2020-05-30  6:55   ` Mauro Carvalho Chehab
2020-05-30  6:55 ` [PATCH v2 37/41] media: atomisp: allow passing firmware name at modprobe time Mauro Carvalho Chehab
2020-05-30  6:55   ` Mauro Carvalho Chehab
2020-05-30  6:55 ` [PATCH v2 38/41] media: atomisp: add a debug message at hmm free Mauro Carvalho Chehab
2020-05-30  6:55   ` Mauro Carvalho Chehab
2020-05-30  6:55 ` [PATCH v2 39/41] media: atomisp: add some debug messages when binaries are used Mauro Carvalho Chehab
2020-05-30  6:55   ` Mauro Carvalho Chehab
2020-05-30  6:55 ` [PATCH v2 40/41] media: atomisp: get rid of set_fs() dirty hacks Mauro Carvalho Chehab
2020-05-30  6:55   ` Mauro Carvalho Chehab
2020-05-30  6:55 ` [PATCH v2 41/41] media: atomisp: add SPDX headers Mauro Carvalho Chehab
2020-05-30  6:55   ` Mauro Carvalho Chehab

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=2e4b1cb050370ba37eb58be8ec7ea8b31705f847.1590821410.git.mchehab+huawei@kernel.org \
    --to=mchehab+huawei@kernel.org \
    --cc=clang-built-linux@googlegroups.com \
    --cc=devel@driverdev.osuosl.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=natechancellor@gmail.com \
    --cc=sakari.ailus@linux.intel.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.