cocci.inria.fr archive mirror
 help / color / mirror / Atom feed
* [Cocci] [PATCH v2 0/7] include: add setbits32/clrbits32/clrsetbits32/setbits64/clrbits64/clrsetbits64
@ 2018-09-24 19:04 Corentin Labbe
  2018-09-24 19:04 ` [Cocci] [PATCH v2 1/7] powerpc: rename setbits32/clrbits32 to setbits32_be/clrbits32_be Corentin Labbe
                   ` (6 more replies)
  0 siblings, 7 replies; 16+ messages in thread
From: Corentin Labbe @ 2018-09-24 19:04 UTC (permalink / raw)
  To: cocci

Hello

This patchset adds a new set of functions which are open-coded in lot of
place.
Basicly the pattern is always the same, "read, modify a bit, write"
some driver and the powerpc arch already have thoses pattern them as functions. (like ahci_sunxi.c or dwmac-meson8b)

The first patch rename some powerpc funtions for being consistent with
the new name convention.

The second patch adds the header with all setbits functions.

The third patch is a try to implement a coccinelle semantic patch to
find all place where xxxbits function could be used.
It should not be merged since it is un-finalized.
For the moment, the "add setbits.h header" is not working and need a future
coccinelle version.

The four last patch are example of some drivers convertion.
Thoses patchs give an example of the reduction of code won by using xxxbits32.

I would like to thanks Julia Lawall for her help on the coccinelle
patch.

Regards

Changes since v1:
- renamed LE functions to _leXX
- updated coccinnelle patch with JLawall's comments

Corentin Labbe (7):
  powerpc: rename setbits32/clrbits32 to setbits32_be/clrbits32_be
  include: add
    setbits32/clrbits32/clrsetbits32/setbits64/clrbits64/clrsetbits64 in
    linux/setbits.h
  coccinelle: add xxxsetbitsXX converting spatch
  ata: ahci_sunxi: use xxxsetbits32 functions
  net: ethernet: stmmac: dwmac-sun8i: use xxxsetbits32
  drm: meson: use xxxsetbits32
  net: stmmac: dwmac-meson8b: use xxxsetbits32

 arch/powerpc/include/asm/fsl_lbc.h                 |   2 +-
 arch/powerpc/include/asm/io.h                      |   5 +-
 arch/powerpc/platforms/44x/canyonlands.c           |   4 +-
 arch/powerpc/platforms/4xx/gpio.c                  |  28 +-
 arch/powerpc/platforms/512x/pdm360ng.c             |   6 +-
 arch/powerpc/platforms/52xx/mpc52xx_common.c       |   6 +-
 arch/powerpc/platforms/52xx/mpc52xx_gpt.c          |  10 +-
 arch/powerpc/platforms/82xx/ep8248e.c              |   2 +-
 arch/powerpc/platforms/82xx/km82xx.c               |   6 +-
 arch/powerpc/platforms/82xx/mpc8272_ads.c          |  10 +-
 arch/powerpc/platforms/82xx/pq2.c                  |   2 +-
 arch/powerpc/platforms/82xx/pq2ads-pci-pic.c       |   4 +-
 arch/powerpc/platforms/82xx/pq2fads.c              |  10 +-
 arch/powerpc/platforms/83xx/km83xx.c               |   6 +-
 arch/powerpc/platforms/83xx/mpc836x_mds.c          |   2 +-
 arch/powerpc/platforms/85xx/mpc85xx_mds.c          |   2 +-
 arch/powerpc/platforms/85xx/mpc85xx_pm_ops.c       |   4 +-
 arch/powerpc/platforms/85xx/mpc85xx_rdb.c          |   2 +-
 arch/powerpc/platforms/85xx/p1022_ds.c             |   4 +-
 arch/powerpc/platforms/85xx/p1022_rdk.c            |   4 +-
 arch/powerpc/platforms/85xx/t1042rdb_diu.c         |   4 +-
 arch/powerpc/platforms/85xx/twr_p102x.c            |   2 +-
 arch/powerpc/platforms/86xx/mpc8610_hpcd.c         |   4 +-
 arch/powerpc/platforms/8xx/adder875.c              |   2 +-
 arch/powerpc/platforms/8xx/m8xx_setup.c            |   4 +-
 arch/powerpc/platforms/8xx/mpc86xads_setup.c       |   4 +-
 arch/powerpc/platforms/8xx/mpc885ads_setup.c       |  28 +-
 arch/powerpc/platforms/embedded6xx/flipper-pic.c   |   6 +-
 arch/powerpc/platforms/embedded6xx/hlwd-pic.c      |   8 +-
 arch/powerpc/platforms/embedded6xx/wii.c           |  10 +-
 arch/powerpc/sysdev/cpm1.c                         |  26 +-
 arch/powerpc/sysdev/cpm2.c                         |  16 +-
 arch/powerpc/sysdev/cpm_common.c                   |   4 +-
 arch/powerpc/sysdev/fsl_85xx_l2ctlr.c              |   8 +-
 arch/powerpc/sysdev/fsl_lbc.c                      |   2 +-
 arch/powerpc/sysdev/fsl_pci.c                      |   8 +-
 arch/powerpc/sysdev/fsl_pmc.c                      |   2 +-
 arch/powerpc/sysdev/fsl_rcpm.c                     |  74 ++--
 arch/powerpc/sysdev/fsl_rio.c                      |   4 +-
 arch/powerpc/sysdev/fsl_rmu.c                      |   8 +-
 arch/powerpc/sysdev/mpic_timer.c                   |  12 +-
 drivers/ata/ahci_sunxi.c                           |  51 +--
 drivers/gpu/drm/meson/meson_crtc.c                 |  14 +-
 drivers/gpu/drm/meson/meson_dw_hdmi.c              |  33 +-
 drivers/gpu/drm/meson/meson_plane.c                |  13 +-
 drivers/gpu/drm/meson/meson_registers.h            |   3 -
 drivers/gpu/drm/meson/meson_venc.c                 |  13 +-
 drivers/gpu/drm/meson/meson_venc_cvbs.c            |   4 +-
 drivers/gpu/drm/meson/meson_viu.c                  |  65 +--
 drivers/gpu/drm/meson/meson_vpp.c                  |  22 +-
 .../net/ethernet/stmicro/stmmac/dwmac-meson8b.c    |  56 +--
 drivers/net/ethernet/stmicro/stmmac/dwmac-sun8i.c  |  62 +--
 include/linux/setbits.h                            |  88 ++++
 scripts/add_new_include_in_source.py               |  61 +++
 scripts/coccinelle/misc/setbits32.cocci            | 487 +++++++++++++++++++++
 scripts/coccinelle/misc/setbits32_relaxed.cocci    | 487 +++++++++++++++++++++
 scripts/coccinelle/misc/setbits64.cocci            | 487 +++++++++++++++++++++
 scripts/coccinelle/misc/setbits_dev.cocci          | 235 ++++++++++
 58 files changed, 2159 insertions(+), 377 deletions(-)
 create mode 100644 include/linux/setbits.h
 create mode 100755 scripts/add_new_include_in_source.py
 create mode 100644 scripts/coccinelle/misc/setbits32.cocci
 create mode 100644 scripts/coccinelle/misc/setbits32_relaxed.cocci
 create mode 100644 scripts/coccinelle/misc/setbits64.cocci
 create mode 100644 scripts/coccinelle/misc/setbits_dev.cocci

-- 
2.16.4

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

end of thread, other threads:[~2018-09-27  5:35 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-09-24 19:04 [Cocci] [PATCH v2 0/7] include: add setbits32/clrbits32/clrsetbits32/setbits64/clrbits64/clrsetbits64 Corentin Labbe
2018-09-24 19:04 ` [Cocci] [PATCH v2 1/7] powerpc: rename setbits32/clrbits32 to setbits32_be/clrbits32_be Corentin Labbe
2018-09-25  4:56   ` Christophe LEROY
2018-09-27  5:30     ` LABBE Corentin
2018-09-24 19:04 ` [Cocci] [PATCH v2 2/7] include: add setbits32/clrbits32/clrsetbits32/setbits64/clrbits64/clrsetbits64 in linux/setbits.h Corentin Labbe
2018-09-25  5:05   ` Christophe LEROY
2018-09-27  5:35     ` LABBE Corentin
2018-09-24 19:04 ` [Cocci] [PATCH v2 3/7] coccinelle: add xxxsetbitsXX converting spatch Corentin Labbe
2018-09-24 19:04 ` [Cocci] [PATCH v2 4/7] ata: ahci_sunxi: use xxxsetbits32 functions Corentin Labbe
2018-09-24 19:04 ` [Cocci] [PATCH v2 5/7] net: ethernet: stmmac: dwmac-sun8i: use xxxsetbits32 Corentin Labbe
2018-09-24 19:04 ` [Cocci] [PATCH v2 6/7] drm: meson: " Corentin Labbe
2018-09-24 19:07   ` Neil Armstrong
2018-09-24 19:04 ` [Cocci] [PATCH v2 7/7] net: stmmac: dwmac-meson8b: " Corentin Labbe
2018-09-24 19:08   ` Neil Armstrong
2018-09-24 19:17   ` Florian Fainelli
2018-09-25  7:53     ` Neil Armstrong

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).