diff mbox series

[2/2] drm/cmdline-parser: Use assert when needed

Message ID 20220804131704.97083-2-michal.winiarski@intel.com (mailing list archive)
State New, archived
Headers show
Series [1/2] drm/cmdline-parser: Merge negative tests | expand

Commit Message

Michał Winiarski Aug. 4, 2022, 1:17 p.m. UTC
Expecting to observe a specific value, when the function responsible for
setting the value has failed will lead to extra noise in test output.
Use assert when the situation calls for it.
Also - very small tidying up around the changed areas (whitespace /
variable locality).

Signed-off-by: Michał Winiarski <michal.winiarski@intel.com>
---
 .../gpu/drm/tests/drm_cmdline_parser_test.c   | 93 +++++++++----------
 1 file changed, 46 insertions(+), 47 deletions(-)

Comments

kernel test robot Aug. 4, 2022, 7:05 p.m. UTC | #1
Hi "Michał,

Thank you for the patch! Perhaps something to improve:

[auto build test WARNING on drm-misc/drm-misc-next]
[also build test WARNING on drm-tip/drm-tip]
[cannot apply to drm/drm-next drm-exynos/exynos-drm-next drm-intel/for-linux-next linus/master v5.19 next-20220803]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]

url:    https://github.com/intel-lab-lkp/linux/commits/Micha-Winiarski/drm-cmdline-parser-Merge-negative-tests/20220804-212019
base:   git://anongit.freedesktop.org/drm/drm-misc drm-misc-next
config: hexagon-randconfig-r001-20220804 (https://download.01.org/0day-ci/archive/20220805/202208050217.VHlt1uDZ-lkp@intel.com/config)
compiler: clang version 16.0.0 (https://github.com/llvm/llvm-project 26dd42705c2af0b8f6e5d6cdb32c9bd5ed9524eb)
reproduce (this is a W=1 build):
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # https://github.com/intel-lab-lkp/linux/commit/8a21a5872b4bbe7bcfec5bc990d182a5c32416a2
        git remote add linux-review https://github.com/intel-lab-lkp/linux
        git fetch --no-tags linux-review Micha-Winiarski/drm-cmdline-parser-Merge-negative-tests/20220804-212019
        git checkout 8a21a5872b4bbe7bcfec5bc990d182a5c32416a2
        # save the config file
        mkdir build_dir && cp config build_dir/.config
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=hexagon SHELL=/bin/bash drivers/gpu/drm/tests/

If you fix the issue, kindly add following tag where applicable
Reported-by: kernel test robot <lkp@intel.com>

All warnings (new ones prefixed by >>):

>> drivers/gpu/drm/tests/drm_cmdline_parser_test.c:72:13: warning: stack frame size (1152) exceeds limit (1024) in 'drm_cmdline_test_force_D_only_dvi' [-Wframe-larger-than]
   static void drm_cmdline_test_force_D_only_dvi(struct kunit *test)
               ^
>> drivers/gpu/drm/tests/drm_cmdline_parser_test.c:51:13: warning: stack frame size (1152) exceeds limit (1024) in 'drm_cmdline_test_force_D_only_hdmi' [-Wframe-larger-than]
   static void drm_cmdline_test_force_D_only_hdmi(struct kunit *test)
               ^
>> drivers/gpu/drm/tests/drm_cmdline_parser_test.c:389:13: warning: stack frame size (1152) exceeds limit (1024) in 'drm_cmdline_test_res_bpp_refresh_force_on_digital' [-Wframe-larger-than]
   static void drm_cmdline_test_res_bpp_refresh_force_on_digital(struct kunit *test)
               ^
   3 warnings generated.


vim +/drm_cmdline_test_force_D_only_dvi +72 drivers/gpu/drm/tests/drm_cmdline_parser_test.c

9f0527d22a52ff34 Maíra Canal      2022-07-08  49  
9f0527d22a52ff34 Maíra Canal      2022-07-08  50  
9f0527d22a52ff34 Maíra Canal      2022-07-08 @51  static void drm_cmdline_test_force_D_only_hdmi(struct kunit *test)
9f0527d22a52ff34 Maíra Canal      2022-07-08  52  {
9f0527d22a52ff34 Maíra Canal      2022-07-08  53  	struct drm_cmdline_mode mode = { };
8a21a5872b4bbe7b Michał Winiarski 2022-08-04  54  	const struct drm_connector connector_hdmi = {
8a21a5872b4bbe7b Michał Winiarski 2022-08-04  55  		.connector_type	= DRM_MODE_CONNECTOR_HDMIB,
8a21a5872b4bbe7b Michał Winiarski 2022-08-04  56  	};
9f0527d22a52ff34 Maíra Canal      2022-07-08  57  	const char *cmdline = "D";
9f0527d22a52ff34 Maíra Canal      2022-07-08  58  
8a21a5872b4bbe7b Michał Winiarski 2022-08-04  59  	KUNIT_ASSERT_TRUE(test, drm_mode_parse_command_line_for_connector(cmdline,
9f0527d22a52ff34 Maíra Canal      2022-07-08  60  									  &connector_hdmi, &mode));
9f0527d22a52ff34 Maíra Canal      2022-07-08  61  	KUNIT_EXPECT_FALSE(test, mode.specified);
9f0527d22a52ff34 Maíra Canal      2022-07-08  62  	KUNIT_EXPECT_FALSE(test, mode.refresh_specified);
9f0527d22a52ff34 Maíra Canal      2022-07-08  63  	KUNIT_EXPECT_FALSE(test, mode.bpp_specified);
9f0527d22a52ff34 Maíra Canal      2022-07-08  64  
9f0527d22a52ff34 Maíra Canal      2022-07-08  65  	KUNIT_EXPECT_FALSE(test, mode.rb);
9f0527d22a52ff34 Maíra Canal      2022-07-08  66  	KUNIT_EXPECT_FALSE(test, mode.cvt);
9f0527d22a52ff34 Maíra Canal      2022-07-08  67  	KUNIT_EXPECT_FALSE(test, mode.interlace);
9f0527d22a52ff34 Maíra Canal      2022-07-08  68  	KUNIT_EXPECT_FALSE(test, mode.margins);
9f0527d22a52ff34 Maíra Canal      2022-07-08  69  	KUNIT_EXPECT_EQ(test, mode.force, DRM_FORCE_ON_DIGITAL);
9f0527d22a52ff34 Maíra Canal      2022-07-08  70  }
9f0527d22a52ff34 Maíra Canal      2022-07-08  71  
9f0527d22a52ff34 Maíra Canal      2022-07-08 @72  static void drm_cmdline_test_force_D_only_dvi(struct kunit *test)
9f0527d22a52ff34 Maíra Canal      2022-07-08  73  {
9f0527d22a52ff34 Maíra Canal      2022-07-08  74  	struct drm_cmdline_mode mode = { };
8a21a5872b4bbe7b Michał Winiarski 2022-08-04  75  	const struct drm_connector connector_dvi = {
8a21a5872b4bbe7b Michał Winiarski 2022-08-04  76  		.connector_type = DRM_MODE_CONNECTOR_DVII,
8a21a5872b4bbe7b Michał Winiarski 2022-08-04  77  	};
9f0527d22a52ff34 Maíra Canal      2022-07-08  78  	const char *cmdline = "D";
9f0527d22a52ff34 Maíra Canal      2022-07-08  79  
8a21a5872b4bbe7b Michał Winiarski 2022-08-04  80  	KUNIT_ASSERT_TRUE(test, drm_mode_parse_command_line_for_connector(cmdline,
9f0527d22a52ff34 Maíra Canal      2022-07-08  81  									  &connector_dvi, &mode));
9f0527d22a52ff34 Maíra Canal      2022-07-08  82  	KUNIT_EXPECT_FALSE(test, mode.specified);
9f0527d22a52ff34 Maíra Canal      2022-07-08  83  	KUNIT_EXPECT_FALSE(test, mode.refresh_specified);
9f0527d22a52ff34 Maíra Canal      2022-07-08  84  	KUNIT_EXPECT_FALSE(test, mode.bpp_specified);
9f0527d22a52ff34 Maíra Canal      2022-07-08  85  
9f0527d22a52ff34 Maíra Canal      2022-07-08  86  	KUNIT_EXPECT_FALSE(test, mode.rb);
9f0527d22a52ff34 Maíra Canal      2022-07-08  87  	KUNIT_EXPECT_FALSE(test, mode.cvt);
9f0527d22a52ff34 Maíra Canal      2022-07-08  88  	KUNIT_EXPECT_FALSE(test, mode.interlace);
9f0527d22a52ff34 Maíra Canal      2022-07-08  89  	KUNIT_EXPECT_FALSE(test, mode.margins);
9f0527d22a52ff34 Maíra Canal      2022-07-08  90  	KUNIT_EXPECT_EQ(test, mode.force, DRM_FORCE_ON_DIGITAL);
9f0527d22a52ff34 Maíra Canal      2022-07-08  91  }
9f0527d22a52ff34 Maíra Canal      2022-07-08  92
kernel test robot Aug. 4, 2022, 7:26 p.m. UTC | #2
Hi "Michał,

Thank you for the patch! Perhaps something to improve:

[auto build test WARNING on drm-misc/drm-misc-next]
[also build test WARNING on drm-tip/drm-tip]
[cannot apply to drm/drm-next drm-exynos/exynos-drm-next drm-intel/for-linux-next linus/master v5.19 next-20220804]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]

url:    https://github.com/intel-lab-lkp/linux/commits/Micha-Winiarski/drm-cmdline-parser-Merge-negative-tests/20220804-212019
base:   git://anongit.freedesktop.org/drm/drm-misc drm-misc-next
config: csky-buildonly-randconfig-r001-20220804 (https://download.01.org/0day-ci/archive/20220805/202208050307.u6Yo3hhR-lkp@intel.com/config)
compiler: csky-linux-gcc (GCC) 12.1.0
reproduce (this is a W=1 build):
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # https://github.com/intel-lab-lkp/linux/commit/8a21a5872b4bbe7bcfec5bc990d182a5c32416a2
        git remote add linux-review https://github.com/intel-lab-lkp/linux
        git fetch --no-tags linux-review Micha-Winiarski/drm-cmdline-parser-Merge-negative-tests/20220804-212019
        git checkout 8a21a5872b4bbe7bcfec5bc990d182a5c32416a2
        # save the config file
        mkdir build_dir && cp config build_dir/.config
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-12.1.0 make.cross W=1 O=build_dir ARCH=csky SHELL=/bin/bash drivers/gpu/drm/tests/

If you fix the issue, kindly add following tag where applicable
Reported-by: kernel test robot <lkp@intel.com>

All warnings (new ones prefixed by >>):

   drivers/gpu/drm/tests/drm_cmdline_parser_test.c: In function 'drm_cmdline_test_res_bpp_refresh_force_on_digital':
>> drivers/gpu/drm/tests/drm_cmdline_parser_test.c:414:1: warning: the frame size of 1120 bytes is larger than 1024 bytes [-Wframe-larger-than=]
     414 | }
         | ^
   drivers/gpu/drm/tests/drm_cmdline_parser_test.c: In function 'drm_cmdline_test_force_D_only_hdmi':
   drivers/gpu/drm/tests/drm_cmdline_parser_test.c:70:1: warning: the frame size of 1120 bytes is larger than 1024 bytes [-Wframe-larger-than=]
      70 | }
         | ^
   drivers/gpu/drm/tests/drm_cmdline_parser_test.c: In function 'drm_cmdline_test_force_D_only_dvi':
   drivers/gpu/drm/tests/drm_cmdline_parser_test.c:91:1: warning: the frame size of 1124 bytes is larger than 1024 bytes [-Wframe-larger-than=]
      91 | }
         | ^


vim +414 drivers/gpu/drm/tests/drm_cmdline_parser_test.c

9f0527d22a52ff Maíra Canal      2022-07-08  388  
9f0527d22a52ff Maíra Canal      2022-07-08  389  static void drm_cmdline_test_res_bpp_refresh_force_on_digital(struct kunit *test)
9f0527d22a52ff Maíra Canal      2022-07-08  390  {
9f0527d22a52ff Maíra Canal      2022-07-08  391  	struct drm_cmdline_mode mode = { };
8a21a5872b4bbe Michał Winiarski 2022-08-04  392  	const struct drm_connector connector = {
9f0527d22a52ff Maíra Canal      2022-07-08  393  		.connector_type = DRM_MODE_CONNECTOR_DVII,
9f0527d22a52ff Maíra Canal      2022-07-08  394  	};
9f0527d22a52ff Maíra Canal      2022-07-08  395  	const char *cmdline = "720x480-24@60D";
9f0527d22a52ff Maíra Canal      2022-07-08  396  
8a21a5872b4bbe Michał Winiarski 2022-08-04  397  	KUNIT_ASSERT_TRUE(test, drm_mode_parse_command_line_for_connector(cmdline,
9f0527d22a52ff Maíra Canal      2022-07-08  398  									  &connector, &mode));
9f0527d22a52ff Maíra Canal      2022-07-08  399  	KUNIT_EXPECT_TRUE(test, mode.specified);
9f0527d22a52ff Maíra Canal      2022-07-08  400  	KUNIT_EXPECT_EQ(test, mode.xres, 720);
9f0527d22a52ff Maíra Canal      2022-07-08  401  	KUNIT_EXPECT_EQ(test, mode.yres, 480);
9f0527d22a52ff Maíra Canal      2022-07-08  402  
9f0527d22a52ff Maíra Canal      2022-07-08  403  	KUNIT_EXPECT_TRUE(test, mode.refresh_specified);
9f0527d22a52ff Maíra Canal      2022-07-08  404  	KUNIT_EXPECT_EQ(test, mode.refresh, 60);
9f0527d22a52ff Maíra Canal      2022-07-08  405  
9f0527d22a52ff Maíra Canal      2022-07-08  406  	KUNIT_EXPECT_TRUE(test, mode.bpp_specified);
9f0527d22a52ff Maíra Canal      2022-07-08  407  	KUNIT_EXPECT_EQ(test, mode.bpp, 24);
9f0527d22a52ff Maíra Canal      2022-07-08  408  
9f0527d22a52ff Maíra Canal      2022-07-08  409  	KUNIT_EXPECT_FALSE(test, mode.rb);
9f0527d22a52ff Maíra Canal      2022-07-08  410  	KUNIT_EXPECT_FALSE(test, mode.cvt);
9f0527d22a52ff Maíra Canal      2022-07-08  411  	KUNIT_EXPECT_FALSE(test, mode.interlace);
9f0527d22a52ff Maíra Canal      2022-07-08  412  	KUNIT_EXPECT_FALSE(test, mode.margins);
9f0527d22a52ff Maíra Canal      2022-07-08  413  	KUNIT_EXPECT_EQ(test, mode.force, DRM_FORCE_ON_DIGITAL);
9f0527d22a52ff Maíra Canal      2022-07-08 @414  }
9f0527d22a52ff Maíra Canal      2022-07-08  415
Maíra Canal Aug. 10, 2022, 1:45 p.m. UTC | #3
Hi Michał

On 8/4/22 10:17, Michał Winiarski wrote:
> Expecting to observe a specific value, when the function responsible for
> setting the value has failed will lead to extra noise in test output.
> Use assert when the situation calls for it.
> Also - very small tidying up around the changed areas (whitespace /
> variable locality).
> 
> Signed-off-by: Michał Winiarski <michal.winiarski@intel.com>
> ---
>  .../gpu/drm/tests/drm_cmdline_parser_test.c   | 93 +++++++++----------
>  1 file changed, 46 insertions(+), 47 deletions(-)
> 
> diff --git a/drivers/gpu/drm/tests/drm_cmdline_parser_test.c b/drivers/gpu/drm/tests/drm_cmdline_parser_test.c
> index 058808faaf4a..7a313e2fd52a 100644
> --- a/drivers/gpu/drm/tests/drm_cmdline_parser_test.c
> +++ b/drivers/gpu/drm/tests/drm_cmdline_parser_test.c
> @@ -16,7 +16,7 @@ static void drm_cmdline_test_force_e_only(struct kunit *test)
>  	struct drm_cmdline_mode mode = { };
>  	const char *cmdline = "e";
>  
> -	KUNIT_EXPECT_TRUE(test, drm_mode_parse_command_line_for_connector(cmdline,
> +	KUNIT_ASSERT_TRUE(test, drm_mode_parse_command_line_for_connector(cmdline,
>  									  &no_connector, &mode));
>  	KUNIT_EXPECT_FALSE(test, mode.specified);
>  	KUNIT_EXPECT_FALSE(test, mode.refresh_specified);
> @@ -34,7 +34,7 @@ static void drm_cmdline_test_force_D_only_not_digital(struct kunit *test)
>  	struct drm_cmdline_mode mode = { };
>  	const char *cmdline = "D";
>  
> -	KUNIT_EXPECT_TRUE(test, drm_mode_parse_command_line_for_connector(cmdline,
> +	KUNIT_ASSERT_TRUE(test, drm_mode_parse_command_line_for_connector(cmdline,
>  									  &no_connector, &mode));
>  	KUNIT_EXPECT_FALSE(test, mode.specified);
>  	KUNIT_EXPECT_FALSE(test, mode.refresh_specified);
> @@ -47,16 +47,16 @@ static void drm_cmdline_test_force_D_only_not_digital(struct kunit *test)
>  	KUNIT_EXPECT_EQ(test, mode.force, DRM_FORCE_ON);
>  }
>  
> -static const struct drm_connector connector_hdmi = {
> -	.connector_type	= DRM_MODE_CONNECTOR_HDMIB,
> -};

Minor nit: I guess you miss to delete a line.

>  
>  static void drm_cmdline_test_force_D_only_hdmi(struct kunit *test)
>  {
>  	struct drm_cmdline_mode mode = { };
> +	const struct drm_connector connector_hdmi = {
> +		.connector_type	= DRM_MODE_CONNECTOR_HDMIB,
> +	};


As the kernel test robot pointed out, this leads to stack issues (also
with PowerPC). You might want to leave it as it was or allocate it with
kunit_kzalloc.

Best Regards,
- Maíra Canal


>  	const char *cmdline = "D";
>  
> -	KUNIT_EXPECT_TRUE(test, drm_mode_parse_command_line_for_connector(cmdline,
> +	KUNIT_ASSERT_TRUE(test, drm_mode_parse_command_line_for_connector(cmdline,
>  									  &connector_hdmi, &mode));
>  	KUNIT_EXPECT_FALSE(test, mode.specified);
>  	KUNIT_EXPECT_FALSE(test, mode.refresh_specified);
> @@ -69,16 +69,15 @@ static void drm_cmdline_test_force_D_only_hdmi(struct kunit *test)
>  	KUNIT_EXPECT_EQ(test, mode.force, DRM_FORCE_ON_DIGITAL);
>  }
>  
> -static const struct drm_connector connector_dvi = {
> -	.connector_type	= DRM_MODE_CONNECTOR_DVII,
> -};
> -
>  static void drm_cmdline_test_force_D_only_dvi(struct kunit *test)
>  {
>  	struct drm_cmdline_mode mode = { };
> +	const struct drm_connector connector_dvi = {
> +		.connector_type = DRM_MODE_CONNECTOR_DVII,
> +	};>  	const char *cmdline = "D";
>  
> -	KUNIT_EXPECT_TRUE(test, drm_mode_parse_command_line_for_connector(cmdline,
> +	KUNIT_ASSERT_TRUE(test, drm_mode_parse_command_line_for_connector(cmdline,
>  									  &connector_dvi, &mode));
>  	KUNIT_EXPECT_FALSE(test, mode.specified);
>  	KUNIT_EXPECT_FALSE(test, mode.refresh_specified);
> @@ -96,7 +95,7 @@ static void drm_cmdline_test_force_d_only(struct kunit *test)
>  	struct drm_cmdline_mode mode = { };
>  	const char *cmdline = "d";
>  
> -	KUNIT_EXPECT_TRUE(test, drm_mode_parse_command_line_for_connector(cmdline,
> +	KUNIT_ASSERT_TRUE(test, drm_mode_parse_command_line_for_connector(cmdline,
>  									  &no_connector, &mode));
>  	KUNIT_EXPECT_FALSE(test, mode.specified);
>  	KUNIT_EXPECT_FALSE(test, mode.refresh_specified);
> @@ -114,7 +113,7 @@ static void drm_cmdline_test_res(struct kunit *test)
>  	struct drm_cmdline_mode mode = { };
>  	const char *cmdline = "720x480";
>  
> -	KUNIT_EXPECT_TRUE(test, drm_mode_parse_command_line_for_connector(cmdline,
> +	KUNIT_ASSERT_TRUE(test, drm_mode_parse_command_line_for_connector(cmdline,
>  									  &no_connector, &mode));
>  	KUNIT_EXPECT_TRUE(test, mode.specified);
>  	KUNIT_EXPECT_EQ(test, mode.xres, 720);
> @@ -136,7 +135,7 @@ static void drm_cmdline_test_res_vesa(struct kunit *test)
>  	struct drm_cmdline_mode mode = { };
>  	const char *cmdline = "720x480M";
>  
> -	KUNIT_EXPECT_TRUE(test, drm_mode_parse_command_line_for_connector(cmdline,
> +	KUNIT_ASSERT_TRUE(test, drm_mode_parse_command_line_for_connector(cmdline,
>  									  &no_connector, &mode));
>  	KUNIT_EXPECT_TRUE(test, mode.specified);
>  	KUNIT_EXPECT_EQ(test, mode.xres, 720);
> @@ -158,7 +157,7 @@ static void drm_cmdline_test_res_vesa_rblank(struct kunit *test)
>  	struct drm_cmdline_mode mode = { };
>  	const char *cmdline = "720x480MR";
>  
> -	KUNIT_EXPECT_TRUE(test, drm_mode_parse_command_line_for_connector(cmdline,
> +	KUNIT_ASSERT_TRUE(test, drm_mode_parse_command_line_for_connector(cmdline,
>  									  &no_connector, &mode));
>  	KUNIT_EXPECT_TRUE(test, mode.specified);
>  	KUNIT_EXPECT_EQ(test, mode.xres, 720);
> @@ -180,7 +179,7 @@ static void drm_cmdline_test_res_rblank(struct kunit *test)
>  	struct drm_cmdline_mode mode = { };
>  	const char *cmdline = "720x480R";
>  
> -	KUNIT_EXPECT_TRUE(test, drm_mode_parse_command_line_for_connector(cmdline,
> +	KUNIT_ASSERT_TRUE(test, drm_mode_parse_command_line_for_connector(cmdline,
>  									  &no_connector, &mode));
>  	KUNIT_EXPECT_TRUE(test, mode.specified);
>  	KUNIT_EXPECT_EQ(test, mode.xres, 720);
> @@ -202,7 +201,7 @@ static void drm_cmdline_test_res_bpp(struct kunit *test)
>  	struct drm_cmdline_mode mode = { };
>  	const char *cmdline = "720x480-24";
>  
> -	KUNIT_EXPECT_TRUE(test, drm_mode_parse_command_line_for_connector(cmdline,
> +	KUNIT_ASSERT_TRUE(test, drm_mode_parse_command_line_for_connector(cmdline,
>  									  &no_connector, &mode));
>  	KUNIT_EXPECT_TRUE(test, mode.specified);
>  	KUNIT_EXPECT_EQ(test, mode.xres, 720);
> @@ -225,7 +224,7 @@ static void drm_cmdline_test_res_refresh(struct kunit *test)
>  	struct drm_cmdline_mode mode = { };
>  	const char *cmdline = "720x480@60";
>  
> -	KUNIT_EXPECT_TRUE(test, drm_mode_parse_command_line_for_connector(cmdline,
> +	KUNIT_ASSERT_TRUE(test, drm_mode_parse_command_line_for_connector(cmdline,
>  									  &no_connector, &mode));
>  	KUNIT_EXPECT_TRUE(test, mode.specified);
>  	KUNIT_EXPECT_EQ(test, mode.xres, 720);
> @@ -248,7 +247,7 @@ static void drm_cmdline_test_res_bpp_refresh(struct kunit *test)
>  	struct drm_cmdline_mode mode = { };
>  	const char *cmdline = "720x480-24@60";
>  
> -	KUNIT_EXPECT_TRUE(test, drm_mode_parse_command_line_for_connector(cmdline,
> +	KUNIT_ASSERT_TRUE(test, drm_mode_parse_command_line_for_connector(cmdline,
>  									  &no_connector, &mode));
>  	KUNIT_EXPECT_TRUE(test, mode.specified);
>  	KUNIT_EXPECT_EQ(test, mode.xres, 720);
> @@ -272,7 +271,7 @@ static void drm_cmdline_test_res_bpp_refresh_interlaced(struct kunit *test)
>  	struct drm_cmdline_mode mode = { };
>  	const char *cmdline = "720x480-24@60i";
>  
> -	KUNIT_EXPECT_TRUE(test, drm_mode_parse_command_line_for_connector(cmdline,
> +	KUNIT_ASSERT_TRUE(test, drm_mode_parse_command_line_for_connector(cmdline,
>  									  &no_connector, &mode));
>  	KUNIT_EXPECT_TRUE(test, mode.specified);
>  	KUNIT_EXPECT_EQ(test, mode.xres, 720);
> @@ -294,9 +293,9 @@ static void drm_cmdline_test_res_bpp_refresh_interlaced(struct kunit *test)
>  static void drm_cmdline_test_res_bpp_refresh_margins(struct kunit *test)
>  {
>  	struct drm_cmdline_mode mode = { };
> -	const char *cmdline =  "720x480-24@60m";
> +	const char *cmdline = "720x480-24@60m";
>  
> -	KUNIT_EXPECT_TRUE(test, drm_mode_parse_command_line_for_connector(cmdline,
> +	KUNIT_ASSERT_TRUE(test, drm_mode_parse_command_line_for_connector(cmdline,
>  									  &no_connector, &mode));
>  	KUNIT_EXPECT_TRUE(test, mode.specified);
>  	KUNIT_EXPECT_EQ(test, mode.xres, 720);
> @@ -318,9 +317,9 @@ static void drm_cmdline_test_res_bpp_refresh_margins(struct kunit *test)
>  static void drm_cmdline_test_res_bpp_refresh_force_off(struct kunit *test)
>  {
>  	struct drm_cmdline_mode mode = { };
> -	const char *cmdline =  "720x480-24@60d";
> +	const char *cmdline = "720x480-24@60d";
>  
> -	KUNIT_EXPECT_TRUE(test, drm_mode_parse_command_line_for_connector(cmdline,
> +	KUNIT_ASSERT_TRUE(test, drm_mode_parse_command_line_for_connector(cmdline,
>  									  &no_connector, &mode));
>  	KUNIT_EXPECT_TRUE(test, mode.specified);
>  	KUNIT_EXPECT_EQ(test, mode.xres, 720);
> @@ -342,9 +341,9 @@ static void drm_cmdline_test_res_bpp_refresh_force_off(struct kunit *test)
>  static void drm_cmdline_test_res_bpp_refresh_force_on(struct kunit *test)
>  {
>  	struct drm_cmdline_mode mode = { };
> -	const char *cmdline =  "720x480-24@60e";
> +	const char *cmdline = "720x480-24@60e";
>  
> -	KUNIT_EXPECT_TRUE(test, drm_mode_parse_command_line_for_connector(cmdline,
> +	KUNIT_ASSERT_TRUE(test, drm_mode_parse_command_line_for_connector(cmdline,
>  									  &no_connector, &mode));
>  	KUNIT_EXPECT_TRUE(test, mode.specified);
>  	KUNIT_EXPECT_EQ(test, mode.xres, 720);
> @@ -368,7 +367,7 @@ static void drm_cmdline_test_res_bpp_refresh_force_on_analog(struct kunit *test)
>  	struct drm_cmdline_mode mode = { };
>  	const char *cmdline = "720x480-24@60D";
>  
> -	KUNIT_EXPECT_TRUE(test, drm_mode_parse_command_line_for_connector(cmdline,
> +	KUNIT_ASSERT_TRUE(test, drm_mode_parse_command_line_for_connector(cmdline,
>  									  &no_connector, &mode));
>  	KUNIT_EXPECT_TRUE(test, mode.specified);
>  	KUNIT_EXPECT_EQ(test, mode.xres, 720);
> @@ -390,12 +389,12 @@ static void drm_cmdline_test_res_bpp_refresh_force_on_analog(struct kunit *test)
>  static void drm_cmdline_test_res_bpp_refresh_force_on_digital(struct kunit *test)
>  {
>  	struct drm_cmdline_mode mode = { };
> -	static const struct drm_connector connector = {
> +	const struct drm_connector connector = {
>  		.connector_type = DRM_MODE_CONNECTOR_DVII,
>  	};
>  	const char *cmdline = "720x480-24@60D";
>  
> -	KUNIT_EXPECT_TRUE(test, drm_mode_parse_command_line_for_connector(cmdline,
> +	KUNIT_ASSERT_TRUE(test, drm_mode_parse_command_line_for_connector(cmdline,
>  									  &connector, &mode));
>  	KUNIT_EXPECT_TRUE(test, mode.specified);
>  	KUNIT_EXPECT_EQ(test, mode.xres, 720);
> @@ -443,7 +442,7 @@ static void drm_cmdline_test_res_margins_force_on(struct kunit *test)
>  	struct drm_cmdline_mode mode = { };
>  	const char *cmdline = "720x480me";
>  
> -	KUNIT_EXPECT_TRUE(test, drm_mode_parse_command_line_for_connector(cmdline,
> +	KUNIT_ASSERT_TRUE(test, drm_mode_parse_command_line_for_connector(cmdline,
>  									  &no_connector, &mode));
>  	KUNIT_EXPECT_TRUE(test, mode.specified);
>  	KUNIT_EXPECT_EQ(test, mode.xres, 720);
> @@ -465,7 +464,7 @@ static void drm_cmdline_test_res_vesa_margins(struct kunit *test)
>  	struct drm_cmdline_mode mode = { };
>  	const char *cmdline = "720x480Mm";
>  
> -	KUNIT_EXPECT_TRUE(test, drm_mode_parse_command_line_for_connector(cmdline,
> +	KUNIT_ASSERT_TRUE(test, drm_mode_parse_command_line_for_connector(cmdline,
>  									  &no_connector, &mode));
>  	KUNIT_EXPECT_TRUE(test, mode.specified);
>  	KUNIT_EXPECT_EQ(test, mode.xres, 720);
> @@ -487,7 +486,7 @@ static void drm_cmdline_test_name(struct kunit *test)
>  	struct drm_cmdline_mode mode = { };
>  	const char *cmdline = "NTSC";
>  
> -	KUNIT_EXPECT_TRUE(test, drm_mode_parse_command_line_for_connector(cmdline,
> +	KUNIT_ASSERT_TRUE(test, drm_mode_parse_command_line_for_connector(cmdline,
>  									  &no_connector, &mode));
>  	KUNIT_EXPECT_STREQ(test, mode.name, "NTSC");
>  	KUNIT_EXPECT_FALSE(test, mode.refresh_specified);
> @@ -499,7 +498,7 @@ static void drm_cmdline_test_name_bpp(struct kunit *test)
>  	struct drm_cmdline_mode mode = { };
>  	const char *cmdline = "NTSC-24";
>  
> -	KUNIT_EXPECT_TRUE(test, drm_mode_parse_command_line_for_connector(cmdline,
> +	KUNIT_ASSERT_TRUE(test, drm_mode_parse_command_line_for_connector(cmdline,
>  									  &no_connector, &mode));
>  	KUNIT_EXPECT_STREQ(test, mode.name, "NTSC");
>  
> @@ -514,7 +513,7 @@ static void drm_cmdline_test_name_option(struct kunit *test)
>  	struct drm_cmdline_mode mode = { };
>  	const char *cmdline = "NTSC,rotate=180";
>  
> -	KUNIT_EXPECT_TRUE(test, drm_mode_parse_command_line_for_connector(cmdline,
> +	KUNIT_ASSERT_TRUE(test, drm_mode_parse_command_line_for_connector(cmdline,
>  									  &no_connector, &mode));
>  	KUNIT_EXPECT_TRUE(test, mode.specified);
>  	KUNIT_EXPECT_STREQ(test, mode.name, "NTSC");
> @@ -526,7 +525,7 @@ static void drm_cmdline_test_name_bpp_option(struct kunit *test)
>  	struct drm_cmdline_mode mode = { };
>  	const char *cmdline = "NTSC-24,rotate=180";
>  
> -	KUNIT_EXPECT_TRUE(test, drm_mode_parse_command_line_for_connector(cmdline,
> +	KUNIT_ASSERT_TRUE(test, drm_mode_parse_command_line_for_connector(cmdline,
>  									  &no_connector, &mode));
>  	KUNIT_EXPECT_TRUE(test, mode.specified);
>  	KUNIT_EXPECT_STREQ(test, mode.name, "NTSC");
> @@ -540,7 +539,7 @@ static void drm_cmdline_test_rotate_0(struct kunit *test)
>  	struct drm_cmdline_mode mode = { };
>  	const char *cmdline = "720x480,rotate=0";
>  
> -	KUNIT_EXPECT_TRUE(test, drm_mode_parse_command_line_for_connector(cmdline,
> +	KUNIT_ASSERT_TRUE(test, drm_mode_parse_command_line_for_connector(cmdline,
>  									  &no_connector, &mode));
>  	KUNIT_EXPECT_TRUE(test, mode.specified);
>  	KUNIT_EXPECT_EQ(test, mode.xres, 720);
> @@ -563,7 +562,7 @@ static void drm_cmdline_test_rotate_90(struct kunit *test)
>  	struct drm_cmdline_mode mode = { };
>  	const char *cmdline = "720x480,rotate=90";
>  
> -	KUNIT_EXPECT_TRUE(test, drm_mode_parse_command_line_for_connector(cmdline,
> +	KUNIT_ASSERT_TRUE(test, drm_mode_parse_command_line_for_connector(cmdline,
>  									  &no_connector, &mode));
>  	KUNIT_EXPECT_TRUE(test, mode.specified);
>  	KUNIT_EXPECT_EQ(test, mode.xres, 720);
> @@ -586,7 +585,7 @@ static void drm_cmdline_test_rotate_180(struct kunit *test)
>  	struct drm_cmdline_mode mode = { };
>  	const char *cmdline = "720x480,rotate=180";
>  
> -	KUNIT_EXPECT_TRUE(test, drm_mode_parse_command_line_for_connector(cmdline,
> +	KUNIT_ASSERT_TRUE(test, drm_mode_parse_command_line_for_connector(cmdline,
>  									  &no_connector, &mode));
>  	KUNIT_EXPECT_TRUE(test, mode.specified);
>  	KUNIT_EXPECT_EQ(test, mode.xres, 720);
> @@ -609,7 +608,7 @@ static void drm_cmdline_test_rotate_270(struct kunit *test)
>  	struct drm_cmdline_mode mode = { };
>  	const char *cmdline = "720x480,rotate=270";
>  
> -	KUNIT_EXPECT_TRUE(test, drm_mode_parse_command_line_for_connector(cmdline,
> +	KUNIT_ASSERT_TRUE(test, drm_mode_parse_command_line_for_connector(cmdline,
>  									  &no_connector, &mode));
>  	KUNIT_EXPECT_TRUE(test, mode.specified);
>  	KUNIT_EXPECT_EQ(test, mode.xres, 720);
> @@ -632,7 +631,7 @@ static void drm_cmdline_test_hmirror(struct kunit *test)
>  	struct drm_cmdline_mode mode = { };
>  	const char *cmdline = "720x480,reflect_x";
>  
> -	KUNIT_EXPECT_TRUE(test, drm_mode_parse_command_line_for_connector(cmdline,
> +	KUNIT_ASSERT_TRUE(test, drm_mode_parse_command_line_for_connector(cmdline,
>  									  &no_connector, &mode));
>  	KUNIT_EXPECT_TRUE(test, mode.specified);
>  	KUNIT_EXPECT_EQ(test, mode.xres, 720);
> @@ -655,7 +654,7 @@ static void drm_cmdline_test_vmirror(struct kunit *test)
>  	struct drm_cmdline_mode mode = { };
>  	const char *cmdline = "720x480,reflect_y";
>  
> -	KUNIT_EXPECT_TRUE(test, drm_mode_parse_command_line_for_connector(cmdline,
> +	KUNIT_ASSERT_TRUE(test, drm_mode_parse_command_line_for_connector(cmdline,
>  									  &no_connector, &mode));
>  	KUNIT_EXPECT_TRUE(test, mode.specified);
>  	KUNIT_EXPECT_EQ(test, mode.xres, 720);
> @@ -679,7 +678,7 @@ static void drm_cmdline_test_margin_options(struct kunit *test)
>  	const char *cmdline =
>  		"720x480,margin_right=14,margin_left=24,margin_bottom=36,margin_top=42";
>  
> -	KUNIT_EXPECT_TRUE(test, drm_mode_parse_command_line_for_connector(cmdline,
> +	KUNIT_ASSERT_TRUE(test, drm_mode_parse_command_line_for_connector(cmdline,
>  									  &no_connector, &mode));
>  	KUNIT_EXPECT_TRUE(test, mode.specified);
>  	KUNIT_EXPECT_EQ(test, mode.xres, 720);
> @@ -705,7 +704,7 @@ static void drm_cmdline_test_multiple_options(struct kunit *test)
>  	struct drm_cmdline_mode mode = { };
>  	const char *cmdline = "720x480,rotate=270,reflect_x";
>  
> -	KUNIT_EXPECT_TRUE(test, drm_mode_parse_command_line_for_connector(cmdline,
> +	KUNIT_ASSERT_TRUE(test, drm_mode_parse_command_line_for_connector(cmdline,
>  									  &no_connector, &mode));
>  	KUNIT_EXPECT_TRUE(test, mode.specified);
>  	KUNIT_EXPECT_EQ(test, mode.xres, 720);
> @@ -728,7 +727,7 @@ static void drm_cmdline_test_bpp_extra_and_option(struct kunit *test)
>  	struct drm_cmdline_mode mode = { };
>  	const char *cmdline = "720x480-24e,rotate=180";
>  
> -	KUNIT_EXPECT_TRUE(test, drm_mode_parse_command_line_for_connector(cmdline,
> +	KUNIT_ASSERT_TRUE(test, drm_mode_parse_command_line_for_connector(cmdline,
>  									  &no_connector, &mode));
>  	KUNIT_EXPECT_TRUE(test, mode.specified);
>  	KUNIT_EXPECT_EQ(test, mode.xres, 720);
> @@ -752,7 +751,7 @@ static void drm_cmdline_test_extra_and_option(struct kunit *test)
>  	struct drm_cmdline_mode mode = { };
>  	const char *cmdline = "720x480e,rotate=180";
>  
> -	KUNIT_EXPECT_TRUE(test, drm_mode_parse_command_line_for_connector(cmdline,
> +	KUNIT_ASSERT_TRUE(test, drm_mode_parse_command_line_for_connector(cmdline,
>  									  &no_connector, &mode));
>  	KUNIT_EXPECT_TRUE(test, mode.specified);
>  	KUNIT_EXPECT_EQ(test, mode.xres, 720);
> @@ -774,7 +773,7 @@ static void drm_cmdline_test_freestanding_options(struct kunit *test)
>  	struct drm_cmdline_mode mode = { };
>  	const char *cmdline = "margin_right=14,margin_left=24,margin_bottom=36,margin_top=42";
>  
> -	KUNIT_EXPECT_TRUE(test, drm_mode_parse_command_line_for_connector(cmdline,
> +	KUNIT_ASSERT_TRUE(test, drm_mode_parse_command_line_for_connector(cmdline,
>  									  &no_connector, &mode));
>  	KUNIT_EXPECT_FALSE(test, mode.specified);
>  	KUNIT_EXPECT_FALSE(test, mode.refresh_specified);
> @@ -797,7 +796,7 @@ static void drm_cmdline_test_freestanding_force_e_and_options(struct kunit *test
>  	struct drm_cmdline_mode mode = { };
>  	const char *cmdline = "e,margin_right=14,margin_left=24,margin_bottom=36,margin_top=42";
>  
> -	KUNIT_EXPECT_TRUE(test, drm_mode_parse_command_line_for_connector(cmdline,
> +	KUNIT_ASSERT_TRUE(test, drm_mode_parse_command_line_for_connector(cmdline,
>  									  &no_connector, &mode));
>  	KUNIT_EXPECT_FALSE(test, mode.specified);
>  	KUNIT_EXPECT_FALSE(test, mode.refresh_specified);
diff mbox series

Patch

diff --git a/drivers/gpu/drm/tests/drm_cmdline_parser_test.c b/drivers/gpu/drm/tests/drm_cmdline_parser_test.c
index 058808faaf4a..7a313e2fd52a 100644
--- a/drivers/gpu/drm/tests/drm_cmdline_parser_test.c
+++ b/drivers/gpu/drm/tests/drm_cmdline_parser_test.c
@@ -16,7 +16,7 @@  static void drm_cmdline_test_force_e_only(struct kunit *test)
 	struct drm_cmdline_mode mode = { };
 	const char *cmdline = "e";
 
-	KUNIT_EXPECT_TRUE(test, drm_mode_parse_command_line_for_connector(cmdline,
+	KUNIT_ASSERT_TRUE(test, drm_mode_parse_command_line_for_connector(cmdline,
 									  &no_connector, &mode));
 	KUNIT_EXPECT_FALSE(test, mode.specified);
 	KUNIT_EXPECT_FALSE(test, mode.refresh_specified);
@@ -34,7 +34,7 @@  static void drm_cmdline_test_force_D_only_not_digital(struct kunit *test)
 	struct drm_cmdline_mode mode = { };
 	const char *cmdline = "D";
 
-	KUNIT_EXPECT_TRUE(test, drm_mode_parse_command_line_for_connector(cmdline,
+	KUNIT_ASSERT_TRUE(test, drm_mode_parse_command_line_for_connector(cmdline,
 									  &no_connector, &mode));
 	KUNIT_EXPECT_FALSE(test, mode.specified);
 	KUNIT_EXPECT_FALSE(test, mode.refresh_specified);
@@ -47,16 +47,16 @@  static void drm_cmdline_test_force_D_only_not_digital(struct kunit *test)
 	KUNIT_EXPECT_EQ(test, mode.force, DRM_FORCE_ON);
 }
 
-static const struct drm_connector connector_hdmi = {
-	.connector_type	= DRM_MODE_CONNECTOR_HDMIB,
-};
 
 static void drm_cmdline_test_force_D_only_hdmi(struct kunit *test)
 {
 	struct drm_cmdline_mode mode = { };
+	const struct drm_connector connector_hdmi = {
+		.connector_type	= DRM_MODE_CONNECTOR_HDMIB,
+	};
 	const char *cmdline = "D";
 
-	KUNIT_EXPECT_TRUE(test, drm_mode_parse_command_line_for_connector(cmdline,
+	KUNIT_ASSERT_TRUE(test, drm_mode_parse_command_line_for_connector(cmdline,
 									  &connector_hdmi, &mode));
 	KUNIT_EXPECT_FALSE(test, mode.specified);
 	KUNIT_EXPECT_FALSE(test, mode.refresh_specified);
@@ -69,16 +69,15 @@  static void drm_cmdline_test_force_D_only_hdmi(struct kunit *test)
 	KUNIT_EXPECT_EQ(test, mode.force, DRM_FORCE_ON_DIGITAL);
 }
 
-static const struct drm_connector connector_dvi = {
-	.connector_type	= DRM_MODE_CONNECTOR_DVII,
-};
-
 static void drm_cmdline_test_force_D_only_dvi(struct kunit *test)
 {
 	struct drm_cmdline_mode mode = { };
+	const struct drm_connector connector_dvi = {
+		.connector_type = DRM_MODE_CONNECTOR_DVII,
+	};
 	const char *cmdline = "D";
 
-	KUNIT_EXPECT_TRUE(test, drm_mode_parse_command_line_for_connector(cmdline,
+	KUNIT_ASSERT_TRUE(test, drm_mode_parse_command_line_for_connector(cmdline,
 									  &connector_dvi, &mode));
 	KUNIT_EXPECT_FALSE(test, mode.specified);
 	KUNIT_EXPECT_FALSE(test, mode.refresh_specified);
@@ -96,7 +95,7 @@  static void drm_cmdline_test_force_d_only(struct kunit *test)
 	struct drm_cmdline_mode mode = { };
 	const char *cmdline = "d";
 
-	KUNIT_EXPECT_TRUE(test, drm_mode_parse_command_line_for_connector(cmdline,
+	KUNIT_ASSERT_TRUE(test, drm_mode_parse_command_line_for_connector(cmdline,
 									  &no_connector, &mode));
 	KUNIT_EXPECT_FALSE(test, mode.specified);
 	KUNIT_EXPECT_FALSE(test, mode.refresh_specified);
@@ -114,7 +113,7 @@  static void drm_cmdline_test_res(struct kunit *test)
 	struct drm_cmdline_mode mode = { };
 	const char *cmdline = "720x480";
 
-	KUNIT_EXPECT_TRUE(test, drm_mode_parse_command_line_for_connector(cmdline,
+	KUNIT_ASSERT_TRUE(test, drm_mode_parse_command_line_for_connector(cmdline,
 									  &no_connector, &mode));
 	KUNIT_EXPECT_TRUE(test, mode.specified);
 	KUNIT_EXPECT_EQ(test, mode.xres, 720);
@@ -136,7 +135,7 @@  static void drm_cmdline_test_res_vesa(struct kunit *test)
 	struct drm_cmdline_mode mode = { };
 	const char *cmdline = "720x480M";
 
-	KUNIT_EXPECT_TRUE(test, drm_mode_parse_command_line_for_connector(cmdline,
+	KUNIT_ASSERT_TRUE(test, drm_mode_parse_command_line_for_connector(cmdline,
 									  &no_connector, &mode));
 	KUNIT_EXPECT_TRUE(test, mode.specified);
 	KUNIT_EXPECT_EQ(test, mode.xres, 720);
@@ -158,7 +157,7 @@  static void drm_cmdline_test_res_vesa_rblank(struct kunit *test)
 	struct drm_cmdline_mode mode = { };
 	const char *cmdline = "720x480MR";
 
-	KUNIT_EXPECT_TRUE(test, drm_mode_parse_command_line_for_connector(cmdline,
+	KUNIT_ASSERT_TRUE(test, drm_mode_parse_command_line_for_connector(cmdline,
 									  &no_connector, &mode));
 	KUNIT_EXPECT_TRUE(test, mode.specified);
 	KUNIT_EXPECT_EQ(test, mode.xres, 720);
@@ -180,7 +179,7 @@  static void drm_cmdline_test_res_rblank(struct kunit *test)
 	struct drm_cmdline_mode mode = { };
 	const char *cmdline = "720x480R";
 
-	KUNIT_EXPECT_TRUE(test, drm_mode_parse_command_line_for_connector(cmdline,
+	KUNIT_ASSERT_TRUE(test, drm_mode_parse_command_line_for_connector(cmdline,
 									  &no_connector, &mode));
 	KUNIT_EXPECT_TRUE(test, mode.specified);
 	KUNIT_EXPECT_EQ(test, mode.xres, 720);
@@ -202,7 +201,7 @@  static void drm_cmdline_test_res_bpp(struct kunit *test)
 	struct drm_cmdline_mode mode = { };
 	const char *cmdline = "720x480-24";
 
-	KUNIT_EXPECT_TRUE(test, drm_mode_parse_command_line_for_connector(cmdline,
+	KUNIT_ASSERT_TRUE(test, drm_mode_parse_command_line_for_connector(cmdline,
 									  &no_connector, &mode));
 	KUNIT_EXPECT_TRUE(test, mode.specified);
 	KUNIT_EXPECT_EQ(test, mode.xres, 720);
@@ -225,7 +224,7 @@  static void drm_cmdline_test_res_refresh(struct kunit *test)
 	struct drm_cmdline_mode mode = { };
 	const char *cmdline = "720x480@60";
 
-	KUNIT_EXPECT_TRUE(test, drm_mode_parse_command_line_for_connector(cmdline,
+	KUNIT_ASSERT_TRUE(test, drm_mode_parse_command_line_for_connector(cmdline,
 									  &no_connector, &mode));
 	KUNIT_EXPECT_TRUE(test, mode.specified);
 	KUNIT_EXPECT_EQ(test, mode.xres, 720);
@@ -248,7 +247,7 @@  static void drm_cmdline_test_res_bpp_refresh(struct kunit *test)
 	struct drm_cmdline_mode mode = { };
 	const char *cmdline = "720x480-24@60";
 
-	KUNIT_EXPECT_TRUE(test, drm_mode_parse_command_line_for_connector(cmdline,
+	KUNIT_ASSERT_TRUE(test, drm_mode_parse_command_line_for_connector(cmdline,
 									  &no_connector, &mode));
 	KUNIT_EXPECT_TRUE(test, mode.specified);
 	KUNIT_EXPECT_EQ(test, mode.xres, 720);
@@ -272,7 +271,7 @@  static void drm_cmdline_test_res_bpp_refresh_interlaced(struct kunit *test)
 	struct drm_cmdline_mode mode = { };
 	const char *cmdline = "720x480-24@60i";
 
-	KUNIT_EXPECT_TRUE(test, drm_mode_parse_command_line_for_connector(cmdline,
+	KUNIT_ASSERT_TRUE(test, drm_mode_parse_command_line_for_connector(cmdline,
 									  &no_connector, &mode));
 	KUNIT_EXPECT_TRUE(test, mode.specified);
 	KUNIT_EXPECT_EQ(test, mode.xres, 720);
@@ -294,9 +293,9 @@  static void drm_cmdline_test_res_bpp_refresh_interlaced(struct kunit *test)
 static void drm_cmdline_test_res_bpp_refresh_margins(struct kunit *test)
 {
 	struct drm_cmdline_mode mode = { };
-	const char *cmdline =  "720x480-24@60m";
+	const char *cmdline = "720x480-24@60m";
 
-	KUNIT_EXPECT_TRUE(test, drm_mode_parse_command_line_for_connector(cmdline,
+	KUNIT_ASSERT_TRUE(test, drm_mode_parse_command_line_for_connector(cmdline,
 									  &no_connector, &mode));
 	KUNIT_EXPECT_TRUE(test, mode.specified);
 	KUNIT_EXPECT_EQ(test, mode.xres, 720);
@@ -318,9 +317,9 @@  static void drm_cmdline_test_res_bpp_refresh_margins(struct kunit *test)
 static void drm_cmdline_test_res_bpp_refresh_force_off(struct kunit *test)
 {
 	struct drm_cmdline_mode mode = { };
-	const char *cmdline =  "720x480-24@60d";
+	const char *cmdline = "720x480-24@60d";
 
-	KUNIT_EXPECT_TRUE(test, drm_mode_parse_command_line_for_connector(cmdline,
+	KUNIT_ASSERT_TRUE(test, drm_mode_parse_command_line_for_connector(cmdline,
 									  &no_connector, &mode));
 	KUNIT_EXPECT_TRUE(test, mode.specified);
 	KUNIT_EXPECT_EQ(test, mode.xres, 720);
@@ -342,9 +341,9 @@  static void drm_cmdline_test_res_bpp_refresh_force_off(struct kunit *test)
 static void drm_cmdline_test_res_bpp_refresh_force_on(struct kunit *test)
 {
 	struct drm_cmdline_mode mode = { };
-	const char *cmdline =  "720x480-24@60e";
+	const char *cmdline = "720x480-24@60e";
 
-	KUNIT_EXPECT_TRUE(test, drm_mode_parse_command_line_for_connector(cmdline,
+	KUNIT_ASSERT_TRUE(test, drm_mode_parse_command_line_for_connector(cmdline,
 									  &no_connector, &mode));
 	KUNIT_EXPECT_TRUE(test, mode.specified);
 	KUNIT_EXPECT_EQ(test, mode.xres, 720);
@@ -368,7 +367,7 @@  static void drm_cmdline_test_res_bpp_refresh_force_on_analog(struct kunit *test)
 	struct drm_cmdline_mode mode = { };
 	const char *cmdline = "720x480-24@60D";
 
-	KUNIT_EXPECT_TRUE(test, drm_mode_parse_command_line_for_connector(cmdline,
+	KUNIT_ASSERT_TRUE(test, drm_mode_parse_command_line_for_connector(cmdline,
 									  &no_connector, &mode));
 	KUNIT_EXPECT_TRUE(test, mode.specified);
 	KUNIT_EXPECT_EQ(test, mode.xres, 720);
@@ -390,12 +389,12 @@  static void drm_cmdline_test_res_bpp_refresh_force_on_analog(struct kunit *test)
 static void drm_cmdline_test_res_bpp_refresh_force_on_digital(struct kunit *test)
 {
 	struct drm_cmdline_mode mode = { };
-	static const struct drm_connector connector = {
+	const struct drm_connector connector = {
 		.connector_type = DRM_MODE_CONNECTOR_DVII,
 	};
 	const char *cmdline = "720x480-24@60D";
 
-	KUNIT_EXPECT_TRUE(test, drm_mode_parse_command_line_for_connector(cmdline,
+	KUNIT_ASSERT_TRUE(test, drm_mode_parse_command_line_for_connector(cmdline,
 									  &connector, &mode));
 	KUNIT_EXPECT_TRUE(test, mode.specified);
 	KUNIT_EXPECT_EQ(test, mode.xres, 720);
@@ -443,7 +442,7 @@  static void drm_cmdline_test_res_margins_force_on(struct kunit *test)
 	struct drm_cmdline_mode mode = { };
 	const char *cmdline = "720x480me";
 
-	KUNIT_EXPECT_TRUE(test, drm_mode_parse_command_line_for_connector(cmdline,
+	KUNIT_ASSERT_TRUE(test, drm_mode_parse_command_line_for_connector(cmdline,
 									  &no_connector, &mode));
 	KUNIT_EXPECT_TRUE(test, mode.specified);
 	KUNIT_EXPECT_EQ(test, mode.xres, 720);
@@ -465,7 +464,7 @@  static void drm_cmdline_test_res_vesa_margins(struct kunit *test)
 	struct drm_cmdline_mode mode = { };
 	const char *cmdline = "720x480Mm";
 
-	KUNIT_EXPECT_TRUE(test, drm_mode_parse_command_line_for_connector(cmdline,
+	KUNIT_ASSERT_TRUE(test, drm_mode_parse_command_line_for_connector(cmdline,
 									  &no_connector, &mode));
 	KUNIT_EXPECT_TRUE(test, mode.specified);
 	KUNIT_EXPECT_EQ(test, mode.xres, 720);
@@ -487,7 +486,7 @@  static void drm_cmdline_test_name(struct kunit *test)
 	struct drm_cmdline_mode mode = { };
 	const char *cmdline = "NTSC";
 
-	KUNIT_EXPECT_TRUE(test, drm_mode_parse_command_line_for_connector(cmdline,
+	KUNIT_ASSERT_TRUE(test, drm_mode_parse_command_line_for_connector(cmdline,
 									  &no_connector, &mode));
 	KUNIT_EXPECT_STREQ(test, mode.name, "NTSC");
 	KUNIT_EXPECT_FALSE(test, mode.refresh_specified);
@@ -499,7 +498,7 @@  static void drm_cmdline_test_name_bpp(struct kunit *test)
 	struct drm_cmdline_mode mode = { };
 	const char *cmdline = "NTSC-24";
 
-	KUNIT_EXPECT_TRUE(test, drm_mode_parse_command_line_for_connector(cmdline,
+	KUNIT_ASSERT_TRUE(test, drm_mode_parse_command_line_for_connector(cmdline,
 									  &no_connector, &mode));
 	KUNIT_EXPECT_STREQ(test, mode.name, "NTSC");
 
@@ -514,7 +513,7 @@  static void drm_cmdline_test_name_option(struct kunit *test)
 	struct drm_cmdline_mode mode = { };
 	const char *cmdline = "NTSC,rotate=180";
 
-	KUNIT_EXPECT_TRUE(test, drm_mode_parse_command_line_for_connector(cmdline,
+	KUNIT_ASSERT_TRUE(test, drm_mode_parse_command_line_for_connector(cmdline,
 									  &no_connector, &mode));
 	KUNIT_EXPECT_TRUE(test, mode.specified);
 	KUNIT_EXPECT_STREQ(test, mode.name, "NTSC");
@@ -526,7 +525,7 @@  static void drm_cmdline_test_name_bpp_option(struct kunit *test)
 	struct drm_cmdline_mode mode = { };
 	const char *cmdline = "NTSC-24,rotate=180";
 
-	KUNIT_EXPECT_TRUE(test, drm_mode_parse_command_line_for_connector(cmdline,
+	KUNIT_ASSERT_TRUE(test, drm_mode_parse_command_line_for_connector(cmdline,
 									  &no_connector, &mode));
 	KUNIT_EXPECT_TRUE(test, mode.specified);
 	KUNIT_EXPECT_STREQ(test, mode.name, "NTSC");
@@ -540,7 +539,7 @@  static void drm_cmdline_test_rotate_0(struct kunit *test)
 	struct drm_cmdline_mode mode = { };
 	const char *cmdline = "720x480,rotate=0";
 
-	KUNIT_EXPECT_TRUE(test, drm_mode_parse_command_line_for_connector(cmdline,
+	KUNIT_ASSERT_TRUE(test, drm_mode_parse_command_line_for_connector(cmdline,
 									  &no_connector, &mode));
 	KUNIT_EXPECT_TRUE(test, mode.specified);
 	KUNIT_EXPECT_EQ(test, mode.xres, 720);
@@ -563,7 +562,7 @@  static void drm_cmdline_test_rotate_90(struct kunit *test)
 	struct drm_cmdline_mode mode = { };
 	const char *cmdline = "720x480,rotate=90";
 
-	KUNIT_EXPECT_TRUE(test, drm_mode_parse_command_line_for_connector(cmdline,
+	KUNIT_ASSERT_TRUE(test, drm_mode_parse_command_line_for_connector(cmdline,
 									  &no_connector, &mode));
 	KUNIT_EXPECT_TRUE(test, mode.specified);
 	KUNIT_EXPECT_EQ(test, mode.xres, 720);
@@ -586,7 +585,7 @@  static void drm_cmdline_test_rotate_180(struct kunit *test)
 	struct drm_cmdline_mode mode = { };
 	const char *cmdline = "720x480,rotate=180";
 
-	KUNIT_EXPECT_TRUE(test, drm_mode_parse_command_line_for_connector(cmdline,
+	KUNIT_ASSERT_TRUE(test, drm_mode_parse_command_line_for_connector(cmdline,
 									  &no_connector, &mode));
 	KUNIT_EXPECT_TRUE(test, mode.specified);
 	KUNIT_EXPECT_EQ(test, mode.xres, 720);
@@ -609,7 +608,7 @@  static void drm_cmdline_test_rotate_270(struct kunit *test)
 	struct drm_cmdline_mode mode = { };
 	const char *cmdline = "720x480,rotate=270";
 
-	KUNIT_EXPECT_TRUE(test, drm_mode_parse_command_line_for_connector(cmdline,
+	KUNIT_ASSERT_TRUE(test, drm_mode_parse_command_line_for_connector(cmdline,
 									  &no_connector, &mode));
 	KUNIT_EXPECT_TRUE(test, mode.specified);
 	KUNIT_EXPECT_EQ(test, mode.xres, 720);
@@ -632,7 +631,7 @@  static void drm_cmdline_test_hmirror(struct kunit *test)
 	struct drm_cmdline_mode mode = { };
 	const char *cmdline = "720x480,reflect_x";
 
-	KUNIT_EXPECT_TRUE(test, drm_mode_parse_command_line_for_connector(cmdline,
+	KUNIT_ASSERT_TRUE(test, drm_mode_parse_command_line_for_connector(cmdline,
 									  &no_connector, &mode));
 	KUNIT_EXPECT_TRUE(test, mode.specified);
 	KUNIT_EXPECT_EQ(test, mode.xres, 720);
@@ -655,7 +654,7 @@  static void drm_cmdline_test_vmirror(struct kunit *test)
 	struct drm_cmdline_mode mode = { };
 	const char *cmdline = "720x480,reflect_y";
 
-	KUNIT_EXPECT_TRUE(test, drm_mode_parse_command_line_for_connector(cmdline,
+	KUNIT_ASSERT_TRUE(test, drm_mode_parse_command_line_for_connector(cmdline,
 									  &no_connector, &mode));
 	KUNIT_EXPECT_TRUE(test, mode.specified);
 	KUNIT_EXPECT_EQ(test, mode.xres, 720);
@@ -679,7 +678,7 @@  static void drm_cmdline_test_margin_options(struct kunit *test)
 	const char *cmdline =
 		"720x480,margin_right=14,margin_left=24,margin_bottom=36,margin_top=42";
 
-	KUNIT_EXPECT_TRUE(test, drm_mode_parse_command_line_for_connector(cmdline,
+	KUNIT_ASSERT_TRUE(test, drm_mode_parse_command_line_for_connector(cmdline,
 									  &no_connector, &mode));
 	KUNIT_EXPECT_TRUE(test, mode.specified);
 	KUNIT_EXPECT_EQ(test, mode.xres, 720);
@@ -705,7 +704,7 @@  static void drm_cmdline_test_multiple_options(struct kunit *test)
 	struct drm_cmdline_mode mode = { };
 	const char *cmdline = "720x480,rotate=270,reflect_x";
 
-	KUNIT_EXPECT_TRUE(test, drm_mode_parse_command_line_for_connector(cmdline,
+	KUNIT_ASSERT_TRUE(test, drm_mode_parse_command_line_for_connector(cmdline,
 									  &no_connector, &mode));
 	KUNIT_EXPECT_TRUE(test, mode.specified);
 	KUNIT_EXPECT_EQ(test, mode.xres, 720);
@@ -728,7 +727,7 @@  static void drm_cmdline_test_bpp_extra_and_option(struct kunit *test)
 	struct drm_cmdline_mode mode = { };
 	const char *cmdline = "720x480-24e,rotate=180";
 
-	KUNIT_EXPECT_TRUE(test, drm_mode_parse_command_line_for_connector(cmdline,
+	KUNIT_ASSERT_TRUE(test, drm_mode_parse_command_line_for_connector(cmdline,
 									  &no_connector, &mode));
 	KUNIT_EXPECT_TRUE(test, mode.specified);
 	KUNIT_EXPECT_EQ(test, mode.xres, 720);
@@ -752,7 +751,7 @@  static void drm_cmdline_test_extra_and_option(struct kunit *test)
 	struct drm_cmdline_mode mode = { };
 	const char *cmdline = "720x480e,rotate=180";
 
-	KUNIT_EXPECT_TRUE(test, drm_mode_parse_command_line_for_connector(cmdline,
+	KUNIT_ASSERT_TRUE(test, drm_mode_parse_command_line_for_connector(cmdline,
 									  &no_connector, &mode));
 	KUNIT_EXPECT_TRUE(test, mode.specified);
 	KUNIT_EXPECT_EQ(test, mode.xres, 720);
@@ -774,7 +773,7 @@  static void drm_cmdline_test_freestanding_options(struct kunit *test)
 	struct drm_cmdline_mode mode = { };
 	const char *cmdline = "margin_right=14,margin_left=24,margin_bottom=36,margin_top=42";
 
-	KUNIT_EXPECT_TRUE(test, drm_mode_parse_command_line_for_connector(cmdline,
+	KUNIT_ASSERT_TRUE(test, drm_mode_parse_command_line_for_connector(cmdline,
 									  &no_connector, &mode));
 	KUNIT_EXPECT_FALSE(test, mode.specified);
 	KUNIT_EXPECT_FALSE(test, mode.refresh_specified);
@@ -797,7 +796,7 @@  static void drm_cmdline_test_freestanding_force_e_and_options(struct kunit *test
 	struct drm_cmdline_mode mode = { };
 	const char *cmdline = "e,margin_right=14,margin_left=24,margin_bottom=36,margin_top=42";
 
-	KUNIT_EXPECT_TRUE(test, drm_mode_parse_command_line_for_connector(cmdline,
+	KUNIT_ASSERT_TRUE(test, drm_mode_parse_command_line_for_connector(cmdline,
 									  &no_connector, &mode));
 	KUNIT_EXPECT_FALSE(test, mode.specified);
 	KUNIT_EXPECT_FALSE(test, mode.refresh_specified);