lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:   Fri, 24 Feb 2023 10:15:50 +0800
From:   suijingfeng <suijingfeng@...ngson.cn>
To:     Thomas Zimmermann <tzimmermann@...e.de>,
        suijingfeng <15330273260@....cn>,
        Maarten Lankhorst <maarten.lankhorst@...ux.intel.com>,
        Maxime Ripard <mripard@...nel.org>,
        David Airlie <airlied@...ux.ie>,
        Daniel Vetter <daniel@...ll.ch>
Cc:     dri-devel@...ts.freedesktop.org, linux-kernel@...r.kernel.org,
        Li Yi <liyi@...ngson.cn>
Subject: Re: [PATCH v4] drm: add kms driver for loongson display controller


On 2023/2/23 22:07, Thomas Zimmermann wrote:
>
> It's the same story all over: you rather want to remove all these 
> lookup helpers and do a single test before you create the modesetting 
> pipeline:
>
>  if (chip == LS7A2000 && index == 0)
>     lscd_create_output_ls7a2000_0();
>  else if (chip == LS7A2000 && index == 1)
>     lscd_create_output_ls7a2000_1();
>  else if (chip == LS7A1000 && index == 0)
>     lscd_create_output_ls7a1000_0();
>  else if (chip == LS7A1000 && index == 1)
>     lscd_create_output_ls7a1000_1();
>  else if (...)
>     ...
>
> There you create the data structures for each pair of chip and index. 
> If you have functions that can be used by multiple pairs, sharing 
> those is fine. You might end up with duplicated code, but the overall 
> design is sound.
>
> Your current design will become unmaintainable pretty soon. We already 
> have several of such drivers.


Yes, your are right.

I'm fear of the duplicated code in the past.

I did not put my attention to the maintainable of the software.

a quick skim through radeon, I find that there also seems have 
"duplicated" code, this is  a design.

I didn't get it before, now I get it.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ