Skip to content

staging: bcm2835-audio: clean-up coding style issues

Aishwarya Pant outreachy 7 versions – New

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v7 Latest6 patches 0 repliesNew
  2. v67 patches 4 repliesSuperseded
  3. v57 patches 4 repliesSuperseded
Earlier versions · 4
VersionPostedPatchesRepliesStatus
v48 patches1 replySuperseded
v34 patches2 repliesSuperseded
v24 patches3 repliesSuperseded
v12 patches1 replySuperseded

Changes in v7 from the cover letter

-- Added back the debug log messages in bcm2835_audio_open_connection() -- Remove label err_free_memory, re-use label err_free_mem to kfree
vchi_instance in bcm2835_audio_open_connection()
-- Drop patch 7 which removed BUG_ON(instance). Looks like if(instance)
block is WIP, BUG_ON(instance) may be required for debugging in the interim period.

Patches in v7 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/6staging: bcm2835-audio: Replace kmalloc with kzallocdrivers/staging/vc04_services/bcm2835-audio/bcm2835-vchiq.c+1 -20 replies
2/6staging: bcm2835-audio: replace null with error pointer valuedrivers/staging/vc04_services/bcm2835-audio/bcm2835-vchiq.c+6 -50 replies
3/6staging: bcm2835-audio: propagate PTR_ERR value instead of -EPERMdrivers/staging/vc04_services/bcm2835-audio/bcm2835-vchiq.c+1 -10 replies
4/6staging: bcm2835-audio: use conditional only for error casedrivers/staging/vc04_services/bcm2835-audio/bcm2835-vchiq.c+32 -350 replies
5/6staging: bcm2835-audio: deallocate work when queue_work(...) failsdrivers/staging/vc04_services/bcm2835-audio/bcm2835-vchiq.c+3 -00 replies
6/6staging: bcm2835-audio: fix memory leak in bcm2835_audio_open_connection()drivers/staging/vc04_services/bcm2835-audio/bcm2835-vchiq.c+1 -00 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v7 yet.

Read the v7 thread

Cover letter [PATCH v7 0/6] staging: bcm2835-audio: clean-up coding style issues

[1] Replace kmalloc and memset with kzalloc in vc_vchi_audio_init(..)
[2] Replace null return value with PTR_ERR(..) values

    in vc_vchi_audio_init(..)

[3] Propagate the PTR_ERR values forward instead of a hardcoded value for easier debugging in bcm2835_audio_open_connection(..)
[4] Replace if (success) else { } after kmalloc with if(error) to fail fast in the work function
[5] De-allocate 'work' when queue_work(..) fails in the work functions
[6] De-allocate 'vchi_instance' when VCHI connection fails or VCHI audio instance initialisation fails in bcm2835_audio_open_connection()

Changes in v7:
-- Added back the debug log messages in bcm2835_audio_open_connection() -- Remove label err_free_memory, re-use label err_free_mem to kfree
vchi_instance in bcm2835_audio_open_connection()
-- Drop patch 7 which removed BUG_ON(instance). Looks like if(instance)
block is WIP, BUG_ON(instance) may be required for debugging in the interim period.

Changes in v6:
-- Add a local variable ret to set error value instead of
returning -EPERM when initialisation of vchi_audio_service fails in bcm2835_audio_open_connection()

Changes in v5:
-- Remove patch which added function names to log messages

Changes in v4:
-- Break-up patch 4 into four smaller patches
-- Add a patch proposing removal of BUG_ON()
-- Make the cover letter verbose

Changes in v3:
-- Fix memory leak when queue_work fails
-- Add __func__ to debug logs

Changes in v2:
-- Return error value -EBUSY instead of -1 when queue_work()
fails

Aishwarya Pant (6):
staging: bcm2835-audio: Replace kmalloc with kzalloc
staging: bcm2835-audio: replace null with error pointer value
staging: bcm2835-audio: propagate PTR_ERR value instead of -EPERM
staging: bcm2835-audio: use conditional only for error case
staging: bcm2835-audio: deallocate work when queue_work(...) fails
staging: bcm2835-audio: fix memory leak in

    bcm2835_audio_open_connection()
 .../vc04_services/bcm2835-audio/bcm2835-vchiq.c    | 87 +++++++++++-----------
 1 file changed, 44 insertions(+), 43 deletions(-)
Signature · 1 line
2.7.4