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  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Wed, 31 Mar 2021 09:09:13 +0200
From:   Wolfram Sang <wsa@...nel.org>
To:     Bence Csókás <bence98@....bme.hu>
Cc:     linux-i2c@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v3 2/2] Adding i2c-cp2615: i2c support for Silicon Labs'
 CP2615 Digital Audio Bridge

On Thu, Mar 18, 2021 at 11:52:10AM +0000, Bence Csókás wrote:
> Create an i2c_adapter for CP2615's I2C master interface by
> implementing parts of the CP2615's I/O Protocol (IOP)
> 
> Signed-off-by: Bence Csókás <bence98@....bme.hu>

So, my code checkers report:

    SPARSE
drivers/i2c/busses/i2c-cp2615.c:88:21: warning: incorrect type in assignment (different base types)
drivers/i2c/busses/i2c-cp2615.c:88:21:    expected unsigned short [usertype] length
drivers/i2c/busses/i2c-cp2615.c:88:21:    got restricted __be16 [usertype]
drivers/i2c/busses/i2c-cp2615.c:89:18: warning: incorrect type in assignment (different base types)
drivers/i2c/busses/i2c-cp2615.c:89:18:    expected unsigned short [usertype] msg
drivers/i2c/busses/i2c-cp2615.c:89:18:    got restricted __be16 [usertype]
drivers/i2c/busses/i2c-cp2615.c:78:5: warning: symbol 'cp2615_init_iop_msg' was not declared. Should it be static?
drivers/i2c/busses/i2c-cp2615.c:96:5: warning: symbol 'cp2615_init_i2c_msg' was not declared. Should it be static?
drivers/i2c/busses/i2c-cp2615.c:102:5: warning: symbol 'cp2615_check_status' was not declared. Should it be static?
drivers/i2c/busses/i2c-cp2615.c:131:41: warning: cast to restricted __be16
drivers/i2c/busses/i2c-cp2615.c:131:41: warning: cast to restricted __be16
drivers/i2c/busses/i2c-cp2615.c:131:41: warning: cast to restricted __be16
drivers/i2c/busses/i2c-cp2615.c:131:41: warning: cast to restricted __be16
drivers/i2c/busses/i2c-cp2615.c:148:25: warning: restricted __be16 degrades to integer
drivers/i2c/busses/i2c-cp2615.c:212:27: warning: symbol 'cp2615_i2c_quirks' was not declared. Should it be static?
    CPPCHECK
drivers/i2c/busses/i2c-cp2615.c:258:9: warning: Identical condition and return expression 'ret', return value is always 0 [identicalConditionAfterEarlyExit]
 return ret;
        ^
  CC      drivers/i2c/busses/i2c-cp2615.o
drivers/i2c/busses/i2c-cp2615.c:78:5: warning: no previous prototype for ‘cp2615_init_iop_msg’ [-Wmissing-prototypes]
   78 | int cp2615_init_iop_msg(struct cp2615_iop_msg *ret, enum cp2615_iop_msg_type msg,
      |     ^~~~~~~~~~~~~~~~~~~
drivers/i2c/busses/i2c-cp2615.c:96:5: warning: no previous prototype for ‘cp2615_init_i2c_msg’ [-Wmissing-prototypes]
   96 | int cp2615_init_i2c_msg(struct cp2615_iop_msg *ret, const struct cp2615_i2c_transfer *data)
      |     ^~~~~~~~~~~~~~~~~~~
drivers/i2c/busses/i2c-cp2615.c:102:5: warning: no previous prototype for ‘cp2615_check_status’ [-Wmissing-prototypes]
  102 | int cp2615_check_status(enum cp2615_i2c_status status)
      |     ^~~~~~~~~~~~~~~~~~~
drivers/i2c/busses/i2c-cp2615.c: In function ‘cp2615_i2c_probe’:
drivers/i2c/busses/i2c-cp2615.c:244:2: warning: ‘strncpy’ specified bound 48 equals destination size [-Wstringop-truncation]
  244 |  strncpy(adap->name, usbdev->serial, sizeof(adap->name));
      |  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

The missing 'static' are what buildbot also reported and are correct.
Please check the others if they need action. Especially the strncpy
thing.

Other than that, it looks good. I like that you bind to the IOP
interface only. Keeping the CamelCase is also OK.


Download attachment "signature.asc" of type "application/pgp-signature" (834 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ