[S] Change in libosmo-gprs[master]: rlcmac: Fix compilation error 'rlcmac_prim may be used uninitialized'

2023-09-26 Thread fixeria
Attention is currently required from: pespin.

fixeria has posted comments on this change. ( 
https://gerrit.osmocom.org/c/libosmo-gprs/+/34532?usp=email )

Change subject: rlcmac: Fix compilation error 'rlcmac_prim may be used 
uninitialized'
..


Patch Set 1: Code-Review+2

(1 comment)

File src/rlcmac/tbf_ul_ass_fsm.c:

https://gerrit.osmocom.org/c/libosmo-gprs/+/34532/comment/d99e3269_e3952b72
PS1, Line 121: default
> For the record: I intentionally did not add the `default` branch, because I 
> expected that a warning  […]
Perhaps the following like triggers the compiler:

```
ctx->ass_type = *(enum gprs_rlcmac_tbf_ul_ass_type *)data;
```



--
To view, visit https://gerrit.osmocom.org/c/libosmo-gprs/+/34532?usp=email
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: libosmo-gprs
Gerrit-Branch: master
Gerrit-Change-Id: Ica93447bc1f2e60984be7c9c73b153b4eb508aaa
Gerrit-Change-Number: 34532
Gerrit-PatchSet: 1
Gerrit-Owner: pespin 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria 
Gerrit-Attention: pespin 
Gerrit-Comment-Date: Tue, 26 Sep 2023 12:55:02 +
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
Comment-In-Reply-To: fixeria 
Gerrit-MessageType: comment


[S] Change in libosmo-gprs[master]: rlcmac: Fix compilation error 'rlcmac_prim may be used uninitialized'

2023-09-26 Thread fixeria
fixeria has submitted this change. ( 
https://gerrit.osmocom.org/c/libosmo-gprs/+/34532?usp=email )

Change subject: rlcmac: Fix compilation error 'rlcmac_prim may be used 
uninitialized'
..

rlcmac: Fix compilation error 'rlcmac_prim may be used uninitialized'

Change-Id: Ica93447bc1f2e60984be7c9c73b153b4eb508aaa
---
M src/rlcmac/tbf_ul_ass_fsm.c
1 file changed, 12 insertions(+), 1 deletion(-)

Approvals:
  fixeria: Looks good to me, approved
  Jenkins Builder: Verified




diff --git a/src/rlcmac/tbf_ul_ass_fsm.c b/src/rlcmac/tbf_ul_ass_fsm.c
index 64797aa..b1be58c 100644
--- a/src/rlcmac/tbf_ul_ass_fsm.c
+++ b/src/rlcmac/tbf_ul_ass_fsm.c
@@ -118,7 +118,9 @@
LOGPFSML(ctx->fi, LOGL_INFO, "Requesting two-phase packet 
access using CCCH\n");
rlcmac_prim = gprs_rlcmac_prim_alloc_l1ctl_rach8_req(0x70);
break;
-   /* TODO: EGPRS specific modes (11-bit RACH) */
+   default:
+   /* TODO: EGPRS specific modes (11-bit RACH) */
+   return -ENOTSUP;
}

return gprs_rlcmac_prim_call_down_cb(rlcmac_prim);

--
To view, visit https://gerrit.osmocom.org/c/libosmo-gprs/+/34532?usp=email
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: libosmo-gprs
Gerrit-Branch: master
Gerrit-Change-Id: Ica93447bc1f2e60984be7c9c73b153b4eb508aaa
Gerrit-Change-Number: 34532
Gerrit-PatchSet: 1
Gerrit-Owner: pespin 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria 
Gerrit-MessageType: merged


[S] Change in libosmo-gprs[master]: rlcmac: Fix compilation error 'rlcmac_prim may be used uninitialized'

2023-09-26 Thread fixeria
Attention is currently required from: pespin.

fixeria has posted comments on this change. ( 
https://gerrit.osmocom.org/c/libosmo-gprs/+/34532?usp=email )

Change subject: rlcmac: Fix compilation error 'rlcmac_prim may be used 
uninitialized'
..


Patch Set 1: Code-Review+1

(2 comments)

Commit Message:

https://gerrit.osmocom.org/c/libosmo-gprs/+/34532/comment/f206c296_be149194
PS1, Line 7: error
Is it really an error?  Or a warning that becomes an error when building with 
`--disable-werror`?


File src/rlcmac/tbf_ul_ass_fsm.c:

https://gerrit.osmocom.org/c/libosmo-gprs/+/34532/comment/1378440f_5568a280
PS1, Line 121: default
For the record: I intentionally did not add the `default` branch, because I 
expected that a warning would be thrown whenever a new enum item is added to 
`enum gprs_rlcmac_tbf_ul_ass_type`. I think I also did this in other projects. 
But looks like the compiler is over defensive here :/



--
To view, visit https://gerrit.osmocom.org/c/libosmo-gprs/+/34532?usp=email
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: libosmo-gprs
Gerrit-Branch: master
Gerrit-Change-Id: Ica93447bc1f2e60984be7c9c73b153b4eb508aaa
Gerrit-Change-Number: 34532
Gerrit-PatchSet: 1
Gerrit-Owner: pespin 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria 
Gerrit-Attention: pespin 
Gerrit-Comment-Date: Tue, 26 Sep 2023 12:52:48 +
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


[S] Change in libosmo-gprs[master]: rlcmac: Fix compilation error 'rlcmac_prim may be used uninitialized'

2023-09-26 Thread pespin
Attention is currently required from: fixeria.

pespin has posted comments on this change. ( 
https://gerrit.osmocom.org/c/libosmo-gprs/+/34532?usp=email )

Change subject: rlcmac: Fix compilation error 'rlcmac_prim may be used 
uninitialized'
..


Patch Set 1:

(2 comments)

Commit Message:

https://gerrit.osmocom.org/c/libosmo-gprs/+/34532/comment/9e4a21bf_60933ab1
PS1, Line 7: error
> Is it really an error?  Or a warning that becomes an error when building with 
> `--disable-werror`?
Done


File src/rlcmac/tbf_ul_ass_fsm.c:

https://gerrit.osmocom.org/c/libosmo-gprs/+/34532/comment/43e99161_34d8904c
PS1, Line 121: default
> For the record: I intentionally did not add the `default` branch, because I 
> expected that a warning  […]
In this case, I can understand the compilation warning because one can still 
possibly add whatever uint value you want to that variable.
So it's actually possible that it contains any other value and hence 
rlcmac_prim indeed ends up being uninitialized after the switch

This is really a fix.



--
To view, visit https://gerrit.osmocom.org/c/libosmo-gprs/+/34532?usp=email
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: libosmo-gprs
Gerrit-Branch: master
Gerrit-Change-Id: Ica93447bc1f2e60984be7c9c73b153b4eb508aaa
Gerrit-Change-Number: 34532
Gerrit-PatchSet: 1
Gerrit-Owner: pespin 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria 
Gerrit-Attention: fixeria 
Gerrit-Comment-Date: Tue, 26 Sep 2023 12:54:02 +
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: fixeria 
Gerrit-MessageType: comment


[S] Change in libosmo-gprs[master]: rlcmac: Fix compilation error 'rlcmac_prim may be used uninitialized'

2023-09-26 Thread pespin
pespin has uploaded this change for review. ( 
https://gerrit.osmocom.org/c/libosmo-gprs/+/34532?usp=email )


Change subject: rlcmac: Fix compilation error 'rlcmac_prim may be used 
uninitialized'
..

rlcmac: Fix compilation error 'rlcmac_prim may be used uninitialized'

Change-Id: Ica93447bc1f2e60984be7c9c73b153b4eb508aaa
---
M src/rlcmac/tbf_ul_ass_fsm.c
1 file changed, 12 insertions(+), 1 deletion(-)



  git pull ssh://gerrit.osmocom.org:29418/libosmo-gprs refs/changes/32/34532/1

diff --git a/src/rlcmac/tbf_ul_ass_fsm.c b/src/rlcmac/tbf_ul_ass_fsm.c
index 64797aa..b1be58c 100644
--- a/src/rlcmac/tbf_ul_ass_fsm.c
+++ b/src/rlcmac/tbf_ul_ass_fsm.c
@@ -118,7 +118,9 @@
LOGPFSML(ctx->fi, LOGL_INFO, "Requesting two-phase packet 
access using CCCH\n");
rlcmac_prim = gprs_rlcmac_prim_alloc_l1ctl_rach8_req(0x70);
break;
-   /* TODO: EGPRS specific modes (11-bit RACH) */
+   default:
+   /* TODO: EGPRS specific modes (11-bit RACH) */
+   return -ENOTSUP;
}

return gprs_rlcmac_prim_call_down_cb(rlcmac_prim);

--
To view, visit https://gerrit.osmocom.org/c/libosmo-gprs/+/34532?usp=email
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: libosmo-gprs
Gerrit-Branch: master
Gerrit-Change-Id: Ica93447bc1f2e60984be7c9c73b153b4eb508aaa
Gerrit-Change-Number: 34532
Gerrit-PatchSet: 1
Gerrit-Owner: pespin 
Gerrit-MessageType: newchange