2020-08-17 03:46:56

by Xu Wang

[permalink] [raw]
Subject: [PATCH] upcall: Remove unneeded variable insize

Remove unneeded variable insize in venus_pioctl().

Signed-off-by: Xu Wang <[email protected]>
---
fs/coda/upcall.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/fs/coda/upcall.c b/fs/coda/upcall.c
index eb3b1898da46..903bd7a4ee16 100644
--- a/fs/coda/upcall.c
+++ b/fs/coda/upcall.c
@@ -477,10 +477,9 @@ int venus_pioctl(struct super_block *sb, struct CodaFid *fid,
{
union inputArgs *inp;
union outputArgs *outp;
- int insize, outsize, error;
+ int outsize, error;
int iocsize;

- insize = VC_MAXMSGSIZE;
UPARG(CODA_IOCTL);

/* build packet for Venus */
--
2.17.1


2020-08-17 05:07:04

by kernel test robot

[permalink] [raw]
Subject: Re: [PATCH] upcall: Remove unneeded variable insize

Hi Xu,

Thank you for the patch! Yet something to improve:

[auto build test ERROR on linus/master]
[also build test ERROR on v5.9-rc1 next-20200814]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]

url: https://github.com/0day-ci/linux/commits/Xu-Wang/upcall-Remove-unneeded-variable-insize/20200817-112244
base: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git 9123e3a74ec7b934a4a099e98af6a61c2f80bbf5
config: xtensa-allyesconfig (attached as .config)
compiler: xtensa-linux-gcc (GCC) 9.3.0
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
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=xtensa

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <[email protected]>

All errors (new ones prefixed by >>):

fs/coda/upcall.c: In function 'venus_setattr':
fs/coda/upcall.c:115:27: warning: variable 'outp' set but not used [-Wunused-but-set-variable]
115 | union outputArgs *outp;
| ^~~~
fs/coda/upcall.c: In function 'venus_close':
fs/coda/upcall.c:164:20: warning: variable 'outp' set but not used [-Wunused-but-set-variable]
164 | union outputArgs *outp;
| ^~~~
fs/coda/upcall.c: In function 'venus_rename':
fs/coda/upcall.c:238:27: warning: variable 'outp' set but not used [-Wunused-but-set-variable]
238 | union outputArgs *outp;
| ^~~~
fs/coda/upcall.c: In function 'venus_rmdir':
fs/coda/upcall.c:306:27: warning: variable 'outp' set but not used [-Wunused-but-set-variable]
306 | union outputArgs *outp;
| ^~~~
fs/coda/upcall.c: In function 'venus_remove':
fs/coda/upcall.c:329:27: warning: variable 'outp' set but not used [-Wunused-but-set-variable]
329 | union outputArgs *outp;
| ^~~~
fs/coda/upcall.c: In function 'venus_link':
fs/coda/upcall.c:383:27: warning: variable 'outp' set but not used [-Wunused-but-set-variable]
383 | union outputArgs *outp;
| ^~~~
fs/coda/upcall.c: In function 'venus_symlink':
fs/coda/upcall.c:410:27: warning: variable 'outp' set but not used [-Wunused-but-set-variable]
410 | union outputArgs *outp;
| ^~~~
fs/coda/upcall.c: In function 'venus_fsync':
fs/coda/upcall.c:443:27: warning: variable 'outp' set but not used [-Wunused-but-set-variable]
443 | union outputArgs *outp;
| ^~~~
fs/coda/upcall.c: In function 'venus_access':
fs/coda/upcall.c:459:27: warning: variable 'outp' set but not used [-Wunused-but-set-variable]
459 | union outputArgs *outp;
| ^~~~
fs/coda/upcall.c: In function 'venus_pioctl':
>> fs/coda/upcall.c:63:44: error: 'insize' undeclared (first use in this function); did you mean 'iocsize'?
63 | inp = (union inputArgs *)alloc_upcall(op, insize); \
| ^~~~~~
fs/coda/upcall.c:483:2: note: in expansion of macro 'UPARG'
483 | UPARG(CODA_IOCTL);
| ^~~~~
fs/coda/upcall.c:63:44: note: each undeclared identifier is reported only once for each function it appears in
63 | inp = (union inputArgs *)alloc_upcall(op, insize); \
| ^~~~~~
fs/coda/upcall.c:483:2: note: in expansion of macro 'UPARG'
483 | UPARG(CODA_IOCTL);
| ^~~~~
fs/coda/upcall.c: In function 'venus_access_intent':
fs/coda/upcall.c:576:20: warning: variable 'outp' set but not used [-Wunused-but-set-variable]
576 | union outputArgs *outp;
| ^~~~

# https://github.com/0day-ci/linux/commit/e126bb2bc1e15e86a4267e92df88f4987d01b358
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Xu-Wang/upcall-Remove-unneeded-variable-insize/20200817-112244
git checkout e126bb2bc1e15e86a4267e92df88f4987d01b358
vim +63 fs/coda/upcall.c

^1da177e4c3f41 Linus Torvalds 2005-04-16 60
^1da177e4c3f41 Linus Torvalds 2005-04-16 61 #define UPARG(op)\
^1da177e4c3f41 Linus Torvalds 2005-04-16 62 do {\
^1da177e4c3f41 Linus Torvalds 2005-04-16 @63 inp = (union inputArgs *)alloc_upcall(op, insize); \
^1da177e4c3f41 Linus Torvalds 2005-04-16 64 if (IS_ERR(inp)) { return PTR_ERR(inp); }\
^1da177e4c3f41 Linus Torvalds 2005-04-16 65 outp = (union outputArgs *)(inp); \
^1da177e4c3f41 Linus Torvalds 2005-04-16 66 outsize = insize; \
^1da177e4c3f41 Linus Torvalds 2005-04-16 67 } while (0)
^1da177e4c3f41 Linus Torvalds 2005-04-16 68

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/[email protected]


Attachments:
(No filename) (5.20 kB)
.config.gz (63.54 kB)
Download all attachments

2020-08-17 06:35:54

by kernel test robot

[permalink] [raw]
Subject: Re: [PATCH] upcall: Remove unneeded variable insize

Hi Xu,

Thank you for the patch! Yet something to improve:

[auto build test ERROR on linus/master]
[also build test ERROR on v5.9-rc1 next-20200817]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]

url: https://github.com/0day-ci/linux/commits/Xu-Wang/upcall-Remove-unneeded-variable-insize/20200817-112244
base: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git 9123e3a74ec7b934a4a099e98af6a61c2f80bbf5
config: x86_64-randconfig-a012-20200817 (attached as .config)
compiler: clang version 12.0.0 (https://github.com/llvm/llvm-project de71b46a519db014ce906a39f8a0e1b235ef1568)
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
# install x86_64 cross compiling tool for clang build
# apt-get install binutils-x86-64-linux-gnu
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=x86_64

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <[email protected]>

All errors (new ones prefixed by >>):

>> fs/coda/upcall.c:483:2: error: use of undeclared identifier 'insize'
UPARG(CODA_IOCTL);
^
fs/coda/upcall.c:63:44: note: expanded from macro 'UPARG'
inp = (union inputArgs *)alloc_upcall(op, insize); \
^
>> fs/coda/upcall.c:483:2: error: use of undeclared identifier 'insize'
fs/coda/upcall.c:66:19: note: expanded from macro 'UPARG'
outsize = insize; \
^
2 errors generated.

# https://github.com/0day-ci/linux/commit/e126bb2bc1e15e86a4267e92df88f4987d01b358
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Xu-Wang/upcall-Remove-unneeded-variable-insize/20200817-112244
git checkout e126bb2bc1e15e86a4267e92df88f4987d01b358
vim +/insize +483 fs/coda/upcall.c

^1da177e4c3f41 Linus Torvalds 2005-04-16 473
^1da177e4c3f41 Linus Torvalds 2005-04-16 474
^1da177e4c3f41 Linus Torvalds 2005-04-16 475 int venus_pioctl(struct super_block *sb, struct CodaFid *fid,
^1da177e4c3f41 Linus Torvalds 2005-04-16 476 unsigned int cmd, struct PioctlData *data)
^1da177e4c3f41 Linus Torvalds 2005-04-16 477 {
^1da177e4c3f41 Linus Torvalds 2005-04-16 478 union inputArgs *inp;
^1da177e4c3f41 Linus Torvalds 2005-04-16 479 union outputArgs *outp;
e126bb2bc1e15e Xu Wang 2020-08-17 480 int outsize, error;
^1da177e4c3f41 Linus Torvalds 2005-04-16 481 int iocsize;
^1da177e4c3f41 Linus Torvalds 2005-04-16 482
^1da177e4c3f41 Linus Torvalds 2005-04-16 @483 UPARG(CODA_IOCTL);
^1da177e4c3f41 Linus Torvalds 2005-04-16 484
^1da177e4c3f41 Linus Torvalds 2005-04-16 485 /* build packet for Venus */
^1da177e4c3f41 Linus Torvalds 2005-04-16 486 if (data->vi.in_size > VC_MAXDATASIZE) {
^1da177e4c3f41 Linus Torvalds 2005-04-16 487 error = -EINVAL;
^1da177e4c3f41 Linus Torvalds 2005-04-16 488 goto exit;
^1da177e4c3f41 Linus Torvalds 2005-04-16 489 }
^1da177e4c3f41 Linus Torvalds 2005-04-16 490
^1da177e4c3f41 Linus Torvalds 2005-04-16 491 if (data->vi.out_size > VC_MAXDATASIZE) {
^1da177e4c3f41 Linus Torvalds 2005-04-16 492 error = -EINVAL;
^1da177e4c3f41 Linus Torvalds 2005-04-16 493 goto exit;
^1da177e4c3f41 Linus Torvalds 2005-04-16 494 }
^1da177e4c3f41 Linus Torvalds 2005-04-16 495
^1da177e4c3f41 Linus Torvalds 2005-04-16 496 inp->coda_ioctl.VFid = *fid;
^1da177e4c3f41 Linus Torvalds 2005-04-16 497
^1da177e4c3f41 Linus Torvalds 2005-04-16 498 /* the cmd field was mutated by increasing its size field to
^1da177e4c3f41 Linus Torvalds 2005-04-16 499 * reflect the path and follow args. We need to subtract that
^1da177e4c3f41 Linus Torvalds 2005-04-16 500 * out before sending the command to Venus. */
^1da177e4c3f41 Linus Torvalds 2005-04-16 501 inp->coda_ioctl.cmd = (cmd & ~(PIOCPARM_MASK << 16));
^1da177e4c3f41 Linus Torvalds 2005-04-16 502 iocsize = ((cmd >> 16) & PIOCPARM_MASK) - sizeof(char *) - sizeof(int);
^1da177e4c3f41 Linus Torvalds 2005-04-16 503 inp->coda_ioctl.cmd |= (iocsize & PIOCPARM_MASK) << 16;
^1da177e4c3f41 Linus Torvalds 2005-04-16 504
^1da177e4c3f41 Linus Torvalds 2005-04-16 505 /* in->coda_ioctl.rwflag = flag; */
^1da177e4c3f41 Linus Torvalds 2005-04-16 506 inp->coda_ioctl.len = data->vi.in_size;
^1da177e4c3f41 Linus Torvalds 2005-04-16 507 inp->coda_ioctl.data = (char *)(INSIZE(ioctl));
^1da177e4c3f41 Linus Torvalds 2005-04-16 508
^1da177e4c3f41 Linus Torvalds 2005-04-16 509 /* get the data out of user space */
^1da177e4c3f41 Linus Torvalds 2005-04-16 510 if (copy_from_user((char *)inp + (long)inp->coda_ioctl.data,
^1da177e4c3f41 Linus Torvalds 2005-04-16 511 data->vi.in, data->vi.in_size)) {
^1da177e4c3f41 Linus Torvalds 2005-04-16 512 error = -EINVAL;
^1da177e4c3f41 Linus Torvalds 2005-04-16 513 goto exit;
^1da177e4c3f41 Linus Torvalds 2005-04-16 514 }
^1da177e4c3f41 Linus Torvalds 2005-04-16 515
a1b0aa87647493 Jan Harkes 2007-07-19 516 error = coda_upcall(coda_vcp(sb), SIZE(ioctl) + data->vi.in_size,
^1da177e4c3f41 Linus Torvalds 2005-04-16 517 &outsize, inp);
^1da177e4c3f41 Linus Torvalds 2005-04-16 518
^1da177e4c3f41 Linus Torvalds 2005-04-16 519 if (error) {
6d6bd94f4d83d7 Fabian Frederick 2014-06-06 520 pr_warn("%s: Venus returns: %d for %s\n",
6d6bd94f4d83d7 Fabian Frederick 2014-06-06 521 __func__, error, coda_f2s(fid));
^1da177e4c3f41 Linus Torvalds 2005-04-16 522 goto exit;
^1da177e4c3f41 Linus Torvalds 2005-04-16 523 }
^1da177e4c3f41 Linus Torvalds 2005-04-16 524
^1da177e4c3f41 Linus Torvalds 2005-04-16 525 if (outsize < (long)outp->coda_ioctl.data + outp->coda_ioctl.len) {
^1da177e4c3f41 Linus Torvalds 2005-04-16 526 error = -EINVAL;
^1da177e4c3f41 Linus Torvalds 2005-04-16 527 goto exit;
^1da177e4c3f41 Linus Torvalds 2005-04-16 528 }
^1da177e4c3f41 Linus Torvalds 2005-04-16 529
^1da177e4c3f41 Linus Torvalds 2005-04-16 530 /* Copy out the OUT buffer. */
^1da177e4c3f41 Linus Torvalds 2005-04-16 531 if (outp->coda_ioctl.len > data->vi.out_size) {
^1da177e4c3f41 Linus Torvalds 2005-04-16 532 error = -EINVAL;
^1da177e4c3f41 Linus Torvalds 2005-04-16 533 goto exit;
^1da177e4c3f41 Linus Torvalds 2005-04-16 534 }
^1da177e4c3f41 Linus Torvalds 2005-04-16 535
^1da177e4c3f41 Linus Torvalds 2005-04-16 536 /* Copy out the OUT buffer. */
^1da177e4c3f41 Linus Torvalds 2005-04-16 537 if (copy_to_user(data->vi.out,
^1da177e4c3f41 Linus Torvalds 2005-04-16 538 (char *)outp + (long)outp->coda_ioctl.data,
^1da177e4c3f41 Linus Torvalds 2005-04-16 539 outp->coda_ioctl.len)) {
^1da177e4c3f41 Linus Torvalds 2005-04-16 540 error = -EFAULT;
^1da177e4c3f41 Linus Torvalds 2005-04-16 541 goto exit;
^1da177e4c3f41 Linus Torvalds 2005-04-16 542 }
^1da177e4c3f41 Linus Torvalds 2005-04-16 543
^1da177e4c3f41 Linus Torvalds 2005-04-16 544 exit:
936dae4525322f Dan Carpenter 2019-07-16 545 kvfree(inp);
^1da177e4c3f41 Linus Torvalds 2005-04-16 546 return error;
^1da177e4c3f41 Linus Torvalds 2005-04-16 547 }
^1da177e4c3f41 Linus Torvalds 2005-04-16 548

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/[email protected]


Attachments:
(No filename) (7.83 kB)
.config.gz (33.34 kB)
Download all attachments