* [PATCH v2] staging: octeon: fix line over 80 characters
@ 2017-07-26 16:40 catalinnow
2017-07-29 9:30 ` kbuild test robot
2017-07-30 14:59 ` Greg KH
0 siblings, 2 replies; 3+ messages in thread
From: catalinnow @ 2017-07-26 16:40 UTC (permalink / raw)
To: gregkh, aaro.koskinen, davem, johannes.berg, stephen, tklauser,
chuckleberryfinn, arnd
Cc: catalinnow, devel, linux-kernel
From: John Smith <catalinnow@gmail.com>
ethernet-rx.c:
fix WARNING: line over 80 characters
The code was restructured a bit, a helper function
was added to cvm_oct_poll.
Signed-off-by: John Smith <catalinnow@gmail.com>
---
Changes since version 1:
- added copy_segments_to_skb helper function
- compiled ok on yocto/edgerouter
drivers/staging/octeon/ethernet-rx.c | 78 ++++++++++++++++++------------------
1 file changed, 40 insertions(+), 38 deletions(-)
diff --git a/drivers/staging/octeon/ethernet-rx.c b/drivers/staging/octeon/ethernet-rx.c
index 72baede..7315c81 100644
--- a/drivers/staging/octeon/ethernet-rx.c
+++ b/drivers/staging/octeon/ethernet-rx.c
@@ -149,6 +149,45 @@ static inline int cvm_oct_check_rcv_error(cvmx_wqe_t *work)
return 0;
}
+static void copy_segments_to_skb(cvmx_wqe_t *work, struct sk_buff *skb)
+{
+ int segments = work->word2.s.bufs;
+ union cvmx_buf_ptr segment_ptr = work->packet_ptr;
+ int len = work->word1.len;
+
+ while (segments--) {
+ union cvmx_buf_ptr next_ptr;
+
+ next_ptr = *(union cvmx_buf_ptr *)
+ cvmx_phys_to_ptr(segment_ptr.s.addr - 8);
+
+ /*
+ * Octeon Errata PKI-100: The segment size is wrong.
+ *
+ * Until it is fixed, calculate the segment size based on
+ * the packet pool buffer size.
+ * When it is fixed, the following line should be replaced
+ * with this one:
+ * int segment_size = segment_ptr.s.size;
+ */
+ int segment_size =
+ CVMX_FPA_PACKET_POOL_SIZE -
+ (segment_ptr.s.addr -
+ (((segment_ptr.s.addr >> 7) -
+ segment_ptr.s.back) << 7));
+
+ /* Don't copy more than what is left in the packet */
+ if (segment_size > len)
+ segment_size = len;
+
+ /* Copy the data into the packet */
+ skb_put_data(skb, cvmx_phys_to_ptr(segment_ptr.s.addr),
+ segment_size);
+ len -= segment_size;
+ segment_ptr = next_ptr;
+ }
+}
+
static int cvm_oct_poll(struct oct_rx_group *rx_group, int budget)
{
const int coreid = cvmx_get_core_num();
@@ -290,44 +329,7 @@ static int cvm_oct_poll(struct oct_rx_group *rx_group, int budget)
skb_put_data(skb, ptr, work->word1.len);
/* No packet buffers to free */
} else {
- int segments = work->word2.s.bufs;
- union cvmx_buf_ptr segment_ptr =
- work->packet_ptr;
- int len = work->word1.len;
-
- while (segments--) {
- union cvmx_buf_ptr next_ptr =
- *(union cvmx_buf_ptr *)
- cvmx_phys_to_ptr(
- segment_ptr.s.addr - 8);
-
- /*
- * Octeon Errata PKI-100: The segment size is
- * wrong. Until it is fixed, calculate the
- * segment size based on the packet pool
- * buffer size. When it is fixed, the
- * following line should be replaced with this
- * one: int segment_size =
- * segment_ptr.s.size;
- */
- int segment_size =
- CVMX_FPA_PACKET_POOL_SIZE -
- (segment_ptr.s.addr -
- (((segment_ptr.s.addr >> 7) -
- segment_ptr.s.back) << 7));
- /*
- * Don't copy more than what
- * is left in the packet.
- */
- if (segment_size > len)
- segment_size = len;
- /* Copy the data into the packet */
- skb_put_data(skb,
- cvmx_phys_to_ptr(segment_ptr.s.addr),
- segment_size);
- len -= segment_size;
- segment_ptr = next_ptr;
- }
+ copy_segments_to_skb(work, skb);
}
packet_not_copied = 0;
}
--
2.7.4
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH v2] staging: octeon: fix line over 80 characters
2017-07-26 16:40 [PATCH v2] staging: octeon: fix line over 80 characters catalinnow
@ 2017-07-29 9:30 ` kbuild test robot
2017-07-30 14:59 ` Greg KH
1 sibling, 0 replies; 3+ messages in thread
From: kbuild test robot @ 2017-07-29 9:30 UTC (permalink / raw)
To: catalinnow
Cc: kbuild-all, gregkh, aaro.koskinen, davem, johannes.berg, stephen,
tklauser, chuckleberryfinn, arnd, catalinnow, devel,
linux-kernel
[-- Attachment #1: Type: text/plain, Size: 2529 bytes --]
Hi John,
[auto build test WARNING on staging/staging-testing]
[also build test WARNING on v4.13-rc2 next-20170728]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]
url: https://github.com/0day-ci/linux/commits/catalinnow-gmail-com/staging-octeon-fix-line-over-80-characters/20170728-071556
config: mips-cavium_octeon_defconfig (attached as .config)
compiler: mips64-linux-gnuabi64-gcc (Debian 6.1.1-9) 6.1.1 20160705
reproduce:
wget https://raw.githubusercontent.com/01org/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# save the attached .config to linux build tree
make.cross ARCH=mips
All warnings (new ones prefixed by >>):
drivers/staging/octeon/ethernet-rx.c: In function 'copy_segments_to_skb':
>> drivers/staging/octeon/ethernet-rx.c:173:3: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement]
int segment_size =
^~~
vim +173 drivers/staging/octeon/ethernet-rx.c
151
152 static void copy_segments_to_skb(cvmx_wqe_t *work, struct sk_buff *skb)
153 {
154 int segments = work->word2.s.bufs;
155 union cvmx_buf_ptr segment_ptr = work->packet_ptr;
156 int len = work->word1.len;
157
158 while (segments--) {
159 union cvmx_buf_ptr next_ptr;
160
161 next_ptr = *(union cvmx_buf_ptr *)
162 cvmx_phys_to_ptr(segment_ptr.s.addr - 8);
163
164 /*
165 * Octeon Errata PKI-100: The segment size is wrong.
166 *
167 * Until it is fixed, calculate the segment size based on
168 * the packet pool buffer size.
169 * When it is fixed, the following line should be replaced
170 * with this one:
171 * int segment_size = segment_ptr.s.size;
172 */
> 173 int segment_size =
174 CVMX_FPA_PACKET_POOL_SIZE -
175 (segment_ptr.s.addr -
176 (((segment_ptr.s.addr >> 7) -
177 segment_ptr.s.back) << 7));
178
179 /* Don't copy more than what is left in the packet */
180 if (segment_size > len)
181 segment_size = len;
182
183 /* Copy the data into the packet */
184 skb_put_data(skb, cvmx_phys_to_ptr(segment_ptr.s.addr),
185 segment_size);
186 len -= segment_size;
187 segment_ptr = next_ptr;
188 }
189 }
190
---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation
[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 16480 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH v2] staging: octeon: fix line over 80 characters
2017-07-26 16:40 [PATCH v2] staging: octeon: fix line over 80 characters catalinnow
2017-07-29 9:30 ` kbuild test robot
@ 2017-07-30 14:59 ` Greg KH
1 sibling, 0 replies; 3+ messages in thread
From: Greg KH @ 2017-07-30 14:59 UTC (permalink / raw)
To: catalinnow
Cc: aaro.koskinen, davem, johannes.berg, stephen, tklauser,
chuckleberryfinn, arnd, devel, linux-kernel
On Wed, Jul 26, 2017 at 07:40:39PM +0300, catalinnow@gmail.com wrote:
> From: John Smith <catalinnow@gmail.com>
>
> ethernet-rx.c:
>
> fix WARNING: line over 80 characters
>
> The code was restructured a bit, a helper function
> was added to cvm_oct_poll.
>
> Signed-off-by: John Smith <catalinnow@gmail.com>
> ---
> Changes since version 1:
> - added copy_segments_to_skb helper function
> - compiled ok on yocto/edgerouter
Never add build warnings, that is a sign something is wrong with the
patch :(
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2017-07-30 17:07 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-07-26 16:40 [PATCH v2] staging: octeon: fix line over 80 characters catalinnow
2017-07-29 9:30 ` kbuild test robot
2017-07-30 14:59 ` Greg KH
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.