Repository navigation
Commit eedc9d8
kbuild: fix headers_exports with boolean expression
When we had code like this in a header unifdef failed to
deduct that the expression was always false - and we had code exported
that was not intended for userspace.
#if defined(__KERNEL__) && !defined(__ASSEMBLY__)
int a;
#endif
This commit implment support in unidef which allows it to work out if
an #if expression always evaluates true or false for symbols which
are being undefined/always defined.
The patch is slightly more complicated than I'd hoped because unifdef
needs to see lines fully evaluated - doing otherwise causes it to
mark the line as "dirty" and copy it over no matter what.
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Signed-off-by: Sam Ravnborg <sam@ravnborg.org>1 parent 67b7ebe commit eedc9d8
1 file changed
Lines changed: 37 additions & 11 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
678 | 678 | | |
679 | 679 | | |
680 | 680 | | |
681 | | - | |
| 681 | + | |
| 682 | + | |
682 | 683 | | |
| 684 | + | |
683 | 685 | | |
684 | 686 | | |
685 | 687 | | |
| |||
700 | 702 | | |
701 | 703 | | |
702 | 704 | | |
703 | | - | |
704 | | - | |
705 | | - | |
706 | 705 | | |
707 | 706 | | |
708 | 707 | | |
709 | 708 | | |
| 709 | + | |
| 710 | + | |
| 711 | + | |
| 712 | + | |
| 713 | + | |
| 714 | + | |
710 | 715 | | |
711 | 716 | | |
712 | 717 | | |
| |||
741 | 746 | | |
742 | 747 | | |
743 | 748 | | |
| 749 | + | |
744 | 750 | | |
745 | 751 | | |
746 | 752 | | |
747 | | - | |
748 | | - | |
| 753 | + | |
749 | 754 | | |
750 | 755 | | |
751 | 756 | | |
| |||
755 | 760 | | |
756 | 761 | | |
757 | 762 | | |
758 | | - | |
759 | | - | |
760 | | - | |
| 763 | + | |
| 764 | + | |
| 765 | + | |
| 766 | + | |
| 767 | + | |
| 768 | + | |
| 769 | + | |
| 770 | + | |
| 771 | + | |
| 772 | + | |
| 773 | + | |
| 774 | + | |
| 775 | + | |
| 776 | + | |
| 777 | + | |
| 778 | + | |
| 779 | + | |
| 780 | + | |
| 781 | + | |
761 | 782 | | |
762 | 783 | | |
763 | 784 | | |
764 | 785 | | |
765 | | - | |
| 786 | + | |
| 787 | + | |
| 788 | + | |
766 | 789 | | |
767 | 790 | | |
768 | 791 | | |
| |||
773 | 796 | | |
774 | 797 | | |
775 | 798 | | |
| 799 | + | |
776 | 800 | | |
777 | 801 | | |
778 | 802 | | |
779 | 803 | | |
780 | 804 | | |
781 | | - | |
| 805 | + | |
| 806 | + | |
| 807 | + | |
782 | 808 | | |
783 | 809 | | |
784 | 810 | | |
| |||
0 commit comments