Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 215faf9c authored by Joe Perches's avatar Joe Perches
Browse files

drivers/net/*/: Use static const



Using static const generally increases object text and decreases data size.
It also generally decreases overall object size.

Signed-off-by: default avatarJoe Perches <joe@perches.com>
parent 75a84eb5
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -549,7 +549,9 @@ be_test_ddr_dma(struct be_adapter *adapter)
{
	int ret, i;
	struct be_dma_mem ddrdma_cmd;
	u64 pattern[2] = {0x5a5a5a5a5a5a5a5aULL, 0xa5a5a5a5a5a5a5a5ULL};
	static const u64 pattern[2] = {
		0x5a5a5a5a5a5a5a5aULL, 0xa5a5a5a5a5a5a5a5ULL
	};

	ddrdma_cmd.size = sizeof(struct be_cmd_req_ddrdma_test);
	ddrdma_cmd.va = pci_alloc_consistent(adapter->pdev, ddrdma_cmd.size,
+5 −5
Original line number Diff line number Diff line
@@ -2398,10 +2398,10 @@ static int be_flash_data(struct be_adapter *adapter,
	int num_bytes;
	const u8 *p = fw->data;
	struct be_cmd_write_flashrom *req = flash_cmd->va;
	struct flash_comp *pflashcomp;
	const struct flash_comp *pflashcomp;
	int num_comp;

	struct flash_comp gen3_flash_types[9] = {
	static const struct flash_comp gen3_flash_types[9] = {
		{ FLASH_iSCSI_PRIMARY_IMAGE_START_g3, IMG_TYPE_ISCSI_ACTIVE,
			FLASH_IMAGE_MAX_SIZE_g3},
		{ FLASH_REDBOOT_START_g3, IMG_TYPE_REDBOOT,
@@ -2421,7 +2421,7 @@ static int be_flash_data(struct be_adapter *adapter,
		{ FLASH_NCSI_START_g3, IMG_TYPE_NCSI_FW,
			FLASH_NCSI_IMAGE_MAX_SIZE_g3}
	};
	struct flash_comp gen2_flash_types[8] = {
	static const struct flash_comp gen2_flash_types[8] = {
		{ FLASH_iSCSI_PRIMARY_IMAGE_START_g2, IMG_TYPE_ISCSI_ACTIVE,
			FLASH_IMAGE_MAX_SIZE_g2},
		{ FLASH_REDBOOT_START_g2, IMG_TYPE_REDBOOT,
@@ -2443,11 +2443,11 @@ static int be_flash_data(struct be_adapter *adapter,
	if (adapter->generation == BE_GEN3) {
		pflashcomp = gen3_flash_types;
		filehdr_size = sizeof(struct flash_file_hdr_g3);
		num_comp = 9;
		num_comp = ARRAY_SIZE(gen3_flash_types);
	} else {
		pflashcomp = gen2_flash_types;
		filehdr_size = sizeof(struct flash_file_hdr_g2);
		num_comp = 8;
		num_comp = ARRAY_SIZE(gen2_flash_types);
	}
	for (i = 0; i < num_comp; i++) {
		if ((pflashcomp[i].optype == IMG_TYPE_NCSI_FW) &&
+4 −2
Original line number Diff line number Diff line
@@ -6208,7 +6208,7 @@ static int bnx2x_func_stop(struct bnx2x *bp)
 * @param cam_offset offset in a CAM to use
 * @param is_bcast is the set MAC a broadcast address (for E1 only)
 */
static void bnx2x_set_mac_addr_gen(struct bnx2x *bp, int set, u8 *mac,
static void bnx2x_set_mac_addr_gen(struct bnx2x *bp, int set, const u8 *mac,
				   u32 cl_bit_vec, u8 cam_offset,
				   u8 is_bcast)
{
@@ -6400,7 +6400,9 @@ void bnx2x_set_eth_mac(struct bnx2x *bp, int set)

	if (CHIP_IS_E1(bp)) {
		/* broadcast MAC */
		u8 bcast[ETH_ALEN] = { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff };
		static const u8 bcast[ETH_ALEN] = {
			0xff, 0xff, 0xff, 0xff, 0xff, 0xff
		};
		bnx2x_set_mac_addr_gen(bp, set, bcast, 0, cam_offset + 1, 1);
	}
}
+1 −1
Original line number Diff line number Diff line
@@ -383,7 +383,7 @@ static void plx_pci_reset_marathon(struct pci_dev *pdev)
{
	void __iomem *reset_addr;
	int i;
	int reset_bar[2] = {3, 5};
	static const int reset_bar[2] = {3, 5};

	plx_pci_reset_common(pdev);

+4 −6
Original line number Diff line number Diff line
@@ -273,6 +273,10 @@ struct sge {
	struct cmdQ cmdQ[SGE_CMDQ_N] ____cacheline_aligned_in_smp;
};

static const u8 ch_mac_addr[ETH_ALEN] = {
	0x0, 0x7, 0x43, 0x0, 0x0, 0x0
};

/*
 * stop tasklet and free all pending skb's
 */
@@ -2012,10 +2016,6 @@ static void espibug_workaround_t204(unsigned long data)
				continue;

			if (!skb->cb[0]) {
				u8 ch_mac_addr[ETH_ALEN] = {
					0x0, 0x7, 0x43, 0x0, 0x0, 0x0
				};

				skb_copy_to_linear_data_offset(skb,
						    sizeof(struct cpl_tx_pkt),
							       ch_mac_addr,
@@ -2048,8 +2048,6 @@ static void espibug_workaround(unsigned long data)

	        if ((seop & 0xfff0fff) == 0xfff && skb) {
	                if (!skb->cb[0]) {
	                        u8 ch_mac_addr[ETH_ALEN] =
	                            {0x0, 0x7, 0x43, 0x0, 0x0, 0x0};
	                        skb_copy_to_linear_data_offset(skb,
						     sizeof(struct cpl_tx_pkt),
							       ch_mac_addr,
Loading