Re: [PATCH] soc: intel: sst-haswell-ipc: Remove some unused functions
On Sun, Jan 04, 2015 at 01:35:24AM +0100, Rickard Strandqvist wrote: > Removes some functions that are not used anywhere: > sst_hsw_stream_unmute() sst_hsw_stream_mute() msg_set_stage_type() > sst_hsw_dx_get_state() sst_hsw_dx_set_state() > sst_hsw_stream_set_write_position() This doesn't apply against current code, please check and resend. signature.asc Description: Digital signature
Re: [PATCH] soc: intel: sst-haswell-ipc: Remove some unused functions
On Sun, Jan 04, 2015 at 01:35:24AM +0100, Rickard Strandqvist wrote: Removes some functions that are not used anywhere: sst_hsw_stream_unmute() sst_hsw_stream_mute() msg_set_stage_type() sst_hsw_dx_get_state() sst_hsw_dx_set_state() sst_hsw_stream_set_write_position() This doesn't apply against current code, please check and resend. signature.asc Description: Digital signature
RE: [PATCH] soc: intel: sst-haswell-ipc: Remove some unused functions
Hi Rickard, Thanks for your checking. I have just confirmed that those functions really not used currently, although they may be needed for advanced developing. So, I have no objection if you remove them now. Liam, what's your opinion? ~Keyon > -Original Message- > From: Rickard Strandqvist [mailto:rickard_strandqv...@spectrumdigital.se] > Sent: Sunday, January 04, 2015 8:35 AM > To: Liam Girdwood; Mark Brown > Cc: Rickard Strandqvist; Jaroslav Kysela; Takashi Iwai; Jie, Yang; Jarkko > Nikula; > Dan Carpenter; Christian Engelmayer; Piskorski, Pawel; > alsa-de...@alsa-project.org; linux-kernel@vger.kernel.org > Subject: [PATCH] soc: intel: sst-haswell-ipc: Remove some unused functions > > Removes some functions that are not used anywhere: > sst_hsw_stream_unmute() sst_hsw_stream_mute() msg_set_stage_type() > sst_hsw_dx_get_state() sst_hsw_dx_set_state() > sst_hsw_stream_set_write_position() > sst_hsw_stream_get_vol_reg() sst_hsw_stream_get_peak_reg() > sst_hsw_stream_get_pointer_reg() sst_hsw_stream_get_read_reg() > sst_hsw_stream_get_mixer_id() sst_hsw_stream_get_hw_id() > sst_hsw_mixer_set_volume_curve() sst_hsw_mixer_unmute() > sst_hsw_mixer_mute() > sst_hsw_stream_set_volume_curve() > > This was partially found by using a static code analysis program called > cppcheck. > > Signed-off-by: Rickard Strandqvist > --- > sound/soc/intel/sst-haswell-ipc.c | 226 > - > sound/soc/intel/sst-haswell-ipc.h | 34 -- > 2 files changed, 260 deletions(-) > > diff --git a/sound/soc/intel/sst-haswell-ipc.c > b/sound/soc/intel/sst-haswell-ipc.c > index b629151..26f856c 100644 > --- a/sound/soc/intel/sst-haswell-ipc.c > +++ b/sound/soc/intel/sst-haswell-ipc.c > @@ -333,12 +333,6 @@ static inline u32 msg_get_stage_type(u32 msg) > return (msg & IPC_STG_TYPE_MASK) >> IPC_STG_TYPE_SHIFT; } > > -static inline u32 msg_set_stage_type(u32 msg, u32 type) -{ > - return (msg & ~IPC_STG_TYPE_MASK) + > - (type << IPC_STG_TYPE_SHIFT); > -} > - > static inline u32 msg_get_stream_id(u32 msg) { > return (msg & IPC_STR_ID_MASK) >> IPC_STR_ID_SHIFT; @@ -965,45 > +959,6 @@ int sst_hsw_fw_get_version(struct sst_hsw *hsw, } > > /* Mixer Controls */ > -int sst_hsw_stream_mute(struct sst_hsw *hsw, struct sst_hsw_stream > *stream, > - u32 stage_id, u32 channel) > -{ > - int ret; > - > - ret = sst_hsw_stream_get_volume(hsw, stream, stage_id, channel, > - >mute_volume[channel]); > - if (ret < 0) > - return ret; > - > - ret = sst_hsw_stream_set_volume(hsw, stream, stage_id, channel, 0); > - if (ret < 0) { > - dev_err(hsw->dev, "error: can't unmute stream %d channel %d\n", > - stream->reply.stream_hw_id, channel); > - return ret; > - } > - > - stream->mute[channel] = 1; > - return 0; > -} > - > -int sst_hsw_stream_unmute(struct sst_hsw *hsw, struct sst_hsw_stream > *stream, > - u32 stage_id, u32 channel) > - > -{ > - int ret; > - > - stream->mute[channel] = 0; > - ret = sst_hsw_stream_set_volume(hsw, stream, stage_id, channel, > - stream->mute_volume[channel]); > - if (ret < 0) { > - dev_err(hsw->dev, "error: can't unmute stream %d channel %d\n", > - stream->reply.stream_hw_id, channel); > - return ret; > - } > - > - return 0; > -} > - > int sst_hsw_stream_get_volume(struct sst_hsw *hsw, struct > sst_hsw_stream *stream, > u32 stage_id, u32 channel, u32 *volume) { @@ -1017,17 +972,6 @@ int > sst_hsw_stream_get_volume(struct sst_hsw *hsw, struct sst_hsw_stream > *stream > return 0; > } > > -int sst_hsw_stream_set_volume_curve(struct sst_hsw *hsw, > - struct sst_hsw_stream *stream, u64 curve_duration, > - enum sst_hsw_volume_curve curve) > -{ > - /* curve duration in steps of 100ns */ > - stream->vol_req.curve_duration = curve_duration; > - stream->vol_req.curve_type = curve; > - > - return 0; > -} > - > /* stream volume */ > int sst_hsw_stream_set_volume(struct sst_hsw *hsw, > struct sst_hsw_stream *stream, u32 stage_id, u32 channel, u32 volume) > @@ -1065,42 +1009,6 @@ int sst_hsw_stream_set_volume(struct sst_hsw > *hsw, > return 0; > } > > -int sst_hsw_mixer_mute(struct sst_hsw *hsw, u32 stage_id, u32 channel) -{ > - int ret; > - > - ret = sst_hsw_mixer_get_volume(hsw, stage_id, channel, > - >mute_volume[channel]); > - if (ret < 0) > - return ret; > - > - ret = sst_hsw_mixer_set_volume(hsw, stage_id, channel, 0); > - if (ret < 0) { > - dev_err(hsw->dev, "error: failed to unmute mixer channel %d\n", > - channel); > - return ret; > - } > - > - hsw->mute[channel] = 1; > - return 0; > -} > - > -int sst_hsw_mixer_unmute(struct sst_hsw *hsw, u32 stage_id, u32 channel) -{ > - int ret; > - > - ret =
RE: [PATCH] soc: intel: sst-haswell-ipc: Remove some unused functions
Hi Rickard, Thanks for your checking. I have just confirmed that those functions really not used currently, although they may be needed for advanced developing. So, I have no objection if you remove them now. Liam, what's your opinion? ~Keyon -Original Message- From: Rickard Strandqvist [mailto:rickard_strandqv...@spectrumdigital.se] Sent: Sunday, January 04, 2015 8:35 AM To: Liam Girdwood; Mark Brown Cc: Rickard Strandqvist; Jaroslav Kysela; Takashi Iwai; Jie, Yang; Jarkko Nikula; Dan Carpenter; Christian Engelmayer; Piskorski, Pawel; alsa-de...@alsa-project.org; linux-kernel@vger.kernel.org Subject: [PATCH] soc: intel: sst-haswell-ipc: Remove some unused functions Removes some functions that are not used anywhere: sst_hsw_stream_unmute() sst_hsw_stream_mute() msg_set_stage_type() sst_hsw_dx_get_state() sst_hsw_dx_set_state() sst_hsw_stream_set_write_position() sst_hsw_stream_get_vol_reg() sst_hsw_stream_get_peak_reg() sst_hsw_stream_get_pointer_reg() sst_hsw_stream_get_read_reg() sst_hsw_stream_get_mixer_id() sst_hsw_stream_get_hw_id() sst_hsw_mixer_set_volume_curve() sst_hsw_mixer_unmute() sst_hsw_mixer_mute() sst_hsw_stream_set_volume_curve() This was partially found by using a static code analysis program called cppcheck. Signed-off-by: Rickard Strandqvist rickard_strandqv...@spectrumdigital.se --- sound/soc/intel/sst-haswell-ipc.c | 226 - sound/soc/intel/sst-haswell-ipc.h | 34 -- 2 files changed, 260 deletions(-) diff --git a/sound/soc/intel/sst-haswell-ipc.c b/sound/soc/intel/sst-haswell-ipc.c index b629151..26f856c 100644 --- a/sound/soc/intel/sst-haswell-ipc.c +++ b/sound/soc/intel/sst-haswell-ipc.c @@ -333,12 +333,6 @@ static inline u32 msg_get_stage_type(u32 msg) return (msg IPC_STG_TYPE_MASK) IPC_STG_TYPE_SHIFT; } -static inline u32 msg_set_stage_type(u32 msg, u32 type) -{ - return (msg ~IPC_STG_TYPE_MASK) + - (type IPC_STG_TYPE_SHIFT); -} - static inline u32 msg_get_stream_id(u32 msg) { return (msg IPC_STR_ID_MASK) IPC_STR_ID_SHIFT; @@ -965,45 +959,6 @@ int sst_hsw_fw_get_version(struct sst_hsw *hsw, } /* Mixer Controls */ -int sst_hsw_stream_mute(struct sst_hsw *hsw, struct sst_hsw_stream *stream, - u32 stage_id, u32 channel) -{ - int ret; - - ret = sst_hsw_stream_get_volume(hsw, stream, stage_id, channel, - stream-mute_volume[channel]); - if (ret 0) - return ret; - - ret = sst_hsw_stream_set_volume(hsw, stream, stage_id, channel, 0); - if (ret 0) { - dev_err(hsw-dev, error: can't unmute stream %d channel %d\n, - stream-reply.stream_hw_id, channel); - return ret; - } - - stream-mute[channel] = 1; - return 0; -} - -int sst_hsw_stream_unmute(struct sst_hsw *hsw, struct sst_hsw_stream *stream, - u32 stage_id, u32 channel) - -{ - int ret; - - stream-mute[channel] = 0; - ret = sst_hsw_stream_set_volume(hsw, stream, stage_id, channel, - stream-mute_volume[channel]); - if (ret 0) { - dev_err(hsw-dev, error: can't unmute stream %d channel %d\n, - stream-reply.stream_hw_id, channel); - return ret; - } - - return 0; -} - int sst_hsw_stream_get_volume(struct sst_hsw *hsw, struct sst_hsw_stream *stream, u32 stage_id, u32 channel, u32 *volume) { @@ -1017,17 +972,6 @@ int sst_hsw_stream_get_volume(struct sst_hsw *hsw, struct sst_hsw_stream *stream return 0; } -int sst_hsw_stream_set_volume_curve(struct sst_hsw *hsw, - struct sst_hsw_stream *stream, u64 curve_duration, - enum sst_hsw_volume_curve curve) -{ - /* curve duration in steps of 100ns */ - stream-vol_req.curve_duration = curve_duration; - stream-vol_req.curve_type = curve; - - return 0; -} - /* stream volume */ int sst_hsw_stream_set_volume(struct sst_hsw *hsw, struct sst_hsw_stream *stream, u32 stage_id, u32 channel, u32 volume) @@ -1065,42 +1009,6 @@ int sst_hsw_stream_set_volume(struct sst_hsw *hsw, return 0; } -int sst_hsw_mixer_mute(struct sst_hsw *hsw, u32 stage_id, u32 channel) -{ - int ret; - - ret = sst_hsw_mixer_get_volume(hsw, stage_id, channel, - hsw-mute_volume[channel]); - if (ret 0) - return ret; - - ret = sst_hsw_mixer_set_volume(hsw, stage_id, channel, 0); - if (ret 0) { - dev_err(hsw-dev, error: failed to unmute mixer channel %d\n, - channel); - return ret; - } - - hsw-mute[channel] = 1; - return 0; -} - -int sst_hsw_mixer_unmute(struct sst_hsw *hsw, u32 stage_id, u32 channel) -{ - int ret; - - ret = sst_hsw_mixer_set_volume(hsw, stage_id, channel, - hsw-mixer_info.volume_register_address[channel]); - if (ret 0) {