staging: greybus: Inline pwm_chip_to_gb_pwm_chip()
PATCH v4 1/1 staging: greybus: Inline pwm_chip_to_gb_pwm_chip()
Convert 'pwm_chip_to_gb_pwm_chip' from a macro to a static inline function, to make the relevant types apparent in the definition and to benefit from the type checking performed by the compiler at call sites.
Signed-off-by Sumitra Sharma <[email protected]>
---
Changes in v2: Change patch subjects, noted by Alison Schofield <[email protected]>
Changes in v3: Change patch subjects to length 80 chars, noted by Alison Schofield <[email protected]>
Changes in v4: Apply change to fresh git tree, noted by Greg KH <[email protected]>
drivers/staging/greybus/pwm.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-)
drivers/staging/greybus/pwm.c +5 -2
@@ -21,8 +21,11 @@ struct gb_pwm_chip {struct pwm_chip chip;struct pwm_chip *pwm; }; -#define pwm_chip_to_gb_pwm_chip (chip) \ - container_of(chip, struct gb_pwm_chip, chip) + +static inline struct gb_pwm_chip *pwm_chip_to_gb_pwm_chip (struct pwm_chip *chip) +{ + return container_of(chip, struct gb_pwm_chip, chip); +}static int gb_pwm_count_operation (struct gb_pwm_chip *pwmc) {
Signature · 1 line
2.25.1