[PATCH v8 09/22] counter: Return error code on invalid modes

William Breathitt Gray vilhelm.gray at gmail.com
Sun Feb 21 23:42:51 EST 2021


On Sat, Feb 20, 2021 at 10:43:06AM -0600, David Lechner wrote:
> On 2/12/21 6:13 AM, William Breathitt Gray wrote:
> > Only a select set of modes (function, action, etc.) are valid for a
> > given device configuration. This patch ensures that invalid modes result
> > in a return -EINVAL. Such a situation should never occur in reality, but
> > it's good to define a default switch cases for the sake of making the
> > intent of the code clear.
> > 
> > Cc: Syed Nayyar Waris <syednwaris at gmail.com>
> > Cc: Kamel Bouhara <kamel.bouhara at bootlin.com>
> > Cc: Fabrice Gasnier <fabrice.gasnier at st.com>
> > Cc: Maxime Coquelin <mcoquelin.stm32 at gmail.com>
> > Cc: Alexandre Torgue <alexandre.torgue at st.com>
> > Cc: David Lechner <david at lechnology.com>
> > Signed-off-by: William Breathitt Gray <vilhelm.gray at gmail.com>
> > ---
> 
> Reviewed-by: David Lechner <david at lechnology.com>
> 
> (In response to Jonathan's comment, I think this is fine rather than
> adding more churn to change all of the breaks to returns - but will
> keep that in mind for future changes.)

Due to some other updates I'm making to this patchset, I went ahead
already and updated the breaks to returns in the few places where
applicable. The changes to this patch are minor, but being pedantic I'll
hold off on adding your Reviewed-by line until the next revision so you
have the opportunity to formally approve it.

William Breathitt Gray
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20210222/915cc656/attachment.sig>


More information about the linux-arm-kernel mailing list