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]
Message-ID: <747b437d-6d7d-e35f-c7e8-79f81ad2e691@infradead.org>
Date:   Mon, 31 Jan 2022 05:24:21 -0800
From:   Randy Dunlap <rdunlap@...radead.org>
To:     Dan Carpenter <dan.carpenter@...cle.com>,
        Moses Christopher Bollavarapu <mosescb.dev@...il.com>
Cc:     andriy.shevchenko@...ux.intel.com, gregkh@...uxfoundation.org,
        kitakar@...il.com, laurent.pinchart@...asonboard.com,
        linux-kernel@...r.kernel.org, linux-media@...r.kernel.org,
        linux-staging@...ts.linux.dev, mchehab@...nel.org,
        sakari.ailus@...ux.intel.com, tomi.valkeinen@...asonboard.com,
        joe@...ches.com
Subject: Re: [PATCH v2] staging: media: atomisp: Use BIT macro instead of left
 shifting



On 1/30/22 23:36, Dan Carpenter wrote:
> 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@...il.com>
> 

>> 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 */

Yeah, all of those /** should just be /*

thanks.

-- 
~Randy

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ