Fix cppcheck warning in kpa

pull/174/head
Michael Black 2020-01-12 07:56:10 -06:00
rodzic cede1211c9
commit 31e30da6f7
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 6599353EC683404D
3 zmienionych plików z 23 dodań i 37 usunięć

Wyświetl plik

@ -83,6 +83,17 @@ int kpa_init(AMP *amp)
return RIG_OK;
}
int kpa_close(AMP *amp)
{
rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__);
if (amp->state.priv) { free(amp->state.priv); }
amp->state.priv = NULL;
return RIG_OK;
}
int kpa_flushbuffer(AMP *amp)
{
struct amp_state *rs;

Wyświetl plik

@ -40,21 +40,23 @@ extern const struct amp_caps kpa1500_rot_caps;
*/
struct kpa_priv_data
{
char tmpbuf[256]; // for unknown error msg
char tmpbuf[256]; // for unknown error msg
};
int kpa_init(AMP *amp);
int kpa_close(AMP *amp);
int kpa_reset(AMP *amp, amp_reset_t reset);
int kpa_flush_buffer(AMP *amp);
int kpa_transaction(AMP *amp, const char *cmd, char *response, int response_len);
const char *kpa_get_info (AMP *amp);
int kpa_get_freq (AMP *amp, freq_t *freq);
int kpa_set_freq (AMP *amp, freq_t freq);
int kpa_transaction(AMP *amp, const char *cmd, char *response,
int response_len);
const char *kpa_get_info(AMP *amp);
int kpa_get_freq(AMP *amp, freq_t *freq);
int kpa_set_freq(AMP *amp, freq_t freq);
int kpa_get_level (AMP *amp, setting_t level, value_t *val);
int kpa_get_powerstat (AMP *amp, powerstat_t *status);
int kpa_set_powerstat (AMP *amp, powerstat_t status);
int kpa_get_level(AMP *amp, setting_t level, value_t *val);
int kpa_get_powerstat(AMP *amp, powerstat_t *status);
int kpa_set_powerstat(AMP *amp, powerstat_t status);
#endif /* _AMP_ELECRAFT_H */

Wyświetl plik

@ -41,8 +41,6 @@ struct kpa_priv_data *kpa1500_priv;
*
*/
static int kpa1500_cleanup(AMP *amp);
/*
* Private helper function prototypes
*/
@ -67,7 +65,7 @@ const struct amp_caps kpa1500_amp_caps =
.amp_model = AMP_MODEL_ELECRAFT_KPA1500,
.model_name = "KPA1500",
.mfg_name = "Elecraft",
.version = "2019-12-06",
.version = "2020-01-12",
.copyright = "LGPL",
.status = RIG_STATUS_ALPHA,
.amp_type = AMP_TYPE_OTHER,
@ -85,7 +83,7 @@ const struct amp_caps kpa1500_amp_caps =
.amp_open = amp_open,
.amp_init = kpa_init,
.amp_cleanup = kpa1500_cleanup,
.amp_close = kpa_close,
.reset = kpa_reset,
.get_info = kpa_get_info,
.get_powerstat = kpa_get_powerstat,
@ -103,31 +101,6 @@ const struct amp_caps kpa1500_amp_caps =
* ************************************
*/
/*
* Clean up allocated memory structures
*/
static int kpa1500_cleanup(AMP *amp)
{
rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__);
if (!amp)
{
return -RIG_EINVAL;
}
if (amp->state.priv)
{
free(amp->state.priv);
}
amp->state.priv = NULL;
return RIG_OK;
}
/*
*
*/