Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

gpio: Add comments on #if/#else/#endif

Improve readability a bit by commenting #if/#else/#endif statements
with the checked preprocessor symbols.

Signed-off-by: Enrico Weigelt <info@metux.net>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>

authored by

Enrico Weigelt and committed by
Linus Walleij
f310f2ef a1000673

+11 -11
+8 -8
include/linux/gpio/driver.h
··· 161 161 */ 162 162 void (*irq_disable)(struct irq_data *data); 163 163 }; 164 - #endif 164 + #endif /* CONFIG_GPIOLIB_IRQCHIP */ 165 165 166 166 /** 167 167 * struct gpio_chip - abstract a GPIO controller ··· 301 301 spinlock_t bgpio_lock; 302 302 unsigned long bgpio_data; 303 303 unsigned long bgpio_dir; 304 - #endif 304 + #endif /* CONFIG_GPIO_GENERIC */ 305 305 306 306 #ifdef CONFIG_GPIOLIB_IRQCHIP 307 307 /* ··· 316 316 * used to handle IRQs for most practical cases. 317 317 */ 318 318 struct gpio_irq_chip irq; 319 - #endif 319 + #endif /* CONFIG_GPIOLIB_IRQCHIP */ 320 320 321 321 /** 322 322 * @need_valid_mask: ··· 363 363 */ 364 364 int (*of_xlate)(struct gpio_chip *gc, 365 365 const struct of_phandle_args *gpiospec, u32 *flags); 366 - #endif 366 + #endif /* CONFIG_OF_GPIO */ 367 367 }; 368 368 369 369 extern const char *gpiochip_is_requested(struct gpio_chip *chip, ··· 406 406 }) 407 407 #else 408 408 #define gpiochip_add_data(chip, data) gpiochip_add_data_with_key(chip, data, NULL, NULL) 409 - #endif 409 + #endif /* CONFIG_LOCKDEP */ 410 410 411 411 static inline int gpiochip_add(struct gpio_chip *chip) 412 412 { ··· 461 461 #define BGPIOF_READ_OUTPUT_REG_SET BIT(4) /* reg_set stores output value */ 462 462 #define BGPIOF_NO_OUTPUT BIT(5) /* only input */ 463 463 464 - #endif 464 + #endif /* CONFIG_GPIO_GENERIC */ 465 465 466 466 #ifdef CONFIG_GPIOLIB_IRQCHIP 467 467 ··· 531 531 handler, type, true, 532 532 &lock_key, &request_key); 533 533 } 534 - #else 534 + #else /* ! CONFIG_LOCKDEP */ 535 535 static inline int gpiochip_irqchip_add(struct gpio_chip *gpiochip, 536 536 struct irq_chip *irqchip, 537 537 unsigned int first_irq, ··· 582 582 unsigned int gpio_offset, const char *pin_group); 583 583 void gpiochip_remove_pin_ranges(struct gpio_chip *chip); 584 584 585 - #else 585 + #else /* ! CONFIG_PINCTRL */ 586 586 587 587 static inline int 588 588 gpiochip_add_pin_range(struct gpio_chip *chip, const char *pinctl_name,
+1 -1
include/linux/gpio/gpio-reg.h
··· 11 11 12 12 int gpio_reg_resume(struct gpio_chip *gc); 13 13 14 - #endif 14 + #endif /* GPIO_REG_H */
+2 -2
include/linux/gpio/machine.h
··· 97 97 void gpiod_add_lookup_tables(struct gpiod_lookup_table **tables, size_t n); 98 98 void gpiod_remove_lookup_table(struct gpiod_lookup_table *table); 99 99 void gpiod_add_hogs(struct gpiod_hog *hogs); 100 - #else 100 + #else /* ! CONFIG_GPIOLIB */ 101 101 static inline 102 102 void gpiod_add_lookup_table(struct gpiod_lookup_table *table) {} 103 103 static inline ··· 105 105 static inline 106 106 void gpiod_remove_lookup_table(struct gpiod_lookup_table *table) {} 107 107 static inline void gpiod_add_hogs(struct gpiod_hog *hogs) {} 108 - #endif 108 + #endif /* CONFIG_GPIOLIB */ 109 109 110 110 #endif /* __LINUX_GPIO_MACHINE_H */