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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Wed, 7 Apr 2021 12:15:57 +0200 (CEST)
From:   Julia Lawall <julia.lawall@...ia.fr>
To:     Beatriz Martins de Carvalho <martinsdecarvalhobeatriz@...il.com>
cc:     Matthew Wilcox <willy@...radead.org>,
        laurent.pinchart@...asonboard.com, mchehab@...nel.org,
        gregkh@...uxfoundation.org, linux-media@...r.kernel.org,
        linux-staging@...ts.linux.dev, linux-kernel@...r.kernel.org,
        outreachy-kernel@...glegroups.com
Subject: Re: [Outreachy kernel] [PATCH 1/2] staging: media: omap4iss: Ending
 line with argument



On Wed, 7 Apr 2021, Beatriz Martins de Carvalho wrote:

>
> Em 01/04/21 16:28, Matthew Wilcox escreveu:
> > On Thu, Apr 01, 2021 at 04:07:38PM +0100, Beatriz Martins de Carvalho wrote:
> > > diff --git a/drivers/staging/media/omap4iss/iss.c
> > > b/drivers/staging/media/omap4iss/iss.c
> > > index dae9073e7d3c..e8f724dbf810 100644
> > > --- a/drivers/staging/media/omap4iss/iss.c
> > > +++ b/drivers/staging/media/omap4iss/iss.c
> > > @@ -559,9 +559,10 @@ static int iss_reset(struct iss_device *iss)
> > >   	iss_reg_set(iss, OMAP4_ISS_MEM_TOP, ISS_HL_SYSCONFIG,
> > >   		    ISS_HL_SYSCONFIG_SOFTRESET);
> > >   -	timeout = iss_poll_condition_timeout(
> > > -		!(iss_reg_read(iss, OMAP4_ISS_MEM_TOP, ISS_HL_SYSCONFIG) &
> > > -		ISS_HL_SYSCONFIG_SOFTRESET), 1000, 10, 100);
> > > +	timeout = iss_poll_condition_timeout(!(iss_reg_read(iss,
> > > +							    OMAP4_ISS_MEM_TOP,
> > > ISS_HL_SYSCONFIG)
> > > +							    &
> > > ISS_HL_SYSCONFIG_SOFTRESET),
> > > +							    1000, 10, 100);
> > This is not a readability improvment.  I would factor it out into its
> > own function.
>
> Thanks for the review. How can I do this? I don't know how to do this.

Copy the code into a new function.  Then see what parameters this function
needs for the various information it requires.  The code will produce some
results that are needed by the rest of the program.  So you have to
arrange via the return value that the proper variables are initialized
after the function call.

For example,

x = a + b;

could become

int f(int a, int b) {
  return a + b;
}

x = f(a,b);

That is a pretty silly change, but it gives the idea.

julia

> Beatriz Martins de Carvalho
>
> --
> You received this message because you are subscribed to the Google Groups
> "outreachy-kernel" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to outreachy-kernel+unsubscribe@...glegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/outreachy-kernel/e175859f-4f68-0408-415f-a3e19f7e4874%40gmail.com.
>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ