linux-i2c.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Wolfram Sang <wsa@kernel.org>
To: "Bence Csókás" <bence98@sch.bme.hu>
Cc: linux-i2c@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v3 2/2] Adding i2c-cp2615: i2c support for Silicon Labs' CP2615 Digital Audio Bridge
Date: Wed, 31 Mar 2021 09:09:13 +0200	[thread overview]
Message-ID: <20210331070913.GA1025@ninjato> (raw)
In-Reply-To: <20210318115210.2014204-3-bence98@sch.bme.hu>

[-- Attachment #1: Type: text/plain, Size: 3234 bytes --]

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@sch.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.


[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

  parent reply	other threads:[~2021-03-31  7:10 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-18 11:52 [PATCH v3 0/2] Add i2c-cp2615 Bence Csókás
2021-03-18 11:52 ` [PATCH v3 1/2] i2c: Add I2C_AQ_NO_REP_START adapter quirk Bence Csókás
2021-03-18 11:52 ` [PATCH v3 2/2] Adding i2c-cp2615: i2c support for Silicon Labs' CP2615 Digital Audio Bridge Bence Csókás
2021-03-20  2:30   ` kernel test robot
2021-03-31  7:09   ` Wolfram Sang [this message]
2021-03-31  9:58   ` Wolfram Sang
2021-03-31 18:17     ` Bence Csókás
2021-03-31 20:55       ` Wolfram Sang

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=20210331070913.GA1025@ninjato \
    --to=wsa@kernel.org \
    --cc=bence98@sch.bme.hu \
    --cc=linux-i2c@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.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).