All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@oracle.com>
To: Moses Christopher Bollavarapu <mosescb.dev@gmail.com>
Cc: andriy.shevchenko@linux.intel.com, gregkh@linuxfoundation.org,
	kitakar@gmail.com, laurent.pinchart@ideasonboard.com,
	linux-kernel@vger.kernel.org, linux-media@vger.kernel.org,
	linux-staging@lists.linux.dev, mchehab@kernel.org,
	sakari.ailus@linux.intel.com, tomi.valkeinen@ideasonboard.com,
	joe@perches.com
Subject: Re: [PATCH v2] staging: media: atomisp: Use BIT macro instead of left shifting
Date: Mon, 31 Jan 2022 10:36:24 +0300	[thread overview]
Message-ID: <20220131073624.GH1951@kadam> (raw)
In-Reply-To: <20220130180655.22970-1-mosescb.dev@gmail.com>

On Sun, Jan 30, 2022 at 07:06:55PM +0100, Moses Christopher Bollavarapu wrote:
> There is a BIT(nr) macro available in Linux Kernel,
> which does the same thing.
> Example: BIT(7) = (1UL << 7)
> 
> Also use GENMASK for masking
> Example: GENMASK(3, 0) = 0b00001111 (same as (1 << 4) - 1)
> 
> Signed-off-by: Moses Christopher Bollavarapu <mosescb.dev@gmail.com>

This patch does a couple unrelated things.  Break out the GENMASK()
change into its own patch.

> @@ -65,7 +66,7 @@ enum ia_css_fw_type {
>  	ia_css_sp_firmware,		/** Firmware for the SP */
>  	ia_css_isp_firmware,		/** Firmware for the ISP */
>  	ia_css_bootloader_firmware,	/** Firmware for the BootLoader */
> -	ia_css_acc_firmware		/** Firmware for accelrations */
> +	ia_css_acc_firmware,		/** Firmware for accelrations */
>  };

This change needs to be in its own patch.

> diff --git a/drivers/staging/media/atomisp/pci/ia_css_env.h b/drivers/staging/media/atomisp/pci/ia_css_env.h
> index 3b89bbd837a0..b9ebc14441a1 100644
> --- a/drivers/staging/media/atomisp/pci/ia_css_env.h
> +++ b/drivers/staging/media/atomisp/pci/ia_css_env.h
> @@ -18,6 +18,7 @@
>  
>  #include <type_support.h>
>  #include <linux/stdarg.h> /* va_list */
> +#include <linux/bits.h> /* BIT(nr) */

This comment is not required.

>  enum ia_css_rx_irq_info {
> -	IA_CSS_RX_IRQ_INFO_BUFFER_OVERRUN   = 1U << 0, /** buffer overrun */
> -	IA_CSS_RX_IRQ_INFO_ENTER_SLEEP_MODE = 1U << 1, /** entering sleep mode */
> -	IA_CSS_RX_IRQ_INFO_EXIT_SLEEP_MODE  = 1U << 2, /** exited sleep mode */
> -	IA_CSS_RX_IRQ_INFO_ECC_CORRECTED    = 1U << 3, /** ECC corrected */
> -	IA_CSS_RX_IRQ_INFO_ERR_SOT          = 1U << 4,
> +	IA_CSS_RX_IRQ_INFO_BUFFER_OVERRUN   = BIT(0), /** buffer overrun */
> +	IA_CSS_RX_IRQ_INFO_ENTER_SLEEP_MODE = BIT(1), /** entering sleep mode */
> +	IA_CSS_RX_IRQ_INFO_EXIT_SLEEP_MODE  = BIT(2), /** exited sleep mode */
> +	IA_CSS_RX_IRQ_INFO_ECC_CORRECTED    = BIT(3), /** ECC corrected */
> +	IA_CSS_RX_IRQ_INFO_ERR_SOT          = BIT(4),
>  	/** Start of transmission */
> -	IA_CSS_RX_IRQ_INFO_ERR_SOT_SYNC     = 1U << 5, /** SOT sync (??) */
> -	IA_CSS_RX_IRQ_INFO_ERR_CONTROL      = 1U << 6, /** Control (??) */
> -	IA_CSS_RX_IRQ_INFO_ERR_ECC_DOUBLE   = 1U << 7, /** Double ECC */
> -	IA_CSS_RX_IRQ_INFO_ERR_CRC          = 1U << 8, /** CRC error */
> -	IA_CSS_RX_IRQ_INFO_ERR_UNKNOWN_ID   = 1U << 9, /** Unknown ID */
> -	IA_CSS_RX_IRQ_INFO_ERR_FRAME_SYNC   = 1U << 10,/** Frame sync error */
> -	IA_CSS_RX_IRQ_INFO_ERR_FRAME_DATA   = 1U << 11,/** Frame data error */
> -	IA_CSS_RX_IRQ_INFO_ERR_DATA_TIMEOUT = 1U << 12,/** Timeout occurred */
> -	IA_CSS_RX_IRQ_INFO_ERR_UNKNOWN_ESC  = 1U << 13,/** Unknown escape seq. */
> -	IA_CSS_RX_IRQ_INFO_ERR_LINE_SYNC    = 1U << 14,/** Line Sync error */
> -	IA_CSS_RX_IRQ_INFO_INIT_TIMEOUT     = 1U << 15,
> +	IA_CSS_RX_IRQ_INFO_ERR_SOT_SYNC     = BIT(5), /** SOT sync (??) */
> +	IA_CSS_RX_IRQ_INFO_ERR_CONTROL      = BIT(6), /** Control (??) */
> +	IA_CSS_RX_IRQ_INFO_ERR_ECC_DOUBLE   = BIT(7), /** Double ECC */
> +	IA_CSS_RX_IRQ_INFO_ERR_CRC          = BIT(8), /** CRC error */
> +	IA_CSS_RX_IRQ_INFO_ERR_UNKNOWN_ID   = BIT(9), /** Unknown ID */
> +	IA_CSS_RX_IRQ_INFO_ERR_FRAME_SYNC   = BIT(10),/** Frame sync error */
> +	IA_CSS_RX_IRQ_INFO_ERR_FRAME_DATA   = BIT(11),/** Frame data error */
> +	IA_CSS_RX_IRQ_INFO_ERR_DATA_TIMEOUT = BIT(12),/** Timeout occurred */
> +	IA_CSS_RX_IRQ_INFO_ERR_UNKNOWN_ESC  = BIT(13),/** Unknown escape seq. */
> +	IA_CSS_RX_IRQ_INFO_ERR_LINE_SYNC    = BIT(14),/** Line Sync error */

The comment is kind of messed up.  There should be a space after the
comma and just /* Line Sync error */

> +	IA_CSS_RX_IRQ_INFO_INIT_TIMEOUT     = BIT(15),
>  };

regards,
dan carpenter


  reply	other threads:[~2022-01-31  7:38 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-29 11:38 [PATCH] staging: media: atomisp: Use BIT macro instead of left shifting Moses Christopher Bollavarapu
2022-01-29 16:35 ` Andy Shevchenko
2022-01-30 18:06   ` [PATCH v2] " Moses Christopher Bollavarapu
2022-01-31  7:36     ` Dan Carpenter [this message]
2022-01-31 13:24       ` Randy Dunlap
2022-01-31 13:33       ` Joe Perches
2022-02-06 18:52     ` [PATCH v3] " Moses Christopher Bollavarapu
2022-02-07 12:30       ` Andy Shevchenko
2022-01-29 16:36 ` [PATCH] " Joe Perches

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=20220131073624.GH1951@kadam \
    --to=dan.carpenter@oracle.com \
    --cc=andriy.shevchenko@linux.intel.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=joe@perches.com \
    --cc=kitakar@gmail.com \
    --cc=laurent.pinchart@ideasonboard.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=linux-staging@lists.linux.dev \
    --cc=mchehab@kernel.org \
    --cc=mosescb.dev@gmail.com \
    --cc=sakari.ailus@linux.intel.com \
    --cc=tomi.valkeinen@ideasonboard.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.