lists.openwall.net | lists / announce owl-users owl-dev john-users john-dev passwdqc-users yescrypt popa3d-users / oss-security kernel-hardening musl sabotage tlsify passwords / crypt-dev xvendor / Bugtraq Full-Disclosure linux-kernel linux-netdev linux-ext4 linux-hardening PHC | |
Open Source and information security mailing list archives
| ||
|
Date: Thu, 21 Aug 2014 08:40:20 +0000 From: David Laight <David.Laight@...LAB.COM> To: 'Mark Einon' <mark.einon@...il.com>, "gregkh@...uxfoundation.org" <gregkh@...uxfoundation.org> CC: "devel@...verdev.osuosl.org" <devel@...verdev.osuosl.org>, "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>, "netdev@...r.kernel.org" <netdev@...r.kernel.org> Subject: RE: [PATCH 4/8] staging: et131x: Use for loop to initialise contiguous macstat registers to zero From: Mark Einon > Replace a long list of contiguous writel() calls with a for loop iterating > over the same address values. > > Also remove redundant comments on the macstat registers, the variable names > are good enough. ... > - writel(0, &macstat->txrx_0_64_byte_frames); ... > - writel(0, &macstat->carry_reg2); > + /* initialize all the macstat registers to zero on the device */ > + for (reg = &macstat->txrx_0_64_byte_frames; > + reg <= &macstat->carry_reg2; reg++) > + writel(0, reg); ... > struct macstat_regs { /* Location: */ > u32 pad[32]; /* 0x6000 - 607C */ > > - /* Tx/Rx 0-64 Byte Frame Counter */ > + /* counters */ > u32 txrx_0_64_byte_frames; /* 0x6080 */ > - > - /* Tx/Rx 65-127 Byte Frame Counter */ > u32 txrx_65_127_byte_frames; /* 0x6084 */ I think it would be best to also convert the stats counters to an array. David -- To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to majordomo@...r.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists