Displaying 20 results from an estimated 72 matches for "ptr_err_or_zero".
2017 Nov 28
0
[PATCH] virtio-mmio: Use PTR_ERR_OR_ZERO()
Fix ptr_ret.cocci warnings:
drivers/virtio/virtio_mmio.c:653:1-3: WARNING: PTR_ERR_OR_ZERO can be used
Use PTR_ERR_OR_ZERO rather than if(IS_ERR(...)) + PTR_ERR
Generated by: scripts/coccinelle/api/ptr_ret.cocci
Signed-off-by: Vasyl Gomonovych <gomonovych at gmail.com>
---
drivers/virtio/virtio_mmio.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/driver...
2017 Nov 28
0
[PATCH] virtio-mmio: Use PTR_ERR_OR_ZERO()
Fix ptr_ret.cocci warnings:
drivers/virtio/virtio_mmio.c:653:1-3: WARNING: PTR_ERR_OR_ZERO can be used
Use PTR_ERR_OR_ZERO rather than if(IS_ERR(...)) + PTR_ERR
Generated by: scripts/coccinelle/api/ptr_ret.cocci
Signed-off-by: Vasyl Gomonovych <gomonovych at gmail.com>
---
drivers/virtio/virtio_mmio.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/driver...
2018 Feb 08
0
[PULL] virtio, vhost: fixes, cleanups, features
...g.c malloc & memset to calloc
Stefan Hajnoczi (1):
virtio_blk: print capacity at probe time
Tom?? Golembiovsk? (1):
virtio_balloon: include disk/file caches memory statistics
Tonghao Zhang (1):
vhost: Remove the unused variable.
Vasyl Gomonovych (2):
virtio-mmio: Use PTR_ERR_OR_ZERO()
firmware: Use PTR_ERR_OR_ZERO()
Vincent Legoll (1):
virtio: make VIRTIO a menuconfig to ease disabling it all
weiping zhang (3):
virtio: split device_register into device_initialize and device_add
virtio_pci: don't kfree device on register failure
virtio_vop: d...
2020 Sep 04
2
[PATCH] i2c: virtio: add a virtio i2c frontend driver
...evice *vdev = vi->vdev;
>> +
>> +??? vi->vq = virtio_find_single_vq(vdev, virtio_i2c_msg_done,
>> "i2c-msg");
>
>
> We've in the scope of ic2, so "msg" should be sufficient.
>
>
OK. Will change this name. Thanks.
>> +??? return PTR_ERR_OR_ZERO(vi->vq);
2020 Sep 04
2
[PATCH] i2c: virtio: add a virtio i2c frontend driver
...evice *vdev = vi->vdev;
>> +
>> +??? vi->vq = virtio_find_single_vq(vdev, virtio_i2c_msg_done,
>> "i2c-msg");
>
>
> We've in the scope of ic2, so "msg" should be sufficient.
>
>
OK. Will change this name. Thanks.
>> +??? return PTR_ERR_OR_ZERO(vi->vq);
2020 Apr 14
0
[PATCH v2 20/33] iommu/virtio: Convert to probe/release_device() call-backs
...ree_dev;
+ return &viommu->iommu;
- /*
- * Last step creates a default domain and attaches to it. Everything
- * must be ready.
- */
- group = iommu_group_get_for_dev(dev);
- if (IS_ERR(group)) {
- ret = PTR_ERR(group);
- goto err_unlink_dev;
- }
-
- iommu_group_put(group);
-
- return PTR_ERR_OR_ZERO(group);
-
-err_unlink_dev:
- iommu_device_unlink(&viommu->iommu, dev);
err_free_dev:
generic_iommu_put_resv_regions(dev, &vdev->resv_regions);
kfree(vdev);
- return ret;
+ return ERR_PTR(ret);
}
-static void viommu_remove_device(struct device *dev)
+static void viommu_releas...
2020 Sep 07
0
[PATCH] i2c: virtio: add a virtio i2c frontend driver
...;> +??? vi->vq = virtio_find_single_vq(vdev, virtio_i2c_msg_done,
>>> "i2c-msg");
>>
>>
>> We've in the scope of ic2, so "msg" should be sufficient.
>>
>>
> OK. Will change this name. Thanks.
>
>
>>> +??? return PTR_ERR_OR_ZERO(vi->vq);
>
2020 Sep 03
9
[PATCH] i2c: virtio: add a virtio i2c frontend driver
...virtio_device *vdev)
+{
+ vdev->config->reset(vdev);
+ vdev->config->del_vqs(vdev);
+}
+
+static int virtio_i2c_setup_vqs(struct virtio_i2c *vi)
+{
+ struct virtio_device *vdev = vi->vdev;
+
+ vi->vq = virtio_find_single_vq(vdev, virtio_i2c_msg_done, "i2c-msg");
+ return PTR_ERR_OR_ZERO(vi->vq);
+}
+
+static u32 virtio_i2c_func(struct i2c_adapter *adap)
+{
+ return I2C_FUNC_I2C | I2C_FUNC_SMBUS_EMUL;
+}
+
+static struct i2c_algorithm virtio_algorithm = {
+ .master_xfer = virtio_i2c_xfer,
+ .functionality = virtio_i2c_func,
+};
+
+static struct i2c_adapter virtio_adapter = {
+ ....
2020 Sep 03
9
[PATCH] i2c: virtio: add a virtio i2c frontend driver
...virtio_device *vdev)
+{
+ vdev->config->reset(vdev);
+ vdev->config->del_vqs(vdev);
+}
+
+static int virtio_i2c_setup_vqs(struct virtio_i2c *vi)
+{
+ struct virtio_device *vdev = vi->vdev;
+
+ vi->vq = virtio_find_single_vq(vdev, virtio_i2c_msg_done, "i2c-msg");
+ return PTR_ERR_OR_ZERO(vi->vq);
+}
+
+static u32 virtio_i2c_func(struct i2c_adapter *adap)
+{
+ return I2C_FUNC_I2C | I2C_FUNC_SMBUS_EMUL;
+}
+
+static struct i2c_algorithm virtio_algorithm = {
+ .master_xfer = virtio_i2c_xfer,
+ .functionality = virtio_i2c_func,
+};
+
+static struct i2c_adapter virtio_adapter = {
+ ....
2020 Sep 22
3
[PATCH v3] i2c: virtio: add a virtio i2c frontend driver
...uct virtio_device *vdev)
+{
+ vdev->config->reset(vdev);
+ vdev->config->del_vqs(vdev);
+}
+
+static int virtio_i2c_setup_vqs(struct virtio_i2c *vi)
+{
+ struct virtio_device *vdev = vi->vdev;
+
+ vi->vq = virtio_find_single_vq(vdev, virtio_i2c_msg_done, "msg");
+ return PTR_ERR_OR_ZERO(vi->vq);
+}
+
+static u32 virtio_i2c_func(struct i2c_adapter *adap)
+{
+ return I2C_FUNC_I2C | I2C_FUNC_SMBUS_EMUL;
+}
+
+static struct i2c_algorithm virtio_algorithm = {
+ .master_xfer = virtio_i2c_xfer,
+ .functionality = virtio_i2c_func,
+};
+
+static struct i2c_adapter virtio_adapter = {
+ ....
2020 Sep 22
3
[PATCH v3] i2c: virtio: add a virtio i2c frontend driver
...uct virtio_device *vdev)
+{
+ vdev->config->reset(vdev);
+ vdev->config->del_vqs(vdev);
+}
+
+static int virtio_i2c_setup_vqs(struct virtio_i2c *vi)
+{
+ struct virtio_device *vdev = vi->vdev;
+
+ vi->vq = virtio_find_single_vq(vdev, virtio_i2c_msg_done, "msg");
+ return PTR_ERR_OR_ZERO(vi->vq);
+}
+
+static u32 virtio_i2c_func(struct i2c_adapter *adap)
+{
+ return I2C_FUNC_I2C | I2C_FUNC_SMBUS_EMUL;
+}
+
+static struct i2c_algorithm virtio_algorithm = {
+ .master_xfer = virtio_i2c_xfer,
+ .functionality = virtio_i2c_func,
+};
+
+static struct i2c_adapter virtio_adapter = {
+ ....
2020 Sep 03
0
[PATCH] i2c: virtio: add a virtio i2c frontend driver
...;reset(vdev);
> + vdev->config->del_vqs(vdev);
> +}
> +
> +static int virtio_i2c_setup_vqs(struct virtio_i2c *vi)
> +{
> + struct virtio_device *vdev = vi->vdev;
> +
> + vi->vq = virtio_find_single_vq(vdev, virtio_i2c_msg_done, "i2c-msg");
> + return PTR_ERR_OR_ZERO(vi->vq);
> +}
> +
> +static u32 virtio_i2c_func(struct i2c_adapter *adap)
> +{
> + return I2C_FUNC_I2C | I2C_FUNC_SMBUS_EMUL;
> +}
> +
> +static struct i2c_algorithm virtio_algorithm = {
> + .master_xfer = virtio_i2c_xfer,
> + .functionality = virtio_i2c_func,
>...
2020 Sep 03
0
[PATCH] i2c: virtio: add a virtio i2c frontend driver
...;reset(vdev);
> + vdev->config->del_vqs(vdev);
> +}
> +
> +static int virtio_i2c_setup_vqs(struct virtio_i2c *vi)
> +{
> + struct virtio_device *vdev = vi->vdev;
> +
> + vi->vq = virtio_find_single_vq(vdev, virtio_i2c_msg_done, "i2c-msg");
> + return PTR_ERR_OR_ZERO(vi->vq);
> +}
> +
> +static u32 virtio_i2c_func(struct i2c_adapter *adap)
> +{
> + return I2C_FUNC_I2C | I2C_FUNC_SMBUS_EMUL;
> +}
> +
> +static struct i2c_algorithm virtio_algorithm = {
> + .master_xfer = virtio_i2c_xfer,
> + .functionality = virtio_i2c_func,
>...
2020 Sep 14
0
[PATCH v2] i2c: virtio: add a virtio i2c frontend driver
...->reset(vdev);
> + vdev->config->del_vqs(vdev);
> +}
> +
> +static int virtio_i2c_setup_vqs(struct virtio_i2c *vi)
> +{
> + struct virtio_device *vdev = vi->vdev;
> +
> + vi->vq = virtio_find_single_vq(vdev, virtio_i2c_msg_done, "msg");
> + return PTR_ERR_OR_ZERO(vi->vq);
> +}
> +
> +static u32 virtio_i2c_func(struct i2c_adapter *adap)
> +{
> + return I2C_FUNC_I2C | I2C_FUNC_SMBUS_EMUL;
> +}
> +
> +static struct i2c_algorithm virtio_algorithm = {
> + .master_xfer = virtio_i2c_xfer,
> + .functionality = virtio_i2c_func,
>...
2020 Sep 04
0
[PATCH] i2c: virtio: add a virtio i2c frontend driver
...+static int virtio_i2c_setup_vqs(struct virtio_i2c *vi)
> +{
> + struct virtio_device *vdev = vi->vdev;
> +
> + vi->vq = virtio_find_single_vq(vdev, virtio_i2c_msg_done, "i2c-msg");
We've in the scope of ic2, so "msg" should be sufficient.
> + return PTR_ERR_OR_ZERO(vi->vq);
> +}
> +
> +static u32 virtio_i2c_func(struct i2c_adapter *adap)
> +{
> + return I2C_FUNC_I2C | I2C_FUNC_SMBUS_EMUL;
> +}
> +
> +static struct i2c_algorithm virtio_algorithm = {
> + .master_xfer = virtio_i2c_xfer,
> + .functionality = virtio_i2c_func,
>...
2020 Sep 22
0
[PATCH v3] i2c: virtio: add a virtio i2c frontend driver
...->reset(vdev);
> + vdev->config->del_vqs(vdev);
> +}
> +
> +static int virtio_i2c_setup_vqs(struct virtio_i2c *vi)
> +{
> + struct virtio_device *vdev = vi->vdev;
> +
> + vi->vq = virtio_find_single_vq(vdev, virtio_i2c_msg_done, "msg");
> + return PTR_ERR_OR_ZERO(vi->vq);
> +}
> +
> +static u32 virtio_i2c_func(struct i2c_adapter *adap)
> +{
> + return I2C_FUNC_I2C | I2C_FUNC_SMBUS_EMUL;
> +}
> +
> +static struct i2c_algorithm virtio_algorithm = {
> + .master_xfer = virtio_i2c_xfer,
> + .functionality = virtio_i2c_func,
>...
2018 Mar 23
1
[PATCH 1/4] iommu: Add virtio-iommu driver
...s a default domain and attaches to it. Everything
> + * must be ready.
> + */
> + group = iommu_group_get_for_dev(dev);
> + if (!IS_ERR(group))
> + iommu_group_put(group);
Since you create the sysfs IOMMU device, maybe also create the links for
the masters?
> +
> + return PTR_ERR_OR_ZERO(group);
> +}
> +
> +static void viommu_remove_device(struct device *dev)
> +{
You need to remove dev from its group, too (basically, .remove_device
should always undo everything .add_device did)
It would also be good practice to verify that dev->iommu_fwspec exists
and is one of...
2020 Sep 11
6
[PATCH v2] i2c: virtio: add a virtio i2c frontend driver
...uct virtio_device *vdev)
+{
+ vdev->config->reset(vdev);
+ vdev->config->del_vqs(vdev);
+}
+
+static int virtio_i2c_setup_vqs(struct virtio_i2c *vi)
+{
+ struct virtio_device *vdev = vi->vdev;
+
+ vi->vq = virtio_find_single_vq(vdev, virtio_i2c_msg_done, "msg");
+ return PTR_ERR_OR_ZERO(vi->vq);
+}
+
+static u32 virtio_i2c_func(struct i2c_adapter *adap)
+{
+ return I2C_FUNC_I2C | I2C_FUNC_SMBUS_EMUL;
+}
+
+static struct i2c_algorithm virtio_algorithm = {
+ .master_xfer = virtio_i2c_xfer,
+ .functionality = virtio_i2c_func,
+};
+
+static struct i2c_adapter virtio_adapter = {
+ ....
2020 Sep 11
6
[PATCH v2] i2c: virtio: add a virtio i2c frontend driver
...uct virtio_device *vdev)
+{
+ vdev->config->reset(vdev);
+ vdev->config->del_vqs(vdev);
+}
+
+static int virtio_i2c_setup_vqs(struct virtio_i2c *vi)
+{
+ struct virtio_device *vdev = vi->vdev;
+
+ vi->vq = virtio_find_single_vq(vdev, virtio_i2c_msg_done, "msg");
+ return PTR_ERR_OR_ZERO(vi->vq);
+}
+
+static u32 virtio_i2c_func(struct i2c_adapter *adap)
+{
+ return I2C_FUNC_I2C | I2C_FUNC_SMBUS_EMUL;
+}
+
+static struct i2c_algorithm virtio_algorithm = {
+ .master_xfer = virtio_i2c_xfer,
+ .functionality = virtio_i2c_func,
+};
+
+static struct i2c_adapter virtio_adapter = {
+ ....
2024 Oct 30
1
[PATCH 2/2] [v9] drm/nouveau: expose GSP-RM logging buffers via debugfs
...*gsp_logging_debugfs_root;
+#endif
+
static int __init
nouveau_drm_init(void)
{
@@ -1443,6 +1475,14 @@ nouveau_drm_init(void)
nouveau_register_dsm_handler();
nouveau_backlight_ctor();
+#ifdef CONFIG_DEBUG_FS
+ gsp_logging_debugfs_root = debugfs_create_dir("nouveau", NULL);
+ if (PTR_ERR_OR_ZERO(gsp_logging_debugfs_root)) {
+ pr_err("nouveau: could not create GSP-RM logging buffer root\n");
+ gsp_logging_debugfs_root = NULL;
+ }
+#endif
+
#ifdef CONFIG_PCI
return pci_register_driver(&nouveau_drm_pci_driver);
#else
@@ -1467,6 +1507,11 @@ nouveau_drm_exit(void)
#endif...