Linux bluetooth development
 help / color / mirror / Atom feed
* [PATCH 0/4] Abort on small allocations
@ 2015-10-26 21:57 Szymon Janc
  2015-10-26 21:57 ` [PATCH 1/4] shared: Make new0 abort on failure Szymon Janc
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: Szymon Janc @ 2015-10-26 21:57 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: Szymon Janc

Hi,

Rebased and resent.

>From original RFC:
This patchset is an initial work to simplify handling of memory allocation
failures in BlueZ. The solution is simple: don't check for errors and just
abort if allocation fails.

This make error paths (which were most likely never executed) *much* simpler.

Another benefit is increased similarity of src/shared APIs to already used
Glib APIs which also abort on allocation error (unless _try variant is used).
This makes transition from Glib APIs to shared APIs easier.

Patches 1-3 are samples that show how much of the error handling code
can be removed. Those are initial patches as 'never-fail' API propagates up
(new0()->queue_new()->foo_add()) and futher error handling can be removed.


Szymon Janc (4):
  shared: Make new0 abort on failure
  shared: Remove dead code
  android: Remove dead code
  core: Remove dead code

 android/avdtp.c               |   5 +-
 android/avdtptest.c           |   4 -
 android/bas.c                 |  55 +------
 android/bluetooth.c           |  17 ---
 android/dis.c                 |  11 --
 android/gatt.c                | 336 +++++-------------------------------------
 android/handsfree-client.c    |  14 +-
 android/handsfree.c           |   9 +-
 android/health.c              |  67 ++-------
 android/hog.c                 |   2 -
 android/scpp.c                |  22 +--
 android/tester-a2dp.c         |   7 +-
 android/tester-avrcp.c        |   7 +-
 android/tester-bluetooth.c    |   7 +-
 android/tester-gatt.c         |   7 +-
 android/tester-hdp.c          |   7 +-
 android/tester-hidhost.c      |   7 +-
 android/tester-map-client.c   |   7 +-
 android/tester-pan.c          |   7 +-
 android/tester-socket.c       |   7 +-
 src/advertising.c             |   6 -
 src/gatt-client.c             |  67 ---------
 src/gatt-database.c           | 100 -------------
 src/shared/ad.c               |  31 ----
 src/shared/att.c              |  34 +----
 src/shared/crypto.c           |   2 -
 src/shared/gap.c              |   7 -
 src/shared/gatt-client.c      |  59 --------
 src/shared/gatt-db.c          |  37 -----
 src/shared/gatt-helpers.c     |  24 ---
 src/shared/gatt-server.c      |  47 ------
 src/shared/hci-crypto.c       |   6 -
 src/shared/hci.c              |  29 ----
 src/shared/hfp.c              |  40 -----
 src/shared/io-mainloop.c      |   3 -
 src/shared/mgmt.c             |  42 ------
 src/shared/queue.c            |  12 --
 src/shared/ringbuf.c          |   3 -
 src/shared/tester.c           |   9 --
 src/shared/timeout-mainloop.c |   3 -
 src/shared/uhid.c             |   8 -
 src/shared/util.c             |  16 ++
 src/shared/util.h             |  14 +-
 43 files changed, 97 insertions(+), 1107 deletions(-)

-- 
2.6.2


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2015-10-30 10:58 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-10-26 21:57 [PATCH 0/4] Abort on small allocations Szymon Janc
2015-10-26 21:57 ` [PATCH 1/4] shared: Make new0 abort on failure Szymon Janc
2015-10-26 21:57 ` [PATCH 2/4] shared: Remove dead code Szymon Janc
2015-10-26 21:57 ` [PATCH 3/4] android: " Szymon Janc
2015-10-26 21:57 ` [PATCH 4/4] core: " Szymon Janc
2015-10-30 10:58 ` [PATCH 0/4] Abort on small allocations Szymon Janc

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox