diff mbox

ASoC: Intel: do cast earlier in sst_cdev_tstamp()

Message ID 20150409090239.GA17605@mwanda (mailing list archive)
State Accepted
Commit 75afbd052b3675e9b812f9327e19be63f3e7b5de
Headers show

Commit Message

Dan Carpenter April 9, 2015, 9:02 a.m. UTC
My static checker complains about these because it looks like the
multiply can overflow and then we cast to a larger data type.  I don't
think this is a problem, but it's also harmless to do the cast earlier
so let's silence the static checker warning.

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

Comments

Mark Brown April 9, 2015, 10 a.m. UTC | #1
On Thu, Apr 09, 2015 at 12:02:39PM +0300, Dan Carpenter wrote:

> My static checker complains about these because it looks like the
> multiply can overflow and then we cast to a larger data type.  I don't
> think this is a problem, but it's also harmless to do the cast earlier
> so let's silence the static checker warning.

Applied, thanks.
diff mbox

Patch

diff --git a/sound/soc/intel/atom/sst/sst_drv_interface.c b/sound/soc/intel/atom/sst/sst_drv_interface.c
index 718838b..7b50a9d 100644
--- a/sound/soc/intel/atom/sst/sst_drv_interface.c
+++ b/sound/soc/intel/atom/sst/sst_drv_interface.c
@@ -381,7 +381,7 @@  static int sst_cdev_tstamp(struct device *dev, unsigned int str_id,
 	tstamp->copied_total = fw_tstamp.ring_buffer_counter;
 	tstamp->pcm_frames = fw_tstamp.frames_decoded;
 	tstamp->pcm_io_frames = div_u64(fw_tstamp.hardware_counter,
-			(u64)((stream->num_ch) * SST_GET_BYTES_PER_SAMPLE(24)));
+			(u64)stream->num_ch * SST_GET_BYTES_PER_SAMPLE(24));
 	tstamp->sampling_rate = fw_tstamp.sampling_frequency;
 
 	dev_dbg(dev, "PCM  = %u\n", tstamp->pcm_io_frames);