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]
Message-ID: <CAK8P3a1Zt-4goCHWEWcEqwDVwHYp_T=w3rX5pf81Jz_818=Nkw@mail.gmail.com>
Date:   Fri, 22 Oct 2021 09:08:54 +0200
From:   Arnd Bergmann <arnd@...nel.org>
To:     Viresh Kumar <viresh.kumar@...aro.org>
Cc:     Jie Deng <jie.deng@...el.com>, Wolfram Sang <wsa@...nel.org>,
        "Michael S. Tsirkin" <mst@...hat.com>,
        Jason Wang <jasowang@...hat.com>,
        Vincent Guittot <vincent.guittot@...aro.org>,
        Stratos Mailing List <stratos-dev@...lists.linaro.org>,
        Alex Bennée <alex.bennee@...aro.org>,
        Cornelia Huck <cohuck@...hat.com>,
        Vincent Whitchurch <vincent.whitchurch@...s.com>,
        Linux I2C <linux-i2c@...r.kernel.org>,
        "open list:DRM DRIVER FOR QEMU'S CIRRUS DEVICE" 
        <virtualization@...ts.linux-foundation.org>,
        Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
        conghui.chen@...el.com
Subject: Re: [PATCH] i2c: virtio: Add support for zero-length requests

On Fri, Oct 22, 2021 at 8:58 AM Viresh Kumar <viresh.kumar@...aro.org> wrote:
> On 22-10-21, 14:51, Jie Deng wrote:
> > > +   if (!virtio_has_feature(vdev, VIRTIO_I2C_F_ZERO_LENGTH_REQUEST)) {
> > > +           dev_err(&vdev->dev, "Zero-length request feature is mandatory\n");
> > > +           return -EINVAL;
> >
> >
> > It might be better to return -EOPNOTSUPP ?
>
> Maybe that or one of these:
>
> #define EBADE           52      /* Invalid exchange */
> #define EPROTO          71      /* Protocol error */
> #define EPFNOSUPPORT    96      /* Protocol family not supported */
> #define ECONNREFUSED    111     /* Connection refused */
>
> Arnd, any suggestions ? This is about the mandatory feature not being offered by
> the device.

These are mostly used for network operations, I'd stick with either EINVAL
or ENXIO in this case.

        Arnd

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ