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]
Message-ID: <2023071052-hedging-blurb-2a20@gregkh>
Date:   Mon, 10 Jul 2023 15:31:13 +0200
From:   Greg Kroah-Hartman <gregkh@...uxfoundation.org>
To:     Dmitry Baryshkov <dmitry.baryshkov@...aro.org>
Cc:     Konrad Dybcio <konrad.dybcio@...aro.org>,
        Bryan O'Donoghue <bryan.odonoghue@...aro.org>,
        Heikki Krogerus <heikki.krogerus@...ux.intel.com>,
        Guenter Roeck <linux@...ck-us.net>,
        Andy Gross <agross@...nel.org>,
        Bjorn Andersson <andersson@...nel.org>,
        linux-usb@...r.kernel.org, linux-kernel@...r.kernel.org,
        linux-arm-msm@...r.kernel.org
Subject: Re: [PATCH v2 2/2] usb: typec: qcom-pmic-typec: register drm_bridge

On Mon, Jul 10, 2023 at 01:57:06PM +0300, Dmitry Baryshkov wrote:
> On Mon, 10 Jul 2023 at 13:04, Konrad Dybcio <konrad.dybcio@...aro.org> wrote:
> >
> > On 10.07.2023 12:02, Bryan O'Donoghue wrote:
> > > On 09/07/2023 21:13, Dmitry Baryshkov wrote:
> > >> The current approach to handling DP on bridge-enabled platforms requires
> > >> a chain of DP bridges up to the USB-C connector. Register a last DRM
> > >> bridge for such chain.
> > >>
> > >> Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@...aro.org>
> > >> ---
> > >>   drivers/usb/typec/tcpm/Kconfig                |  1 +
> > >>   drivers/usb/typec/tcpm/qcom/qcom_pmic_typec.c | 39 +++++++++++++++++++
> > >>   2 files changed, 40 insertions(+)
> > >>
> > >> diff --git a/drivers/usb/typec/tcpm/Kconfig b/drivers/usb/typec/tcpm/Kconfig
> > >> index 5d393f520fc2..0b2993fef564 100644
> > >> --- a/drivers/usb/typec/tcpm/Kconfig
> > >> +++ b/drivers/usb/typec/tcpm/Kconfig
> > >> @@ -79,6 +79,7 @@ config TYPEC_WCOVE
> > >>   config TYPEC_QCOM_PMIC
> > >>       tristate "Qualcomm PMIC USB Type-C Port Controller Manager driver"
> > >>       depends on ARCH_QCOM || COMPILE_TEST
> > >> +    depends on DRM || DRM=n
> > >>       help
> > >>         A Type-C port and Power Delivery driver which aggregates two
> > >>         discrete pieces of silicon in the PM8150b PMIC block: the
> > >> diff --git a/drivers/usb/typec/tcpm/qcom/qcom_pmic_typec.c b/drivers/usb/typec/tcpm/qcom/qcom_pmic_typec.c
> > >> index a905160dd860..0722fb8d75c4 100644
> > >> --- a/drivers/usb/typec/tcpm/qcom/qcom_pmic_typec.c
> > >> +++ b/drivers/usb/typec/tcpm/qcom/qcom_pmic_typec.c
> > >> @@ -17,6 +17,9 @@
> > >>   #include <linux/usb/role.h>
> > >>   #include <linux/usb/tcpm.h>
> > >>   #include <linux/usb/typec_mux.h>
> > >> +
> > >> +#include <drm/drm_bridge.h>
> > >> +
> > >>   #include "qcom_pmic_typec_pdphy.h"
> > >>   #include "qcom_pmic_typec_port.h"
> > >>   @@ -33,6 +36,9 @@ struct pmic_typec {
> > >>       struct pmic_typec_port    *pmic_typec_port;
> > >>       bool            vbus_enabled;
> > >>       struct mutex        lock;        /* VBUS state serialization */
> > >> +#ifdef CONFIG_DRM
> > >> +    struct drm_bridge    bridge;
> > >> +#endif
> > >
> > > IMO there's no reason to ifdef the structure. Its up to you if you want to change it nor not, I have no strong feelings about it.
> > +1, there's no ifdefs in the drm_bridge.h header that would make this not compile
> 
> It is quite typical to idef unused structure fields. For example
> OF-related fields are frequently ifdef'ed.
> Let's see what the maintainers will say.

Please do not put #ifdef in .c files.

If it's not needed, please remove.

thanks,

greg k-h

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ