public inbox for linux-arm-kernel@lists.infradead.org
 help / color / mirror / Atom feed
From: dan.carpenter@oracle.com (Dan Carpenter)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v2 4/5] staging: vc04_services: Surround complex macros
Date: Mon, 24 Sep 2018 12:58:19 +0300	[thread overview]
Message-ID: <20180924095819.q3zsqspddxjlsc2e@mwanda> (raw)
In-Reply-To: <20180923140620.14583-5-qader.aymen@gmail.com>

On Sun, Sep 23, 2018 at 03:06:19PM +0100, Aymen Qader wrote:
> This patch fixes the checkpatch.pl error:
> 
> ERROR: Macros with complex values should be enclosed in parentheses
> 
> in the interface/vchi directory
> 
> Signed-off-by: Aymen Qader <qader.aymen@gmail.com>
> ---
>  drivers/staging/vc04_services/interface/vchi/vchi.h | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/staging/vc04_services/interface/vchi/vchi.h b/drivers/staging/vc04_services/interface/vchi/vchi.h
> index d8e660240a44..f818cf2e27e1 100644
> --- a/drivers/staging/vc04_services/interface/vchi/vchi.h
> +++ b/drivers/staging/vc04_services/interface/vchi/vchi.h
> @@ -92,14 +92,14 @@ typedef struct vchi_msg_vector_ex {
>  } VCHI_MSG_VECTOR_EX_T;
>  
>  // Construct an entry in a msg vector for a pointer (p) of length (l)
> -#define VCHI_VEC_POINTER(p, l)  VCHI_VEC_POINTER, { { (VCHI_MEM_HANDLE_T)(p), (l) } }
> +#define VCHI_VEC_POINTER(p, l)  (VCHI_VEC_POINTER, { { (VCHI_MEM_HANDLE_T)(p), (l) } })
>  
>  // Construct an entry in a msg vector for a message handle (h), starting at offset (o) of length (l)
> -#define VCHI_VEC_HANDLE(h, o, l) VCHI_VEC_HANDLE,  { { (h), (o), (l) } }
> +#define VCHI_VEC_HANDLE(h, o, l) (VCHI_VEC_HANDLE,  { { (h), (o), (l) } })
>  
>  // Macros to manipulate 'FOURCC' values
>  #define MAKE_FOURCC(x) ((int32_t)((x[0] << 24) | (x[1] << 16) | (x[2] << 8) | x[3]))
> -#define FOURCC_TO_CHAR(x) (x >> 24) & 0xFF, (x >> 16) & 0xFF, (x >> 8) & 0xFF, x & 0xFF
> +#define FOURCC_TO_CHAR(x) ((x >> 24) & 0xFF, (x >> 16) & 0xFF, (x >> 8) & 0xFF, x & 0xFF)
>  

These are never used so far as I can see, but if they were, then this
would probably break the code.  Go through the git log and find out how
they used to work and if they can be removed.

regards,
dan carpenter

  reply	other threads:[~2018-09-24  9:58 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-09-23 14:06 [PATCH v2 0/5] staging: vc04_services: Fix checkpatch.pl errors Aymen Qader
2018-09-23 14:06 ` [PATCH v2 1/5] staging: vc04_services: Fix "space prohibited" Aymen Qader
2018-09-23 14:06 ` [PATCH v2 2/5] staging: vc04_services: Use tabs instead of spaces Aymen Qader
2018-09-23 14:06 ` [PATCH v2 3/5] staging: vc04_services: Add spaces after commas Aymen Qader
2018-09-23 14:06 ` [PATCH v2 4/5] staging: vc04_services: Surround complex macros Aymen Qader
2018-09-24  9:58   ` Dan Carpenter [this message]
2018-09-23 14:06 ` [PATCH v2 5/5] staging: vc04_services: Remove spaces after '*' Aymen Qader
2018-09-24 10:02   ` Dan Carpenter
2018-09-24 10:06 ` [PATCH v2 0/5] staging: vc04_services: Fix checkpatch.pl errors Dan Carpenter
2018-09-24 17:27 ` [PATCH v3 0/4] " Aymen Qader
2018-09-24 17:27   ` [PATCH v3 1/4] staging: vc04_services: Fix "space prohibited" Aymen Qader
2018-09-24 17:27   ` [PATCH v3 2/4] staging: vc04_services: Use tabs instead of spaces Aymen Qader
2018-09-24 17:27   ` [PATCH v3 3/4] staging: vc04_services: Remove unused macros Aymen Qader
2018-09-24 17:27   ` [PATCH v3 4/4] staging: vc04_services: Remove spaces after '*' Aymen Qader

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180924095819.q3zsqspddxjlsc2e@mwanda \
    --to=dan.carpenter@oracle.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox