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] [thread-next>] [day] [month] [year] [list]
Date:   Wed, 16 Jun 2021 17:57:47 +0300
From:   Andy Shevchenko <andy.shevchenko@...il.com>
To:     Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
        Alexander Gordeev <agordeev@...ux.ibm.com>
Cc:     Andy Shevchenko <andriy.shevchenko@...ux.intel.com>,
        Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
        Rodolfo Giometti <giometti@...eenne.com>
Subject: Re: [PATCH v1 1/1] pps: generators: pps_gen_parport: Switch to use module_parport_driver()

+Cc: Alexander (I believe he is the author of the original code, sorry if not)

On Wed, Jun 16, 2021 at 5:47 PM Greg Kroah-Hartman
<gregkh@...uxfoundation.org> wrote:
>
> On Wed, Jun 16, 2021 at 05:31:21PM +0300, Andy Shevchenko wrote:
> > Switch to use module_parport_driver() to reduce boilerplate code.
> >
> > Signed-off-by: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
> > ---
> >  drivers/pps/generators/pps_gen_parport.c | 44 +++++-------------------
> >  1 file changed, 9 insertions(+), 35 deletions(-)
> >
> > diff --git a/drivers/pps/generators/pps_gen_parport.c b/drivers/pps/generators/pps_gen_parport.c
> > index 6a1af7664f3b..565f99782402 100644
> > --- a/drivers/pps/generators/pps_gen_parport.c
> > +++ b/drivers/pps/generators/pps_gen_parport.c
> > @@ -20,8 +20,6 @@
> >  #include <linux/hrtimer.h>
> >  #include <linux/parport.h>
> >
> > -#define DRVDESC "parallel port PPS signal generator"
> > -
> >  #define SIGNAL               0
> >  #define NO_SIGNAL    PARPORT_CONTROL_STROBE
> >
> > @@ -180,6 +178,11 @@ static void parport_attach(struct parport *port)
> >  {
> >       struct pardev_cb pps_cb;
> >
> > +     if (send_delay > SEND_DELAY_MAX) {
> > +             pr_err("delay value should be not greater then %d\n", SEND_DELAY_MAX);
> > +             return -EINVAL;
>
> Note this is at a later point in time than before, are you sure this is
> ok?

Yes, it doesn't matter when we check the module parameter.

If it's writable we even have more flexibility of changing it at
runtime (when built-in the kernel) after this patch.

> > +     }
> > +
> >       if (attached) {
> >               /* we already have a port */
> >               return;
> > @@ -223,6 +226,8 @@ static void parport_detach(struct parport *port)
> >       hrtimer_cancel(&device.timer);
> >       parport_release(device.pardev);
> >       parport_unregister_device(device.pardev);
> > +
> > +     pr_info("hrtimer avg error is %ldns\n", hrtimer_error);
>
> Why is this line needed?  When drivers work properly, they are quiet.
>
> I know the existing code has it, no reason it needs to stay here, that's
> why we created these macros, to remove the ability for drivers to be
> printing junk like this that they do not need to be printing.

I believe it may be useful for some debugging / statistics. But let's
ask Alexander about this.

-- 
With Best Regards,
Andy Shevchenko

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ