diff mbox

[2/2] hw/omap_dma: add matching {} in if 0

Message ID 20091001055144.GC5068@redhat.com
State Superseded
Headers show

Commit Message

Michael S. Tsirkin Oct. 1, 2009, 5:51 a.m. UTC
MULTI_REQ is never defined, so it doesn't matter much, but since we have
an if statement there, let's add {} to clarify what it should do if it's
uncommented.

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
---
 hw/omap_dma.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

Comments

Markus Armbruster Oct. 1, 2009, 1:05 p.m. UTC | #1
"Michael S. Tsirkin" <mst@redhat.com> writes:

> MULTI_REQ is never defined, so it doesn't matter much, but since we have
> an if statement there, let's add {} to clarify what it should do if it's
> uncommented.
>
> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
> ---
>  hw/omap_dma.c |    4 +++-
>  1 files changed, 3 insertions(+), 1 deletions(-)
>
> diff --git a/hw/omap_dma.c b/hw/omap_dma.c
> index 205d010..ab5e925 100644
> --- a/hw/omap_dma.c
> +++ b/hw/omap_dma.c
> @@ -588,7 +588,7 @@ static void omap_dma_transfer_setup(struct soc_dma_ch_s *dma)
>  #ifdef MULTI_REQ
>      /* TODO: should all of this only be done if dma->update, and otherwise
>       * inside omap_dma_transfer_generic below - check what's faster.  */
> -    if (dma->update)
> +    if (dma->update) {
>  #endif
>  
>      /* If the channel is element synchronized, deactivate it */
> @@ -670,6 +670,8 @@ static void omap_dma_transfer_setup(struct soc_dma_ch_s *dma)
>           * bits on it.  */
>  #ifndef MULTI_REQ
>      }
> +#else
> +    }
>  #endif
>  
>      omap_dma_interrupts_update(s);

Doesn't this look silly?  Just close the brace :)
Michael S. Tsirkin Oct. 1, 2009, 1:10 p.m. UTC | #2
On Thu, Oct 01, 2009 at 03:05:49PM +0200, Markus Armbruster wrote:
> "Michael S. Tsirkin" <mst@redhat.com> writes:
> 
> > MULTI_REQ is never defined, so it doesn't matter much, but since we have
> > an if statement there, let's add {} to clarify what it should do if it's
> > uncommented.
> >
> > Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
> > ---
> >  hw/omap_dma.c |    4 +++-
> >  1 files changed, 3 insertions(+), 1 deletions(-)
> >
> > diff --git a/hw/omap_dma.c b/hw/omap_dma.c
> > index 205d010..ab5e925 100644
> > --- a/hw/omap_dma.c
> > +++ b/hw/omap_dma.c
> > @@ -588,7 +588,7 @@ static void omap_dma_transfer_setup(struct soc_dma_ch_s *dma)
> >  #ifdef MULTI_REQ
> >      /* TODO: should all of this only be done if dma->update, and otherwise
> >       * inside omap_dma_transfer_generic below - check what's faster.  */
> > -    if (dma->update)
> > +    if (dma->update) {
> >  #endif
> >  
> >      /* If the channel is element synchronized, deactivate it */
> > @@ -670,6 +670,8 @@ static void omap_dma_transfer_setup(struct soc_dma_ch_s *dma)
> >           * bits on it.  */
> >  #ifndef MULTI_REQ
> >      }
> > +#else
> > +    }
> >  #endif
> >  
> >      omap_dma_interrupts_update(s);
> 
> Doesn't this look silly?  Just close the brace :)

This way we get more {'s than }'s, which is even more ugly.
We probably should indent the text within if (dma->update) though.
Markus Armbruster Oct. 1, 2009, 2:05 p.m. UTC | #3
"Michael S. Tsirkin" <mst@redhat.com> writes:

> On Thu, Oct 01, 2009 at 03:05:49PM +0200, Markus Armbruster wrote:
>> "Michael S. Tsirkin" <mst@redhat.com> writes:
>> 
>> > MULTI_REQ is never defined, so it doesn't matter much, but since we have
>> > an if statement there, let's add {} to clarify what it should do if it's
>> > uncommented.
>> >
>> > Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
>> > ---
>> >  hw/omap_dma.c |    4 +++-
>> >  1 files changed, 3 insertions(+), 1 deletions(-)
>> >
>> > diff --git a/hw/omap_dma.c b/hw/omap_dma.c
>> > index 205d010..ab5e925 100644
>> > --- a/hw/omap_dma.c
>> > +++ b/hw/omap_dma.c
>> > @@ -588,7 +588,7 @@ static void omap_dma_transfer_setup(struct soc_dma_ch_s *dma)
>> >  #ifdef MULTI_REQ
>> >      /* TODO: should all of this only be done if dma->update, and otherwise
>> >       * inside omap_dma_transfer_generic below - check what's faster.  */
>> > -    if (dma->update)
>> > +    if (dma->update) {
>> >  #endif
>> >  
>> >      /* If the channel is element synchronized, deactivate it */
>> > @@ -670,6 +670,8 @@ static void omap_dma_transfer_setup(struct soc_dma_ch_s *dma)
>> >           * bits on it.  */
>> >  #ifndef MULTI_REQ
>> >      }
>> > +#else
>> > +    }
>> >  #endif
>> >  
>> >      omap_dma_interrupts_update(s);
>> 
>> Doesn't this look silly?  Just close the brace :)
>
> This way we get more {'s than }'s, which is even more ugly.
> We probably should indent the text within if (dma->update) though.

I'd just kill the dead code, keep only the TODO comment.
diff mbox

Patch

diff --git a/hw/omap_dma.c b/hw/omap_dma.c
index 205d010..ab5e925 100644
--- a/hw/omap_dma.c
+++ b/hw/omap_dma.c
@@ -588,7 +588,7 @@  static void omap_dma_transfer_setup(struct soc_dma_ch_s *dma)
 #ifdef MULTI_REQ
     /* TODO: should all of this only be done if dma->update, and otherwise
      * inside omap_dma_transfer_generic below - check what's faster.  */
-    if (dma->update)
+    if (dma->update) {
 #endif
 
     /* If the channel is element synchronized, deactivate it */
@@ -670,6 +670,8 @@  static void omap_dma_transfer_setup(struct soc_dma_ch_s *dma)
          * bits on it.  */
 #ifndef MULTI_REQ
     }
+#else
+    }
 #endif
 
     omap_dma_interrupts_update(s);