Linux I2C development
 help / color / mirror / Atom feed
From: Wolfram Sang <wsa@the-dreams.de>
To: Yi Zeng <yizeng@asrmicro.com>
Cc: linux-i2c@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] i2c: dev: prevent adapter retries and timeout being set as minus value
Date: Tue, 8 Jan 2019 20:37:39 +0100	[thread overview]
Message-ID: <20190108193739.owmxiosvgtl3nufk@ninjato> (raw)
In-Reply-To: <1546864661-19407-1-git-send-email-yizeng@asrmicro.com>

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

On Mon, Jan 07, 2019 at 08:37:41PM +0800, Yi Zeng wrote:
> If set adapter->retries to minus value from user space via ioctl,
> will make __i2c_transfer and __i2c_smbus_xfer jump the calling to
> adapter->algo->master_xfer and adapter->algo->smbus_xfer that
> registered by the underlying bus drivers, and return value 0 to
> all the callers. The bus driver will never be accessed anymore by
> all users, besides, the users may still get successful return value
> without any error or information log print out.
> 
> If set adapter->timeout to minus value from user space via ioctl,
> will make the retrying loop in __i2c_transfer and __i2c_smbus_xfer
> always break after the the first try, due to the time_after always
> returns true.
> 
> Signed-off-by: Yi Zeng <yizeng@asrmicro.com>

Please run checkpatch.pl on your patch. It found two issues:

ERROR: code indent should use tabs where possible
#34: FILE: drivers/i2c/i2c-dev.c:480:
+                        return -EINVAL;$

WARNING: please, no spaces at the start of a line
#34: FILE: drivers/i2c/i2c-dev.c:480:
+                        return -EINVAL;$


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

      reply	other threads:[~2019-01-08 19:37 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-01-07 12:37 [PATCH] i2c: dev: prevent adapter retries and timeout being set as minus value Yi Zeng
2019-01-08 19:37 ` Wolfram Sang [this message]

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=20190108193739.owmxiosvgtl3nufk@ninjato \
    --to=wsa@the-dreams.de \
    --cc=linux-i2c@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=yizeng@asrmicro.com \
    /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