linux-pwm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 0/3] pwm: ensure pwm_apply_state() doesn't modify the state argument
@ 2019-03-12 21:46 Uwe Kleine-König
       [not found] ` <20190312214605.10223-1-u.kleine-koenig-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
  0 siblings, 1 reply; 28+ messages in thread
From: Uwe Kleine-König @ 2019-03-12 21:46 UTC (permalink / raw)
  To: Thierry Reding, Heiko Stuebner, Maxime Ripard, Chen-Yu Tsai
  Cc: linux-pwm-u79uwXL29TY76Z2rM5mHXA, kernel-bIcnvbaLZ9MEGnE8C9+IrQ,
	linux-rockchip-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r

Hello,

this series eventually makes the "state" parameter of pwm_apply_state()
point to a const value. Two drivers (sun4i and rockchip) modfied the
contents here with good intentions, but I believe that it does more harm
than good. See the commit log of the last patch for a more detailed
reasoning.

The first two patches fix the two offending drivers to not modify the
state variable, then in the last patch the prototype of
pwm_apply_state() is changed to make the requirement to not change state
obvious. Note that the prototype of pwm_apply_state() already had a
const in include/linux/pwm.h for the !IS_ENABLED(CONFIG_PWM) case.

Compared to v1 sent earlier today, the sun4i patch is new. I missed that
there was a non-trivial change when preparing the patches and it was
folded into the last patch. Thanks to Thierry for spotting this. The end
result is unmodified.

Best regards
Uwe

Uwe Kleine-König (3):
  pwm: rockchip: Don't update the state for the caller of
    pwm_apply_state()
  pwm: sun4i: Don't update the state for the caller of pwm_apply_state()
  pwm: ensure pwm_apply_state() doesn't modify the state argument

 drivers/pwm/core.c            |  2 +-
 drivers/pwm/pwm-atmel-hlcdc.c |  2 +-
 drivers/pwm/pwm-atmel.c       |  2 +-
 drivers/pwm/pwm-bcm-iproc.c   |  2 +-
 drivers/pwm/pwm-cros-ec.c     |  2 +-
 drivers/pwm/pwm-hibvt.c       |  2 +-
 drivers/pwm/pwm-imx27.c       |  2 +-
 drivers/pwm/pwm-lpss.c        |  2 +-
 drivers/pwm/pwm-meson.c       |  2 +-
 drivers/pwm/pwm-rcar.c        |  2 +-
 drivers/pwm/pwm-rockchip.c    | 10 ++--------
 drivers/pwm/pwm-stm32-lp.c    |  2 +-
 drivers/pwm/pwm-sun4i.c       | 10 ++--------
 drivers/pwm/pwm-zx.c          |  2 +-
 include/linux/pwm.h           |  4 ++--
 15 files changed, 18 insertions(+), 30 deletions(-)

-- 
2.20.1


_______________________________________________
Linux-rockchip mailing list
Linux-rockchip@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-rockchip

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

end of thread, other threads:[~2019-05-03 19:59 UTC | newest]

Thread overview: 28+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-03-12 21:46 [PATCH v2 0/3] pwm: ensure pwm_apply_state() doesn't modify the state argument Uwe Kleine-König
     [not found] ` <20190312214605.10223-1-u.kleine-koenig-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
2019-03-12 21:46   ` [PATCH v2 1/3] pwm: rockchip: Don't update the state for the caller of pwm_apply_state() Uwe Kleine-König
     [not found]     ` <20190312214605.10223-2-u.kleine-koenig-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
2019-03-30  9:17       ` Heiko Stuebner
2019-04-01 22:45         ` Doug Anderson
     [not found]           ` <CAD=FV=WZHouhGcxOgNG3006XajJQaAp0uq9WjeKRikQx1ru4TA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2019-04-08 14:39             ` Uwe Kleine-König
     [not found]               ` <20190408143914.uucb5dwafq3cnsmk-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
2019-04-19  0:27                 ` Brian Norris
     [not found]                   ` <CA+ASDXO=szekU97iTDK9vqWjT+JtAKeCNTyoY=8aSi5d+v4mkA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2019-04-29  6:56                     ` Uwe Kleine-König
     [not found]                       ` <20190429065613.n52uwgys5eugmssd-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
2019-04-29 11:18                         ` Thierry Reding
2019-04-29 13:11                           ` Uwe Kleine-König
     [not found]                             ` <20190429131127.x535uhhtputb7zwl-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
2019-04-29 16:28                               ` Thierry Reding
2019-04-30  9:14                                 ` Uwe Kleine-König
2019-04-29 18:04                         ` Doug Anderson
     [not found]                           ` <CAD=FV=U71u39ZHkBBfAXVAP=_hY-bAw3L7JdhC=36jkUVxPOmQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2019-04-30  9:28                             ` Uwe Kleine-König
     [not found]                               ` <20190430092824.ijtq3gfh6mqujvnk-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
2019-04-30 14:38                                 ` Doug Anderson
     [not found]                                   ` <CAD=FV=WUi0NbsRDJA_4WeC62QYXjLNH2OygU1FOCx==W0SyqpQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2019-05-02  6:48                                     ` Uwe Kleine-König
2019-05-02  7:16                             ` Boris Brezillon
     [not found]                               ` <20190502091638.0f5a40b0-ZGY8ohtN/8qB+jHODAdFcQ@public.gmane.org>
2019-05-02  7:33                                 ` Uwe Kleine-König
     [not found]                                   ` <20190502073326.sgqgkiexjkipvi27-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
2019-05-02  8:09                                     ` Boris Brezillon
     [not found]                                       ` <20190502100951.23ef9ed1-ZGY8ohtN/8qB+jHODAdFcQ@public.gmane.org>
2019-05-02  8:42                                         ` Uwe Kleine-König
     [not found]                                           ` <20190502084243.anz5myut63g4torn-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
2019-05-03 10:59                                             ` Thierry Reding
2019-05-03 19:59                                               ` Uwe Kleine-König
2019-04-29 11:03                 ` Thierry Reding
2019-04-29 12:31                   ` Uwe Kleine-König
     [not found]                     ` <20190429123102.7wfcdqusn24g5rm7-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
2019-04-29 16:17                       ` Thierry Reding
2019-04-29 21:08                         ` Uwe Kleine-König
2019-04-29 10:49             ` Thierry Reding
2019-03-12 21:46   ` [PATCH v2 2/3] pwm: sun4i: " Uwe Kleine-König
2019-03-12 21:46   ` [PATCH v2 3/3] pwm: ensure pwm_apply_state() doesn't modify the state argument Uwe Kleine-König

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).