diff mbox

ALSA: usb-audio: silence a static checker warning

Message ID 20180329090319.GB17927@mwanda (mailing list archive)
State New, archived
Headers show

Commit Message

Dan Carpenter March 29, 2018, 9:03 a.m. UTC
We recently made "format" a u64 variable so now static checkers complain
that this shift will wrap around if format is more than 31.  I don't
think it makes a difference for runtime, but it's simple to silence the
warning.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

Comments

Takashi Iwai March 29, 2018, 9:11 a.m. UTC | #1
On Thu, 29 Mar 2018 11:03:19 +0200,
Dan Carpenter wrote:
> 
> We recently made "format" a u64 variable so now static checkers complain
> that this shift will wrap around if format is more than 31.  I don't
> think it makes a difference for runtime, but it's simple to silence the
> warning.
> 
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

Applied now.  Thanks.


Takashi
diff mbox

Patch

diff --git a/sound/usb/format.c b/sound/usb/format.c
index edbe67eeddfa..49e7ec6d2399 100644
--- a/sound/usb/format.c
+++ b/sound/usb/format.c
@@ -55,7 +55,7 @@  static u64 parse_audio_format_i_type(struct snd_usb_audio *chip,
 		struct uac_format_type_i_discrete_descriptor *fmt = _fmt;
 		sample_width = fmt->bBitResolution;
 		sample_bytes = fmt->bSubframeSize;
-		format = 1 << format;
+		format = 1ULL << format;
 		break;
 	}