plugins: use G_N_ELEMENTS when iterating ports array

This commit is contained in:
Aleksander Morgado
2017-05-30 17:28:23 +02:00
parent b874fba0e6
commit 2eb55d3224
11 changed files with 13 additions and 13 deletions

View File

@@ -770,7 +770,7 @@ set_3gpp_unsolicited_events_handlers (MMBroadbandModemAltairLte *self,
ports[1] = mm_base_modem_peek_port_secondary (MM_BASE_MODEM (self));
/* Enable/disable unsolicited events in given port */
for (i = 0; i < 2; i++) {
for (i = 0; i < G_N_ELEMENTS (ports); i++) {
if (!ports[i])
continue;

View File

@@ -295,7 +295,7 @@ setup_ports (MMBroadbandModem *self)
ports[1] = mm_base_modem_peek_port_secondary (MM_BASE_MODEM (self));
/* Now reset the unsolicited messages */
for (i = 0; i < 2; i++) {
for (i = 0; i < G_N_ELEMENTS (ports); i++) {
if (!ports[i])
continue;

View File

@@ -555,7 +555,7 @@ set_unsolicited_events_handlers (MMBroadbandModemIcera *self,
ports[1] = mm_base_modem_peek_port_secondary (MM_BASE_MODEM (self));
/* Enable unsolicited events in given port */
for (i = 0; i < 2; i++) {
for (i = 0; i < G_N_ELEMENTS (ports); i++) {
if (!ports[i])
continue;

View File

@@ -862,7 +862,7 @@ set_unsolicited_events_handlers (MMBroadbandModemMbm *self,
ports[1] = mm_base_modem_peek_port_secondary (MM_BASE_MODEM (self));
/* Enable unsolicited events in given port */
for (i = 0; i < 2; i++) {
for (i = 0; i < G_N_ELEMENTS (ports); i++) {
if (!ports[i])
continue;
@@ -1462,7 +1462,7 @@ setup_ports (MMBroadbandModem *_self)
ports[1] = mm_base_modem_peek_port_secondary (MM_BASE_MODEM (self));
/* Setup unsolicited handlers which should be always on */
for (i = 0; i < 2; i++) {
for (i = 0; i < G_N_ELEMENTS (ports); i++) {
if (!ports[i])
continue;

View File

@@ -652,7 +652,7 @@ set_unsolicited_events_handlers (MMBroadbandModemMtk *self,
ports[1] = mm_base_modem_peek_port_secondary (MM_BASE_MODEM (self));
/* Enable/disable unsolicited events in given port */
for (i = 0; i < 2; i++){
for (i = 0; i < G_N_ELEMENTS (ports); i++){
if(!ports[i])
continue;

View File

@@ -850,7 +850,7 @@ set_unsolicited_events_handlers (MMBroadbandModemOption *self,
ports[1] = mm_base_modem_peek_port_secondary (MM_BASE_MODEM (self));
/* Enable unsolicited events in given port */
for (i = 0; i < 2; i++) {
for (i = 0; i < G_N_ELEMENTS (ports); i++) {
if (!ports[i])
continue;

View File

@@ -48,7 +48,7 @@ setup_ports (MMBroadbandModem *self)
ports[1] = mm_base_modem_peek_port_secondary (MM_BASE_MODEM (self));
/* Configure AT ports */
for (i = 0; i < 2; i++) {
for (i = 0; i < G_N_ELEMENTS (ports); i++) {
if (!ports[i])
continue;

View File

@@ -492,7 +492,7 @@ mm_common_sierra_setup_ports (MMBroadbandModem *self)
ports[0] = mm_base_modem_peek_port_primary (MM_BASE_MODEM (self));
ports[1] = mm_base_modem_peek_port_secondary (MM_BASE_MODEM (self));
for (i = 0; i < 2; i++) {
for (i = 0; i < G_N_ELEMENTS (ports); i++) {
if (!ports[i])
continue;

View File

@@ -99,7 +99,7 @@ set_unsolicited_events_handlers (MMBroadbandModemSimtech *self,
G_REGEX_RAW | G_REGEX_OPTIMIZE, 0, NULL);
/* Enable unsolicited events in given port */
for (i = 0; i < 2; i++) {
for (i = 0; i < G_N_ELEMENTS (ports); i++) {
if (!ports[i])
continue;

View File

@@ -321,7 +321,7 @@ set_unsolicited_events_handlers (MMBroadbandModemVia *self,
ports[1] = mm_base_modem_peek_port_secondary (MM_BASE_MODEM (self));
/* Enable unsolicited events in given port */
for (i = 0; i < 2; i++) {
for (i = 0; i < G_N_ELEMENTS (ports); i++) {
if (!ports[i])
continue;
@@ -431,7 +431,7 @@ set_ignored_unsolicited_events_handlers (MMBroadbandModemVia *self)
ports[1] = mm_base_modem_peek_port_secondary (MM_BASE_MODEM (self));
/* Enable unsolicited events in given port */
for (i = 0; i < 2; i++) {
for (i = 0; i < G_N_ELEMENTS (ports); i++) {
if (!ports[i])
continue;

View File

@@ -106,7 +106,7 @@ mm_common_zte_set_unsolicited_events_handlers (MMBroadbandModem *self,
ports[1] = mm_base_modem_peek_port_secondary (MM_BASE_MODEM (self));
/* Enable unsolicited events in given port */
for (i = 0; i < 2; i++) {
for (i = 0; i < G_N_ELEMENTS (ports); i++) {
if (!ports[i])
continue;