<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel/linux.git/samples/vfio-mdev/mtty.c, branch v4.19.302</title>
<subtitle>Linux kernel stable tree (mirror)</subtitle>
<id>https://git.radix-linux.su/kernel/linux.git/atom?h=v4.19.302</id>
<link rel='self' href='https://git.radix-linux.su/kernel/linux.git/atom?h=v4.19.302'/>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/'/>
<updated>2019-12-05T08:20:28+00:00</updated>
<entry>
<title>vfio-mdev/samples: Use u8 instead of char for handle functions</title>
<updated>2019-12-05T08:20:28+00:00</updated>
<author>
<name>Nathan Chancellor</name>
<email>natechancellor@gmail.com</email>
</author>
<published>2018-10-19T18:04:27+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=005874c5170e70c92010a23d766f76f721ae52ba'/>
<id>urn:sha1:005874c5170e70c92010a23d766f76f721ae52ba</id>
<content type='text'>
[ Upstream commit 8ba35b3a0046d6573c98f00461d9bd1b86250d35 ]

Clang warns:

samples/vfio-mdev/mtty.c:592:39: warning: implicit conversion from 'int'
to 'char' changes value from 162 to -94 [-Wconstant-conversion]
                *buf = UART_MSR_DSR | UART_MSR_DDSR | UART_MSR_DCD;
                     ~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~
1 warning generated.

Turns out that all uses of buf in this function ultimately end up stored
or cast to an unsigned type. Just use u8, which has the same number of
bits but can store this larger number so Clang no longer warns.

Signed-off-by: Nathan Chancellor &lt;natechancellor@gmail.com&gt;
Signed-off-by: Alex Williamson &lt;alex.williamson@redhat.com&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>vfio-mdev/samples: change RDI interrupt condition</title>
<updated>2018-03-22T19:18:18+00:00</updated>
<author>
<name>Shunyong Yang</name>
<email>shunyong.yang@hxt-semitech.com</email>
</author>
<published>2018-03-21T18:46:23+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=c9f89c3f87cfc026d88c08054710902dd52a7772'/>
<id>urn:sha1:c9f89c3f87cfc026d88c08054710902dd52a7772</id>
<content type='text'>
When FIFO mode is enabled, the receive data available interrupt
(UART_IIR_RDI in code) should be triggered when the number of data
in FIFO is equal or larger than interrupt trigger level.

This patch changes the trigger level check to ensure multiple bytes
received from upper layer can trigger RDI interrupt correctly.

Cc: Joey Zheng &lt;yu.zheng@hxt-semitech.com&gt;
Signed-off-by: Shunyong Yang &lt;shunyong.yang@hxt-semitech.com&gt;
Reviewed by: Kirti Wankhede &lt;kwankhede@nvidia.com&gt;
Signed-off-by: Alex Williamson &lt;alex.williamson@redhat.com&gt;
</content>
</entry>
<entry>
<title>vfio-mdev/samples: make mdev_fops const and static</title>
<updated>2017-10-02T18:40:05+00:00</updated>
<author>
<name>Bhumika Goyal</name>
<email>bhumirks@gmail.com</email>
</author>
<published>2017-09-30T16:17:24+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=79d40370e8d31886a9413e2ee115fc426b4ae97e'/>
<id>urn:sha1:79d40370e8d31886a9413e2ee115fc426b4ae97e</id>
<content type='text'>
Make this const as it is only passed to a const argument of the function
mdev_register_device. Make it static as it is not referenced in any
other file.

Structure found using Coccinelle and changes done by hand.

Signed-off-by: Bhumika Goyal &lt;bhumirks@gmail.com&gt;
Signed-off-by: Alex Williamson &lt;alex.williamson@redhat.com&gt;
</content>
</entry>
<entry>
<title>vfio-mdev: remove some dead code</title>
<updated>2017-01-11T19:12:37+00:00</updated>
<author>
<name>Dan Carpenter</name>
<email>dan.carpenter@oracle.com</email>
</author>
<published>2017-01-07T06:30:08+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=73da4268fdbae972f617946d1c690f2136964802'/>
<id>urn:sha1:73da4268fdbae972f617946d1c690f2136964802</id>
<content type='text'>
We set info.count to 1 in mtty_get_irq_info() so static checkers
complain that, "Why do we have impossible conditions?"  The answer is
that it seems to be left over dead code that can be safely removed.

Signed-off-by: Dan Carpenter &lt;dan.carpenter@oracle.com&gt;
Reviewed-by: Kirti Wankhede &lt;kwankhede@nvidia.com&gt;
Signed-off-by: Alex Williamson &lt;alex.williamson@redhat.com&gt;
</content>
</entry>
<entry>
<title>vfio-mdev: buffer overflow in ioctl()</title>
<updated>2017-01-11T19:12:29+00:00</updated>
<author>
<name>Dan Carpenter</name>
<email>dan.carpenter@oracle.com</email>
</author>
<published>2017-01-07T06:28:40+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=5c677869e0abbffbade2cfd82d46d0eebe823f34'/>
<id>urn:sha1:5c677869e0abbffbade2cfd82d46d0eebe823f34</id>
<content type='text'>
This is a sample driver for documentation so the impact is probably
pretty low.  But we should check that bar_index is valid so we
don't write beyond the end of the mdev_state-&gt;region_info[] array.

Fixes: 9d1a546c53b4 ("docs: Sample driver to demonstrate how to use Mediated device framework.")
Signed-off-by: Dan Carpenter &lt;dan.carpenter@oracle.com&gt;
Reviewed-by: Kirti Wankhede &lt;kwankhede@nvidia.com&gt;
Signed-off-by: Alex Williamson &lt;alex.williamson@redhat.com&gt;
</content>
</entry>
<entry>
<title>vfio-mdev: return -EFAULT if copy_to_user() fails</title>
<updated>2017-01-11T19:06:35+00:00</updated>
<author>
<name>Dan Carpenter</name>
<email>dan.carpenter@oracle.com</email>
</author>
<published>2017-01-07T06:27:49+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=6ed0993a0b859ce62edf2930ded683e452286d39'/>
<id>urn:sha1:6ed0993a0b859ce62edf2930ded683e452286d39</id>
<content type='text'>
The copy_to_user() function returns the number of bytes which it wasn't
able to copy but we want to return a negative error code.

Fixes: 9d1a546c53b4 ("docs: Sample driver to demonstrate how to use Mediated device framework.")
Signed-off-by: Dan Carpenter &lt;dan.carpenter@oracle.com&gt;
Reviewed-by: Kirti Wankhede &lt;kwankhede@nvidia.com&gt;
Signed-off-by: Alex Williamson &lt;alex.williamson@redhat.com&gt;
</content>
</entry>
<entry>
<title>vfio-mdev: fix some error codes in the sample code</title>
<updated>2017-01-04T15:32:23+00:00</updated>
<author>
<name>Dan Carpenter</name>
<email>dan.carpenter@oracle.com</email>
</author>
<published>2016-11-24T11:27:26+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=d293dbaa540b5800817cc10832d764b17cc211b5'/>
<id>urn:sha1:d293dbaa540b5800817cc10832d764b17cc211b5</id>
<content type='text'>
This is just sample code.  We forget to set the error codes in a couple
places.

Signed-off-by: Dan Carpenter &lt;dan.carpenter@oracle.com&gt;
Reported-by: Alexey Khoroshilov &lt;khoroshilov@ispras.ru&gt;
Signed-off-by: Alex Williamson &lt;alex.williamson@redhat.com&gt;
</content>
</entry>
<entry>
<title>vfio-mdev: Make mdev_device private and abstract interfaces</title>
<updated>2016-12-30T15:13:44+00:00</updated>
<author>
<name>Alex Williamson</name>
<email>alex.williamson@redhat.com</email>
</author>
<published>2016-12-30T15:13:44+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=99e3123e3d72616a829dad6d25aa005ef1ef9b13'/>
<id>urn:sha1:99e3123e3d72616a829dad6d25aa005ef1ef9b13</id>
<content type='text'>
Abstract access to mdev_device so that we can define which interfaces
are public rather than relying on comments in the structure.

Cc: Zhenyu Wang &lt;zhenyuw@linux.intel.com&gt;
Cc: Zhi Wang &lt;zhi.a.wang@intel.com&gt;
Signed-off-by: Alex Williamson &lt;alex.williamson@redhat.com&gt;
Reviewed-by: Jike Song &lt;jike.song@intel.com&gt;
Reviewed by: Kirti Wankhede &lt;kwankhede@nvidia.com&gt;
</content>
</entry>
<entry>
<title>vfio-mdev: Make mdev_parent private</title>
<updated>2016-12-30T15:13:41+00:00</updated>
<author>
<name>Alex Williamson</name>
<email>alex.williamson@redhat.com</email>
</author>
<published>2016-12-30T15:13:41+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=9372e6feaafb65d88f667ffb5b7b425f8568344f'/>
<id>urn:sha1:9372e6feaafb65d88f667ffb5b7b425f8568344f</id>
<content type='text'>
Rather than hoping for good behavior by marking some elements
internal, enforce it by making the entire structure private and
creating an accessor function for the one useful external field.

Cc: Zhenyu Wang &lt;zhenyuw@linux.intel.com&gt;
Cc: Zhi Wang &lt;zhi.a.wang@intel.com&gt;
Cc: Jike Song &lt;jike.song@intel.com&gt;
Signed-off-by: Alex Williamson &lt;alex.williamson@redhat.com&gt;
Reviewed by: Kirti Wankhede &lt;kwankhede@nvidia.com&gt;
</content>
</entry>
<entry>
<title>vfio-mdev: de-polute the namespace, rename parent_device &amp; parent_ops</title>
<updated>2016-12-30T15:13:38+00:00</updated>
<author>
<name>Alex Williamson</name>
<email>alex.williamson@redhat.com</email>
</author>
<published>2016-12-30T15:13:38+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=42930553a7c11f06351bc08b889808d0f6020f08'/>
<id>urn:sha1:42930553a7c11f06351bc08b889808d0f6020f08</id>
<content type='text'>
Add an mdev_ prefix so we're not poluting the namespace so much.

Cc: Zhenyu Wang &lt;zhenyuw@linux.intel.com&gt;
Cc: Zhi Wang &lt;zhi.a.wang@intel.com&gt;
Cc: Jike Song &lt;jike.song@intel.com&gt;
Signed-off-by: Alex Williamson &lt;alex.williamson@redhat.com&gt;
Reviewed by: Kirti Wankhede &lt;kwankhede@nvidia.com&gt;
</content>
</entry>
</feed>
