Skip to content

Commit 55b6470

Browse files
committed
osc: drop some unused variables
Drop unused variables and improve coding style on some paths. Signed-off-by: Nuno Sá <[email protected]>
1 parent 2b652f7 commit 55b6470

File tree

1 file changed

+4
-14
lines changed

1 file changed

+4
-14
lines changed

Diff for: osc.c

+4-14
Original file line numberDiff line numberDiff line change
@@ -608,7 +608,6 @@ int plugin_data_capture_bytes_per_sample(const char *device)
608608
{
609609
struct iio_device *dev;
610610
struct extra_dev_info *dev_info;
611-
int nb_channels;
612611

613612
if (!device)
614613
return 0;
@@ -617,7 +616,7 @@ int plugin_data_capture_bytes_per_sample(const char *device)
617616

618617
if (!dev)
619618
return 0;
620-
nb_channels = iio_device_get_channels_count(dev);
619+
621620
dev_info = iio_device_get_data(dev);
622621

623622
return iio_device_get_sample_size(dev, dev_info->channels_mask);
@@ -1247,7 +1246,6 @@ static off_t get_trigger_offset(const struct iio_channel *chn,
12471246
size_t i;
12481247
const struct iio_device *dev = iio_channel_get_device(chn);
12491248
struct extra_dev_info *dev_info = iio_device_get_data(dev);
1250-
int nb_channels = iio_device_get_channels_count(dev);
12511249

12521250
if (iio_channel_is_enabled(chn, dev_info->channels_mask)) {
12531251
for (i = info->offset / 2; i >= 1; i--) {
@@ -1536,7 +1534,6 @@ static int capture_setup(void)
15361534
iio_channel_disable(ch, dev_info->channels_mask);
15371535
}
15381536

1539-
15401537
sample_size = iio_device_get_sample_size(dev, dev_info->channels_mask);
15411538
if (sample_size == 0 || sample_count == 0)
15421539
continue;
@@ -2170,18 +2167,15 @@ void do_init(struct iio_context *new_ctx)
21702167
init_device_list(new_ctx);
21712168
load_plugins(notebook, NULL);
21722169
osc_preferences = aggregate_osc_preferences_from_plugins(plugin_list);
2173-
21742170
int width = -1, height = -1;
21752171
plugins_get_preferred_size(plugin_list, &width, &height);
21762172
window_size_readjust(GTK_WINDOW(main_window), width, height);
2177-
21782173
if (!strcmp(iio_context_get_name(new_ctx), "network") &&
21792174
iio_context_get_devices_count(new_ctx)) {
21802175
gtk_widget_set_visible(infobar, false);
21812176
g_timeout_add_full(G_PRIORITY_DEFAULT_IDLE, 1000,
21822177
idle_timeout_check, new_ctx, NULL);
21832178
}
2184-
21852179
spect_analyzer_plugin = get_plugin_from_name("Spectrum Analyzer");
21862180
}
21872181

@@ -2759,9 +2753,8 @@ int osc_identify_attrib(struct iio_context *_ctx, const char *attrib,
27592753
int i;
27602754
bool is_debug;
27612755
int ret = -EINVAL;
2762-
const char *file;
2756+
gchar *dev_name, **elems = g_strsplit(attrib, ".", 3);
27632757

2764-
gchar *dev_name, *filename, **elems = g_strsplit(attrib, ".", 3);
27652758
if (!elems)
27662759
return -EINVAL;
27672760

@@ -2771,13 +2764,10 @@ int osc_identify_attrib(struct iio_context *_ctx, const char *attrib,
27712764
if (!elems[i])
27722765
goto cleanup;
27732766

2774-
if (is_debug) {
2767+
if (is_debug)
27752768
dev_name = elems[1];
2776-
filename = elems[2];
2777-
} else {
2769+
else
27782770
dev_name = elems[0];
2779-
filename = elems[1];
2780-
}
27812771

27822772
device = iio_context_find_device(_ctx, dev_name);
27832773
if (!device) {

0 commit comments

Comments
 (0)