lkml.org 
[lkml]   [2019]   [Jul]   [4]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [Linux-kernel-mentee, PATCH] media: dvb_frontend.h: Fix shifting signed 32-bit value problem
Hi Luke,

On Thu, Jul 4, 2019 at 3:22 PM Luke Nowakowski-Krijger
<lnowakow@eng.ucsd.edu> wrote:
>
> Fix DVBFE_ALGO_RECOVERY and DVBFE_ALGO_SEARCH_ERROR to use U cast which
> fixes undefined behavior error by certain compilers.
>
> Signed-off-by: Luke Nowakowski-Krijger <lnowakow@eng.ucsd.edu>
> ---
> include/media/dvb_frontend.h | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/include/media/dvb_frontend.h b/include/media/dvb_frontend.h
> index f05cd7b94a2c..472fe5871d94 100644
> --- a/include/media/dvb_frontend.h
> +++ b/include/media/dvb_frontend.h
> @@ -144,7 +144,7 @@ enum dvbfe_algo {
> DVBFE_ALGO_HW = (1 << 0),
> DVBFE_ALGO_SW = (1 << 1),
> DVBFE_ALGO_CUSTOM = (1 << 2),
> - DVBFE_ALGO_RECOVERY = (1 << 31)
> + DVBFE_ALGO_RECOVERY = (1U << 31)

You could switch all these definitions to use the BIT() macro instead.

\
 
 \ /
  Last update: 2019-07-04 20:47    [W:0.044 / U:0.848 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site