Skip to content

Staging: Replace ternary operators with macros min/max

Bhumika Goyal outreachy 3 versions – New

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v3 Latest5 patches 0 repliesNew
  2. v25 patches 1 replySuperseded
  3. v15 patches 5 repliesSuperseded

Changes in v3 from the cover letter

* No change.

Patches in v3 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/5Staging: rtl8723au: Use min macro instead of ternary operatordrivers/staging/rtl8723au/os_dep/ioctl_cfg80211.c+7 -70 replies
2/5Staging: rdma: Use min macro instead of ternary operatordrivers/staging/rdma/hfi1/pio_copy.c+3 -30 replies
3/5Staging: gdm724x: Use min instead of ternary operatordrivers/staging/gdm724x/gdm_mux.c+1 -10 replies
4/5Staging: lustre: Use min or max instead of ternary operatordrivers/staging/lustre/lustre/include/lustre_disk.h drivers/staging/lustre/lustre/osc/osc_request.c drivers/staging/lustre/lustre/ptlrpc/events.c+4 -60 replies
5/5Staging: rts5208: Use min instead of ternary operatordrivers/staging/rts5208/sd.c+2 -20 replies

Reviews trailers per patch

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

Read the v3 thread

Cover letter [PATCH v3 0/5] Staging: Replace ternary operators with macros min/max

This patchset replaces ternary operators with macros min/max as they are shorter and thus increases code readability. Macro min returns the minimum and macro max returns maximum of the two compared values. Made a semantic patch for changes:

@@
type T;
T x;
T y;
@@
(
- x < y ? x : y
+ min(x,y)
|
- x > y ? x : y
+ max(x,y)
)

Changes in v2:
* Use min()/max() instead of min_t()/max_t() as the values passed in the macros are of same type.
Changes in v3:
* No change.

Bhumika Goyal (5):
Staging: rtl8723au: Use min macro instead of ternary operator
Staging: rdma: Use min macro instead of ternary operator
Staging: gdm724x: Use min instead of ternary operator
Staging: lustre: Use min or max instead of ternary operator
Staging: rts5208: Use min instead of ternary operator

 drivers/staging/gdm724x/gdm_mux.c                   |  2 +-
 drivers/staging/lustre/lustre/include/lustre_disk.h |  6 ++----
 drivers/staging/lustre/lustre/osc/osc_request.c     |  2 +-
 drivers/staging/lustre/lustre/ptlrpc/events.c       |  2 +-
 drivers/staging/rdma/hfi1/pio_copy.c                |  6 +++---
 drivers/staging/rtl8723au/os_dep/ioctl_cfg80211.c   | 14 +++++++-------
 drivers/staging/rts5208/sd.c                        |  4 ++--
 7 files changed, 17 insertions(+), 19 deletions(-)
Signature · 1 line
1.9.1