lkml.org 
[lkml]   [2016]   [Feb]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH] drivers: stm: correct the index in master array release
Date
Chunyan Zhang <zhang.chunyan@linaro.org> writes:

> It would be broken if stm_data->sw_start isn't zero, because that
> stp_master_free() get the 'master' with __stm_master()/stm_master(),
> in which the masterID is the second input parameter minus
> stm_data->sw_start. So freeing STM masters has to start from
> stm_data->sw_start.

No, it won't. stm_master_free() handles nonexistent masters correctly.
It does make sense to shrink the loop in stm_unregister_device() to
avoid going through the [0..sw_start) range, since stm_master() returns
NULL for those, but not for the reasons given in this patch description.

Regards,
--
Alex

\
 
 \ /
  Last update: 2016-02-09 11:41    [W:0.049 / U:0.392 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site