Merge lp:~phablet-team/ofono/ofono-lp1271284 into lp:~phablet-team/ofono/ubuntu

Proposed by Tony Espy
Status: Merged
Merged at revision: 6853
Proposed branch: lp:~phablet-team/ofono/ofono-lp1271284
Merge into: lp:~phablet-team/ofono/ubuntu
Diff against target: 64 lines (+12/-6)
2 files modified
debian/changelog (+8/-2)
src/idmap.c (+4/-4)
To merge this branch: bzr merge lp:~phablet-team/ofono/ofono-lp1271284
Reviewer Review Type Date Requested Status
PS Jenkins bot continuous-integration Approve
Ricardo Salveti Pending
Review via email: mp+204583@code.launchpad.net

Commit message

idmap: use UL for bitshift literals (LP: #1271284)
This change fixes a failing unit test on ppc64le
due to the undefined behavior when the left bitshift
operator is given a value that excedes the size of
the value being shifted.

Description of the change

This change fixes a problem in ofono's idmap code which was causing a unit test failure on ppc64le, which is a recently introduced architecture.

The change has been tested on maguro with build #144. The idmap code is only used by the core gprs code, so if GPRS comes up properly, then everything is good.

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'debian/changelog'
2--- debian/changelog 2014-01-21 19:01:39 +0000
3+++ debian/changelog 2014-02-03 22:02:26 +0000
4@@ -1,4 +1,4 @@
5-ofono (1.12+bzr6851-0ubuntu2) UNRELEASED; urgency=low
6+ofono (1.12+bzr6851-0ubuntu3) UNRELEASED; urgency=low
7 [ Tony Espy ]
8 * unit: fix fail-to-build on powerpc
9 The previously released version enabled -Wall,
10@@ -9,7 +9,13 @@
11 and data. This change exends the ifdef to cover
12 the unused functions and test data.
13
14- -- tony espy <espy@canonical.com> Tue, 21 Jan 2014 13:54:46 -0500
15+ * idmap: use UL for bitshift literals (LP: #1271284)
16+ This change fixes a failing unit test on ppc64le
17+ due to the undefined behavior when the left bitshift
18+ operator is given a value that excedes the size of
19+ the value being shifted.
20+
21+ -- Tony Espy <espy@canonical.com> Mon, 03 Feb 2014 16:28:46 -0500
22
23 ofono (1.12+bzr6851-0ubuntu1) trusty; urgency=low
24
25
26=== modified file 'src/idmap.c'
27--- src/idmap.c 2011-10-15 19:21:12 +0000
28+++ src/idmap.c 2014-02-03 22:02:26 +0000
29@@ -135,7 +135,7 @@
30
31 id %= BITS_PER_LONG;
32
33- idmap->bits[offset] &= ~(1 << id);
34+ idmap->bits[offset] &= ~(1UL << id);
35 }
36
37 unsigned int idmap_alloc(struct idmap *idmap)
38@@ -149,7 +149,7 @@
39 return idmap->max + 1;
40
41 offset = bit / BITS_PER_LONG;
42- idmap->bits[offset] |= 1 << (bit % BITS_PER_LONG);
43+ idmap->bits[offset] |= 1UL << (bit % BITS_PER_LONG);
44
45 return bit + idmap->min;
46 }
47@@ -163,7 +163,7 @@
48 return;
49
50 offset = bit / BITS_PER_LONG;
51- idmap->bits[offset] |= 1 << (bit % BITS_PER_LONG);
52+ idmap->bits[offset] |= 1UL << (bit % BITS_PER_LONG);
53 }
54
55 /*
56@@ -186,7 +186,7 @@
57 return idmap_alloc(idmap);
58
59 offset = bit / BITS_PER_LONG;
60- idmap->bits[offset] |= 1 << (bit % BITS_PER_LONG);
61+ idmap->bits[offset] |= 1UL << (bit % BITS_PER_LONG);
62
63 return bit + idmap->min;
64 }

Subscribers

People subscribed via source and target branches

to all changes: