From: kernel test robot <lkp@intel.com>
To: Jingyu Wang <jingyuwang_vip@163.com>,
steffen.klassert@secunet.com, herbert@gondor.apana.org.au,
davem@davemloft.net, yoshfuji@linux-ipv6.org, dsahern@kernel.org,
edumazet@google.com, kuba@kernel.org, pabeni@redhat.com
Cc: llvm@lists.linux.dev, kbuild-all@lists.01.org,
netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
Jingyu Wang <jingyuwang_vip@163.com>
Subject: Re: [PATCH] net: ipv4: Fix some coding style in ah4.c file
Date: Thu, 8 Sep 2022 15:41:40 +0800 [thread overview]
Message-ID: <202209081543.BAjUZP1r-lkp@intel.com> (raw)
In-Reply-To: <20220908022118.57973-1-jingyuwang_vip@163.com>
Hi Jingyu,
Thank you for the patch! Yet something to improve:
[auto build test ERROR on 5957ac6635a1a12d4aa2661bbf04d3085a73372a]
url: https://github.com/intel-lab-lkp/linux/commits/Jingyu-Wang/net-ipv4-Fix-some-coding-style-in-ah4-c-file/20220908-102444
base: 5957ac6635a1a12d4aa2661bbf04d3085a73372a
config: i386-randconfig-a015 (https://download.01.org/0day-ci/archive/20220908/202209081543.BAjUZP1r-lkp@intel.com/config)
compiler: clang version 14.0.6 (https://github.com/llvm/llvm-project f28c006a5895fc0e329fe15fead81e37457cb1d1)
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# https://github.com/intel-lab-lkp/linux/commit/603895160512cd6e8f03a032b6523d1b90aa2d7c
git remote add linux-review https://github.com/intel-lab-lkp/linux
git fetch --no-tags linux-review Jingyu-Wang/net-ipv4-Fix-some-coding-style-in-ah4-c-file/20220908-102444
git checkout 603895160512cd6e8f03a032b6523d1b90aa2d7c
# save the config file
mkdir build_dir && cp config build_dir/.config
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=i386 SHELL=/bin/bash net/
If you fix the issue, kindly add following tag where applicable
Reported-by: kernel test robot <lkp@intel.com>
All errors (new ones prefixed by >>):
>> net/ipv4/ah4.c:168:38: error: extraneous ')' before ';'
err = skb_cow_data(skb, 0, &trailer));
^
1 error generated.
vim +168 net/ipv4/ah4.c
146
147 static int ah_output(struct xfrm_state *x, struct sk_buff *skb)
148 {
149 int err;
150 int nfrags;
151 int ihl;
152 u8 *icv;
153 struct sk_buff *trailer;
154 struct crypto_ahash *ahash;
155 struct ahash_request *req;
156 struct scatterlist *sg;
157 struct iphdr *iph, *top_iph;
158 struct ip_auth_hdr *ah;
159 struct ah_data *ahp;
160 int seqhi_len = 0;
161 __be32 *seqhi;
162 int sglists = 0;
163 struct scatterlist *seqhisg;
164
165 ahp = x->data;
166 ahash = ahp->ahash;
167
> 168 err = skb_cow_data(skb, 0, &trailer));
169 if (err < 0)
170 goto out;
171 nfrags = err;
172
173 skb_push(skb, -skb_network_offset(skb));
174 ah = ip_auth_hdr(skb);
175 ihl = ip_hdrlen(skb);
176
177 if (x->props.flags & XFRM_STATE_ESN) {
178 sglists = 1;
179 seqhi_len = sizeof(*seqhi);
180 }
181 err = -ENOMEM;
182 iph = ah_alloc_tmp(ahash, nfrags + sglists, ihl + seqhi_len);
183 if (!iph)
184 goto out;
185 seqhi = (__be32 *)((char *)iph + ihl);
186 icv = ah_tmp_icv(ahash, seqhi, seqhi_len);
187 req = ah_tmp_req(ahash, icv);
188 sg = ah_req_sg(ahash, req);
189 seqhisg = sg + nfrags;
190
191 memset(ah->auth_data, 0, ahp->icv_trunc_len);
192
193 top_iph = ip_hdr(skb);
194
195 iph->tos = top_iph->tos;
196 iph->ttl = top_iph->ttl;
197 iph->frag_off = top_iph->frag_off;
198
199 if (top_iph->ihl != 5) {
200 iph->daddr = top_iph->daddr;
201 memcpy(iph+1, top_iph+1, top_iph->ihl*4 - sizeof(struct iphdr));
202 err = ip_clear_mutable_options(top_iph, &top_iph->daddr);
203 if (err)
204 goto out_free;
205 }
206
207 ah->nexthdr = *skb_mac_header(skb);
208 *skb_mac_header(skb) = IPPROTO_AH;
209
210 top_iph->tos = 0;
211 top_iph->tot_len = htons(skb->len);
212 top_iph->frag_off = 0;
213 top_iph->ttl = 0;
214 top_iph->check = 0;
215
216 if (x->props.flags & XFRM_STATE_ALIGN4)
217 ah->hdrlen = (XFRM_ALIGN4(sizeof(*ah) + ahp->icv_trunc_len) >> 2) - 2;
218 else
219 ah->hdrlen = (XFRM_ALIGN8(sizeof(*ah) + ahp->icv_trunc_len) >> 2) - 2;
220
221 ah->reserved = 0;
222 ah->spi = x->id.spi;
223 ah->seq_no = htonl(XFRM_SKB_CB(skb)->seq.output.low);
224
225 sg_init_table(sg, nfrags + sglists);
226 err = skb_to_sgvec_nomark(skb, sg, 0, skb->len);
227 if (unlikely(err < 0))
228 goto out_free;
229
230 if (x->props.flags & XFRM_STATE_ESN) {
231 /* Attach seqhi sg right after packet payload */
232 *seqhi = htonl(XFRM_SKB_CB(skb)->seq.output.hi);
233 sg_set_buf(seqhisg, seqhi, seqhi_len);
234 }
235 ahash_request_set_crypt(req, sg, icv, skb->len + seqhi_len);
236 ahash_request_set_callback(req, 0, ah_output_done, skb);
237
238 AH_SKB_CB(skb)->tmp = iph;
239
240 err = crypto_ahash_digest(req);
241 if (err) {
242 if (err == -EINPROGRESS)
243 goto out;
244
245 if (err == -ENOSPC)
246 err = NET_XMIT_DROP;
247 goto out_free;
248 }
249
250 memcpy(ah->auth_data, icv, ahp->icv_trunc_len);
251
252 top_iph->tos = iph->tos;
253 top_iph->ttl = iph->ttl;
254 top_iph->frag_off = iph->frag_off;
255 if (top_iph->ihl != 5) {
256 top_iph->daddr = iph->daddr;
257 memcpy(top_iph+1, iph+1, top_iph->ihl*4 - sizeof(struct iphdr));
258 }
259
260 out_free:
261 kfree(iph);
262 out:
263 return err;
264 }
265
--
0-DAY CI Kernel Test Service
https://01.org/lkp
next prev parent reply other threads:[~2022-09-08 7:42 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-09-08 2:21 [PATCH] net: ipv4: Fix some coding style in ah4.c file Jingyu Wang
2022-09-08 6:45 ` kernel test robot
2022-09-08 7:41 ` kernel test robot [this message]
2022-09-08 20:25 ` Andrew Lunn
-- strict thread matches above, loose matches on Subject: below --
2022-09-08 11:12 Jingyu Wang
2022-09-08 20:34 ` Andrew Lunn
2022-09-19 19:16 ` Jakub Kicinski
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=202209081543.BAjUZP1r-lkp@intel.com \
--to=lkp@intel.com \
--cc=davem@davemloft.net \
--cc=dsahern@kernel.org \
--cc=edumazet@google.com \
--cc=herbert@gondor.apana.org.au \
--cc=jingyuwang_vip@163.com \
--cc=kbuild-all@lists.01.org \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=llvm@lists.linux.dev \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=steffen.klassert@secunet.com \
--cc=yoshfuji@linux-ipv6.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).