Skip to content

Commit cd09a6a

Browse files
tititiou36kwilczynski
authored andcommitted
PCI: ls-gen4: Make struct mobiveil_rp_ops constant
The struct mobiveil_rp_ops is not modified in this driver. Thus, make this struct constant, which also moves data to a read-only section decreasing object size and also improving overall security. On a x86_64, with allmodconfig, as an example: Before: ====== text data bss dec hex filename 4446 336 32 4814 12ce drivers/pci/controller/mobiveil/pcie-layerscape-gen4.o After: ===== text data bss dec hex filename 4454 328 32 4814 12ce drivers/pci/controller/mobiveil/pcie-layerscape-gen4.o [kwilczynski: commit log] Link: https://lore.kernel.org/linux-pci/189fd881cc8fd80220e74e91820e12cf3a5be114.1719260294.git.christophe.jaillet@wanadoo.fr Signed-off-by: Christophe JAILLET <[email protected]> Signed-off-by: Krzysztof Wilczyński <[email protected]>
1 parent 1613e60 commit cd09a6a

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

drivers/pci/controller/mobiveil/pcie-layerscape-gen4.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ static void ls_g4_pcie_reset(struct work_struct *work)
190190
ls_g4_pcie_enable_interrupt(pcie);
191191
}
192192

193-
static struct mobiveil_rp_ops ls_g4_pcie_rp_ops = {
193+
static const struct mobiveil_rp_ops ls_g4_pcie_rp_ops = {
194194
.interrupt_init = ls_g4_pcie_interrupt_init,
195195
};
196196

drivers/pci/controller/mobiveil/pcie-mobiveil.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ struct mobiveil_rp_ops {
151151
struct mobiveil_root_port {
152152
void __iomem *config_axi_slave_base; /* endpoint config base */
153153
struct resource *ob_io_res;
154-
struct mobiveil_rp_ops *ops;
154+
const struct mobiveil_rp_ops *ops;
155155
int irq;
156156
raw_spinlock_t intx_mask_lock;
157157
struct irq_domain *intx_domain;

0 commit comments

Comments
 (0)