All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Michael S. Tsirkin" <mst@redhat.com>
To: Gerd Hoffmann <kraxel@redhat.com>
Cc: virtio-dev@lists.oasis-open.org,
	Dmitry Torokhov <dmitry.torokhov@gmail.com>,
	"open list:ABI/API" <linux-api@vger.kernel.org>,
	open list <linux-kernel@vger.kernel.org>,
	virtualization@lists.linux-foundation.org,
	David Herrmann <dh.herrmann@gmail.com>
Subject: Re: [PATCH v3] Add virtio-input driver.
Date: Tue, 24 Mar 2015 11:48:02 +0100	[thread overview]
Message-ID: <20150324114254-mutt-send-email-mst@redhat.com> (raw)
In-Reply-To: <1427192810.18768.4.camel@nilsson.home.kraxel.org>

On Tue, Mar 24, 2015 at 11:26:50AM +0100, Gerd Hoffmann wrote:
>   Hi,
> 
> > +static void virtinput_cfg_abs(struct virtio_input *vi, int abs)
> > +{
> > +	u32 mi, ma, re, fu, fl;
> > +
> > +	virtinput_cfg_select(vi, VIRTIO_INPUT_CFG_ABS_INFO, abs);
> > +	virtio_cread(vi->vdev, struct virtio_input_config, u.abs.min, &mi);
> > +	virtio_cread(vi->vdev, struct virtio_input_config, u.abs.max, &ma);
> > +	virtio_cread(vi->vdev, struct virtio_input_config, u.abs.res, &re);
> > +	virtio_cread(vi->vdev, struct virtio_input_config, u.abs.fuzz, &fu);
> > +	virtio_cread(vi->vdev, struct virtio_input_config, u.abs.flat, &fl);
> > +	input_set_abs_params(vi->idev, abs, mi, ma, fu, fl);
> > +	input_abs_set_res(vi->idev, abs, re);
> > +}
> 
> > +struct virtio_input_absinfo {
> > +	__virtio32  min;
> > +	__virtio32  max;
> > +	__virtio32  fuzz;
> > +	__virtio32  flat;
> > +	__virtio32  res;
> > +};
> 
> Damn, had sparse disabled for the test builds.  [ Too bad there are way
> too many warnings on a full kernel build so having sparse enabled all
> the time doesn't fly. ]
> 
> So this doesn't work either.
> 
> Hmm, back to using "u32" in the virtio config structs?
> 
> cheers,
>   Gerd
> 

You are right, I was confused. Currently everyone uses simple
__u32 and friends in config structs, under the understanding
that they are always accessed using virtio_cread and friends.

Maybe I'll look into adding more type safety, but the
issue is not virtio-input specific so, let's not
defer virtio input because of this.

Sorry about wasting your time on this.

-- 
MST

WARNING: multiple messages have this Message-ID (diff)
From: "Michael S. Tsirkin" <mst@redhat.com>
To: Gerd Hoffmann <kraxel@redhat.com>
Cc: virtio-dev@lists.oasis-open.org,
	virtualization@lists.linux-foundation.org,
	David Herrmann <dh.herrmann@gmail.com>,
	Dmitry Torokhov <dmitry.torokhov@gmail.com>,
	Rusty Russell <rusty@rustcorp.com.au>,
	open list <linux-kernel@vger.kernel.org>,
	"open list:ABI/API" <linux-api@vger.kernel.org>
Subject: Re: [PATCH v3] Add virtio-input driver.
Date: Tue, 24 Mar 2015 11:48:02 +0100	[thread overview]
Message-ID: <20150324114254-mutt-send-email-mst@redhat.com> (raw)
In-Reply-To: <1427192810.18768.4.camel@nilsson.home.kraxel.org>

On Tue, Mar 24, 2015 at 11:26:50AM +0100, Gerd Hoffmann wrote:
>   Hi,
> 
> > +static void virtinput_cfg_abs(struct virtio_input *vi, int abs)
> > +{
> > +	u32 mi, ma, re, fu, fl;
> > +
> > +	virtinput_cfg_select(vi, VIRTIO_INPUT_CFG_ABS_INFO, abs);
> > +	virtio_cread(vi->vdev, struct virtio_input_config, u.abs.min, &mi);
> > +	virtio_cread(vi->vdev, struct virtio_input_config, u.abs.max, &ma);
> > +	virtio_cread(vi->vdev, struct virtio_input_config, u.abs.res, &re);
> > +	virtio_cread(vi->vdev, struct virtio_input_config, u.abs.fuzz, &fu);
> > +	virtio_cread(vi->vdev, struct virtio_input_config, u.abs.flat, &fl);
> > +	input_set_abs_params(vi->idev, abs, mi, ma, fu, fl);
> > +	input_abs_set_res(vi->idev, abs, re);
> > +}
> 
> > +struct virtio_input_absinfo {
> > +	__virtio32  min;
> > +	__virtio32  max;
> > +	__virtio32  fuzz;
> > +	__virtio32  flat;
> > +	__virtio32  res;
> > +};
> 
> Damn, had sparse disabled for the test builds.  [ Too bad there are way
> too many warnings on a full kernel build so having sparse enabled all
> the time doesn't fly. ]
> 
> So this doesn't work either.
> 
> Hmm, back to using "u32" in the virtio config structs?
> 
> cheers,
>   Gerd
> 

You are right, I was confused. Currently everyone uses simple
__u32 and friends in config structs, under the understanding
that they are always accessed using virtio_cread and friends.

Maybe I'll look into adding more type safety, but the
issue is not virtio-input specific so, let's not
defer virtio input because of this.

Sorry about wasting your time on this.

-- 
MST

  parent reply	other threads:[~2015-03-24 10:48 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-24  7:32 [PATCH v3] Add virtio-input driver Gerd Hoffmann
2015-03-24  7:32 ` Gerd Hoffmann
2015-03-24 10:26 ` Gerd Hoffmann
     [not found] ` <1427182321-19451-1-git-send-email-kraxel-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2015-03-24 10:26   ` Gerd Hoffmann
2015-03-24 10:26     ` Gerd Hoffmann
2015-03-24 10:40     ` Michael S. Tsirkin
2015-03-24 10:40     ` Michael S. Tsirkin
2015-03-24 10:48     ` Michael S. Tsirkin [this message]
2015-03-24 10:48       ` Michael S. Tsirkin
2015-03-24 10:36 ` Michael S. Tsirkin
2015-03-24 11:46   ` [virtio-dev] " Gerd Hoffmann
2015-03-24 11:46   ` Gerd Hoffmann
2015-03-24 13:02     ` Michael S. Tsirkin
2015-03-24 13:02       ` Michael S. Tsirkin
     [not found]       ` <20150324135908-mutt-send-email-mst-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2015-03-24 13:37         ` Gerd Hoffmann
2015-03-24 13:37           ` Gerd Hoffmann
2015-03-24 14:14           ` Michael S. Tsirkin
2015-03-24 14:14           ` Michael S. Tsirkin
2015-03-24 15:25             ` Gerd Hoffmann
2015-03-24 15:25               ` Gerd Hoffmann
2015-03-24 16:05               ` Dmitry Torokhov
2015-03-24 16:05                 ` Dmitry Torokhov
2015-03-24 13:37       ` Gerd Hoffmann
2015-03-24 16:23   ` Dmitry Torokhov
2015-03-24 16:23     ` Dmitry Torokhov
2015-03-24 17:22     ` Michael S. Tsirkin
2015-03-24 17:22       ` Michael S. Tsirkin
2015-03-24 17:28       ` Dmitry Torokhov
2015-03-24 17:28         ` Dmitry Torokhov
2015-03-25  5:36         ` Michael S. Tsirkin
2015-03-25  5:36         ` Michael S. Tsirkin
2015-03-24 10:36 ` Michael S. Tsirkin
  -- strict thread matches above, loose matches on Subject: below --
2015-03-24  7:32 Gerd Hoffmann

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=20150324114254-mutt-send-email-mst@redhat.com \
    --to=mst@redhat.com \
    --cc=dh.herrmann@gmail.com \
    --cc=dmitry.torokhov@gmail.com \
    --cc=kraxel@redhat.com \
    --cc=linux-api@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=virtio-dev@lists.oasis-open.org \
    --cc=virtualization@lists.linux-foundation.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.