diff options
author | Arjan van de Ven <arjan@linux.intel.com> | 2007-02-12 03:55:34 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-02-12 12:48:45 -0500 |
commit | d54b1fdb1d9f82e375a299e22bd366aad52d4c34 (patch) | |
tree | f94768d59702dbbc0beb9a70d9be65dbc5e5108d /drivers/message/i2o | |
parent | fa027c2a0a0d6d1df6b29ee99048502c93da0dd4 (diff) |
[PATCH] mark struct file_operations const 5
Many struct file_operations in the kernel can be "const". Marking them const
moves these to the .rodata section, which avoids false sharing with potential
dirty data. In addition it'll catch accidental writes at compile time to
these shared resources.
Signed-off-by: Arjan van de Ven <arjan@linux.intel.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/message/i2o')
-rw-r--r-- | drivers/message/i2o/i2o_config.c | 2 | ||||
-rw-r--r-- | drivers/message/i2o/i2o_proc.c | 38 |
2 files changed, 20 insertions, 20 deletions
diff --git a/drivers/message/i2o/i2o_config.c b/drivers/message/i2o/i2o_config.c index e33d446e7493..8ba275a12773 100644 --- a/drivers/message/i2o/i2o_config.c +++ b/drivers/message/i2o/i2o_config.c | |||
@@ -1111,7 +1111,7 @@ static int cfg_release(struct inode *inode, struct file *file) | |||
1111 | return 0; | 1111 | return 0; |
1112 | } | 1112 | } |
1113 | 1113 | ||
1114 | static struct file_operations config_fops = { | 1114 | static const struct file_operations config_fops = { |
1115 | .owner = THIS_MODULE, | 1115 | .owner = THIS_MODULE, |
1116 | .llseek = no_llseek, | 1116 | .llseek = no_llseek, |
1117 | .ioctl = i2o_cfg_ioctl, | 1117 | .ioctl = i2o_cfg_ioctl, |
diff --git a/drivers/message/i2o/i2o_proc.c b/drivers/message/i2o/i2o_proc.c index a61cb17c5c12..06892ac2286e 100644 --- a/drivers/message/i2o/i2o_proc.c +++ b/drivers/message/i2o/i2o_proc.c | |||
@@ -1703,133 +1703,133 @@ static int i2o_seq_open_dev_name(struct inode *inode, struct file *file) | |||
1703 | return single_open(file, i2o_seq_show_dev_name, PDE(inode)->data); | 1703 | return single_open(file, i2o_seq_show_dev_name, PDE(inode)->data); |
1704 | }; | 1704 | }; |
1705 | 1705 | ||
1706 | static struct file_operations i2o_seq_fops_lct = { | 1706 | static const struct file_operations i2o_seq_fops_lct = { |
1707 | .open = i2o_seq_open_lct, | 1707 | .open = i2o_seq_open_lct, |
1708 | .read = seq_read, | 1708 | .read = seq_read, |
1709 | .llseek = seq_lseek, | 1709 | .llseek = seq_lseek, |
1710 | .release = single_release, | 1710 | .release = single_release, |
1711 | }; | 1711 | }; |
1712 | 1712 | ||
1713 | static struct file_operations i2o_seq_fops_hrt = { | 1713 | static const struct file_operations i2o_seq_fops_hrt = { |
1714 | .open = i2o_seq_open_hrt, | 1714 | .open = i2o_seq_open_hrt, |
1715 | .read = seq_read, | 1715 | .read = seq_read, |
1716 | .llseek = seq_lseek, | 1716 | .llseek = seq_lseek, |
1717 | .release = single_release, | 1717 | .release = single_release, |
1718 | }; | 1718 | }; |
1719 | 1719 | ||
1720 | static struct file_operations i2o_seq_fops_status = { | 1720 | static const struct file_operations i2o_seq_fops_status = { |
1721 | .open = i2o_seq_open_status, | 1721 | .open = i2o_seq_open_status, |
1722 | .read = seq_read, | 1722 | .read = seq_read, |
1723 | .llseek = seq_lseek, | 1723 | .llseek = seq_lseek, |
1724 | .release = single_release, | 1724 | .release = single_release, |
1725 | }; | 1725 | }; |
1726 | 1726 | ||
1727 | static struct file_operations i2o_seq_fops_hw = { | 1727 | static const struct file_operations i2o_seq_fops_hw = { |
1728 | .open = i2o_seq_open_hw, | 1728 | .open = i2o_seq_open_hw, |
1729 | .read = seq_read, | 1729 | .read = seq_read, |
1730 | .llseek = seq_lseek, | 1730 | .llseek = seq_lseek, |
1731 | .release = single_release, | 1731 | .release = single_release, |
1732 | }; | 1732 | }; |
1733 | 1733 | ||
1734 | static struct file_operations i2o_seq_fops_ddm_table = { | 1734 | static const struct file_operations i2o_seq_fops_ddm_table = { |
1735 | .open = i2o_seq_open_ddm_table, | 1735 | .open = i2o_seq_open_ddm_table, |
1736 | .read = seq_read, | 1736 | .read = seq_read, |
1737 | .llseek = seq_lseek, | 1737 | .llseek = seq_lseek, |
1738 | .release = single_release, | 1738 | .release = single_release, |
1739 | }; | 1739 | }; |
1740 | 1740 | ||
1741 | static struct file_operations i2o_seq_fops_driver_store = { | 1741 | static const struct file_operations i2o_seq_fops_driver_store = { |
1742 | .open = i2o_seq_open_driver_store, | 1742 | .open = i2o_seq_open_driver_store, |
1743 | .read = seq_read, | 1743 | .read = seq_read, |
1744 | .llseek = seq_lseek, | 1744 | .llseek = seq_lseek, |
1745 | .release = single_release, | 1745 | .release = single_release, |
1746 | }; | 1746 | }; |
1747 | 1747 | ||
1748 | static struct file_operations i2o_seq_fops_drivers_stored = { | 1748 | static const struct file_operations i2o_seq_fops_drivers_stored = { |
1749 | .open = i2o_seq_open_drivers_stored, | 1749 | .open = i2o_seq_open_drivers_stored, |
1750 | .read = seq_read, | 1750 | .read = seq_read, |
1751 | .llseek = seq_lseek, | 1751 | .llseek = seq_lseek, |
1752 | .release = single_release, | 1752 | .release = single_release, |
1753 | }; | 1753 | }; |
1754 | 1754 | ||
1755 | static struct file_operations i2o_seq_fops_groups = { | 1755 | static const struct file_operations i2o_seq_fops_groups = { |
1756 | .open = i2o_seq_open_groups, | 1756 | .open = i2o_seq_open_groups, |
1757 | .read = seq_read, | 1757 | .read = seq_read, |
1758 | .llseek = seq_lseek, | 1758 | .llseek = seq_lseek, |
1759 | .release = single_release, | 1759 | .release = single_release, |
1760 | }; | 1760 | }; |
1761 | 1761 | ||
1762 | static struct file_operations i2o_seq_fops_phys_device = { | 1762 | static const struct file_operations i2o_seq_fops_phys_device = { |
1763 | .open = i2o_seq_open_phys_device, | 1763 | .open = i2o_seq_open_phys_device, |
1764 | .read = seq_read, | 1764 | .read = seq_read, |
1765 | .llseek = seq_lseek, | 1765 | .llseek = seq_lseek, |
1766 | .release = single_release, | 1766 | .release = single_release, |
1767 | }; | 1767 | }; |
1768 | 1768 | ||
1769 | static struct file_operations i2o_seq_fops_claimed = { | 1769 | static const struct file_operations i2o_seq_fops_claimed = { |
1770 | .open = i2o_seq_open_claimed, | 1770 | .open = i2o_seq_open_claimed, |
1771 | .read = seq_read, | 1771 | .read = seq_read, |
1772 | .llseek = seq_lseek, | 1772 | .llseek = seq_lseek, |
1773 | .release = single_release, | 1773 | .release = single_release, |
1774 | }; | 1774 | }; |
1775 | 1775 | ||
1776 | static struct file_operations i2o_seq_fops_users = { | 1776 | static const struct file_operations i2o_seq_fops_users = { |
1777 | .open = i2o_seq_open_users, | 1777 | .open = i2o_seq_open_users, |
1778 | .read = seq_read, | 1778 | .read = seq_read, |
1779 | .llseek = seq_lseek, | 1779 | .llseek = seq_lseek, |
1780 | .release = single_release, | 1780 | .release = single_release, |
1781 | }; | 1781 | }; |
1782 | 1782 | ||
1783 | static struct file_operations i2o_seq_fops_priv_msgs = { | 1783 | static const struct file_operations i2o_seq_fops_priv_msgs = { |
1784 | .open = i2o_seq_open_priv_msgs, | 1784 | .open = i2o_seq_open_priv_msgs, |
1785 | .read = seq_read, | 1785 | .read = seq_read, |
1786 | .llseek = seq_lseek, | 1786 | .llseek = seq_lseek, |
1787 | .release = single_release, | 1787 | .release = single_release, |
1788 | }; | 1788 | }; |
1789 | 1789 | ||
1790 | static struct file_operations i2o_seq_fops_authorized_users = { | 1790 | static const struct file_operations i2o_seq_fops_authorized_users = { |
1791 | .open = i2o_seq_open_authorized_users, | 1791 | .open = i2o_seq_open_authorized_users, |
1792 | .read = seq_read, | 1792 | .read = seq_read, |
1793 | .llseek = seq_lseek, | 1793 | .llseek = seq_lseek, |
1794 | .release = single_release, | 1794 | .release = single_release, |
1795 | }; | 1795 | }; |
1796 | 1796 | ||
1797 | static struct file_operations i2o_seq_fops_dev_name = { | 1797 | static const struct file_operations i2o_seq_fops_dev_name = { |
1798 | .open = i2o_seq_open_dev_name, | 1798 | .open = i2o_seq_open_dev_name, |
1799 | .read = seq_read, | 1799 | .read = seq_read, |
1800 | .llseek = seq_lseek, | 1800 | .llseek = seq_lseek, |
1801 | .release = single_release, | 1801 | .release = single_release, |
1802 | }; | 1802 | }; |
1803 | 1803 | ||
1804 | static struct file_operations i2o_seq_fops_dev_identity = { | 1804 | static const struct file_operations i2o_seq_fops_dev_identity = { |
1805 | .open = i2o_seq_open_dev_identity, | 1805 | .open = i2o_seq_open_dev_identity, |
1806 | .read = seq_read, | 1806 | .read = seq_read, |
1807 | .llseek = seq_lseek, | 1807 | .llseek = seq_lseek, |
1808 | .release = single_release, | 1808 | .release = single_release, |
1809 | }; | 1809 | }; |
1810 | 1810 | ||
1811 | static struct file_operations i2o_seq_fops_ddm_identity = { | 1811 | static const struct file_operations i2o_seq_fops_ddm_identity = { |
1812 | .open = i2o_seq_open_ddm_identity, | 1812 | .open = i2o_seq_open_ddm_identity, |
1813 | .read = seq_read, | 1813 | .read = seq_read, |
1814 | .llseek = seq_lseek, | 1814 | .llseek = seq_lseek, |
1815 | .release = single_release, | 1815 | .release = single_release, |
1816 | }; | 1816 | }; |
1817 | 1817 | ||
1818 | static struct file_operations i2o_seq_fops_uinfo = { | 1818 | static const struct file_operations i2o_seq_fops_uinfo = { |
1819 | .open = i2o_seq_open_uinfo, | 1819 | .open = i2o_seq_open_uinfo, |
1820 | .read = seq_read, | 1820 | .read = seq_read, |
1821 | .llseek = seq_lseek, | 1821 | .llseek = seq_lseek, |
1822 | .release = single_release, | 1822 | .release = single_release, |
1823 | }; | 1823 | }; |
1824 | 1824 | ||
1825 | static struct file_operations i2o_seq_fops_sgl_limits = { | 1825 | static const struct file_operations i2o_seq_fops_sgl_limits = { |
1826 | .open = i2o_seq_open_sgl_limits, | 1826 | .open = i2o_seq_open_sgl_limits, |
1827 | .read = seq_read, | 1827 | .read = seq_read, |
1828 | .llseek = seq_lseek, | 1828 | .llseek = seq_lseek, |
1829 | .release = single_release, | 1829 | .release = single_release, |
1830 | }; | 1830 | }; |
1831 | 1831 | ||
1832 | static struct file_operations i2o_seq_fops_sensors = { | 1832 | static const struct file_operations i2o_seq_fops_sensors = { |
1833 | .open = i2o_seq_open_sensors, | 1833 | .open = i2o_seq_open_sensors, |
1834 | .read = seq_read, | 1834 | .read = seq_read, |
1835 | .llseek = seq_lseek, | 1835 | .llseek = seq_lseek, |