search for: list_for_each_entry

Displaying 20 results from an estimated 1305 matches for "list_for_each_entry".

2019 Sep 13
1
[PATCH v2 23/27] drm/amdgpu: Iterate through DRM connectors correctly
...nnector_status_connected)) { > struct drm_connector *list_connector; > + struct drm_connector_list_iter iter; > struct amdgpu_connector *list_amdgpu_connector; > - list_for_each_entry(list_connector, &dev->mode_config.connector_list, head) { > + > + drm_connector_list_iter_begin(dev, &iter); > + drm_for_each_connector_iter(list_connector, > +...
2019 Sep 03
0
[PATCH v2 23/27] drm/amdgpu: Iterate through DRM connectors correctly
...or_dvi_detect(struct drm_connector *connector, bool force) */ if (amdgpu_connector->shared_ddc && (ret == connector_status_connected)) { struct drm_connector *list_connector; + struct drm_connector_list_iter iter; struct amdgpu_connector *list_amdgpu_connector; - list_for_each_entry(list_connector, &dev->mode_config.connector_list, head) { + + drm_connector_list_iter_begin(dev, &iter); + drm_for_each_connector_iter(list_connector, + &iter) { if (connector == list_connector) continue; list_amdgpu_connector = to_amdgpu_connector(...
2007 May 17
1
[PATCH] ocfs: use list_for_each_entry where benefical
...t_head *iter, *tmp; + struct o2net_status_wait *nsw, *tmp; unsigned int num_kills = 0; - struct o2net_status_wait *nsw; assert_spin_locked(&nn->nn_lock); - list_for_each_safe(iter, tmp, &nn->nn_status_list) { - nsw = list_entry(iter, struct o2net_status_wait, ns_node_item); + list_for_each_entry_safe(nsw, tmp, &nn->nn_status_list, ns_node_item) { o2net_complete_nsw_locked(nn, nsw, O2NET_ERR_DIED, 0); num_kills++; } @@ -764,13 +762,10 @@ EXPORT_SYMBOL_GPL(o2net_register_handler void o2net_unregister_handler_list(struct list_head *list) { - struct list_head *pos, *n; - str...
2014 Jul 26
0
[RFC PATCH 09/11] PCI/MSI: refactor PCI MSI driver
...i_dev *dev, int nvec, int type) +int __weak arch_setup_msi_irqs(struct msi_irqs *msi, int nvec, int type) { struct msi_desc *entry; int ret; @@ -78,8 +80,8 @@ int __weak arch_setup_msi_irqs(struct pci_dev *dev, int nvec, int type) if (type == MSI_TYPE && nvec > 1) return 1; - list_for_each_entry(entry, &dev->msi_list, list) { - ret = arch_setup_msi_irq(dev, entry); + list_for_each_entry(entry, &msi->msi_list, list) { + ret = arch_setup_msi_irq(msi, entry); if (ret < 0) return ret; if (ret > 0) @@ -93,11 +95,11 @@ int __weak arch_setup_msi_irqs(struct pci_dev...
2009 Jan 16
4
[PATCH] Btrfs: simplify iteration codes
merge list_for_each and list_entry to list_for_each_entry. Signed-off-by: Qinghuang Feng <qhfeng.kernel@gmail.com> --- diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c index b187b53..70f0248 100644 --- a/fs/btrfs/volumes.c +++ b/fs/btrfs/volumes.c @@ -104,10 +104,8 @@ static noinline struct btrfs_device *__find_device(struct list_head *head,...
2014 Aug 20
1
[RFC PATCH 09/11] PCI/MSI: refactor PCI MSI driver
...arch_setup_msi_irqs(struct msi_irqs *msi, int nvec, int type) > { > struct msi_desc *entry; > int ret; > @@ -78,8 +80,8 @@ int __weak arch_setup_msi_irqs(struct pci_dev *dev, int nvec, > int type) > if (type == MSI_TYPE && nvec > 1) > return 1; > > - list_for_each_entry(entry, &dev->msi_list, list) { > - ret = arch_setup_msi_irq(dev, entry); > + list_for_each_entry(entry, &msi->msi_list, list) { > + ret = arch_setup_msi_irq(msi, entry); > if (ret < 0) > return ret; > if (ret > 0) > @@ -93,11 +95,11 @@ int __weak...
2014 Aug 20
1
[RFC PATCH 09/11] PCI/MSI: refactor PCI MSI driver
...arch_setup_msi_irqs(struct msi_irqs *msi, int nvec, int type) > { > struct msi_desc *entry; > int ret; > @@ -78,8 +80,8 @@ int __weak arch_setup_msi_irqs(struct pci_dev *dev, int nvec, > int type) > if (type == MSI_TYPE && nvec > 1) > return 1; > > - list_for_each_entry(entry, &dev->msi_list, list) { > - ret = arch_setup_msi_irq(dev, entry); > + list_for_each_entry(entry, &msi->msi_list, list) { > + ret = arch_setup_msi_irq(msi, entry); > if (ret < 0) > return ret; > if (ret > 0) > @@ -93,11 +95,11 @@ int __weak...
2011 Apr 20
4
[PATCH 1/5] Btrfs: fix bh leak on __btrfs_open_devices path
''bh'' is forgot to release if no error is detected Signed-off-by: Xiao Guangrong <xiaoguangrong@cn.fujitsu.com> --- fs/btrfs/volumes.c | 1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c index 8b9fb8c..69fc902 100644 --- a/fs/btrfs/volumes.c +++ b/fs/btrfs/volumes.c @@ -631,6 +631,7 @@ static int
2023 Jul 21
2
[Bridge] [PATCH] can: j1939: prevent deadlock by changing j1939_socks_lock to rwlock
...priv); jsk->state &= ~J1939_SOCK_BOUND; @@ -329,13 +329,13 @@ bool j1939_sk_recv_match(struct j1939_priv *priv, struct j1939_sk_buff_cb *skcb) struct j1939_sock *jsk; bool match = false; - spin_lock_bh(&priv->j1939_socks_lock); + read_lock_bh(&priv->j1939_socks_lock); list_for_each_entry(jsk, &priv->j1939_socks, list) { match = j1939_sk_recv_match_one(jsk, skcb); if (match) break; } - spin_unlock_bh(&priv->j1939_socks_lock); + read_unlock_bh(&priv->j1939_socks_lock); return match; } @@ -344,11 +344,11 @@ void j1939_sk_recv(struct j1939_priv *pr...
2023 Mar 01
5
[PATCH 0/2] drm/nouveau: avoid usage of list iterator after loop
This patch set includes two instances where the list iterator variable 'pstate' is implicitly assumed to be valid after the iterator loop. While in pratice that is most likely the case (if 'pstatei'/'args->v0.state' is <= the elements in clk->states), we should explicitly only allow 'pstate' to always point to correct 'nvkm_pstate' structs. That
2014 May 14
0
[RFC PATCH v1 02/16] drm/ttm: kill off some members to ttm_validate_buffer
...#include <linux/sched.h> #include <linux/module.h> -static void ttm_eu_backoff_reservation_locked(struct list_head *list) +static void ttm_eu_backoff_reservation_reverse(struct list_head *list, + struct ttm_validate_buffer *entry) { - struct ttm_validate_buffer *entry; - - list_for_each_entry(entry, list, head) { + list_for_each_entry_continue_reverse(entry, list, head) { struct ttm_buffer_object *bo = entry->bo; - if (!entry->reserved) - continue; - entry->reserved = false; - if (entry->removed) { - ttm_bo_add_to_lru(bo); - entry->removed = false; - } _...
2018 Feb 05
2
[PATCH 0/1] drm/nouveau/disp: prefer identity-mapped route of SOR <-> macro link
Hi Ben, still _assuming_ it's an issue of the card I thought about why it works with the NVIDIA binary driver. And I can image they're just trying to do an identity-mapping first and if that doesn't work (e.g. the particular SOR is already in use by another macro link) they just pick the next suitable one. So the case would be that the NVIDIA binary driver always assignes the only
2014 Aug 20
1
[RFC PATCH 10/11] PCI/MSI: Split the generic MSI code into new file
...int nvec, int type) > +{ > + struct msi_desc *entry; > + int ret; > + > + /* > + * If an architecture wants to support multiple MSI, it needs to > + * override arch_setup_msi_irqs() > + */ > + if (type == MSI_TYPE && nvec > 1) > + return 1; > + > + list_for_each_entry(entry, &msi->msi_list, list) { > + ret = arch_setup_msi_irq(msi, entry); > + if (ret < 0) > + return ret; > + if (ret > 0) > + return -ENOSPC; > + } > + return 0; > +} > + > + > +void __weak arch_teardown_msi_irqs(struct msi_irqs *msi) > +{ &g...
2014 Aug 20
1
[RFC PATCH 10/11] PCI/MSI: Split the generic MSI code into new file
...int nvec, int type) > +{ > + struct msi_desc *entry; > + int ret; > + > + /* > + * If an architecture wants to support multiple MSI, it needs to > + * override arch_setup_msi_irqs() > + */ > + if (type == MSI_TYPE && nvec > 1) > + return 1; > + > + list_for_each_entry(entry, &msi->msi_list, list) { > + ret = arch_setup_msi_irq(msi, entry); > + if (ret < 0) > + return ret; > + if (ret > 0) > + return -ENOSPC; > + } > + return 0; > +} > + > + > +void __weak arch_teardown_msi_irqs(struct msi_irqs *msi) > +{ &g...
2017 Oct 08
1
[RFC PATCH 08/29] clk: We should pass the pstate id around not the index in the list
...*fb = subdev->device->fb; > struct nvkm_pci *pci = subdev->device->pci; > struct nvkm_pstate *pstate; > - int ret, idx = 0; > + int ret; > > - if (pstatei == NVKM_CLK_PSTATE_DEFAULT) > + if (pstateid == NVKM_CLK_PSTATE_DEFAULT) > return 0; > > list_for_each_entry(pstate, &clk->states, head) { > - if (idx++ == pstatei) > + if (pstate->pstate == pstateid) > break; > } > > - nvkm_debug(subdev, "setting performance state %d\n", pstatei); > + if (!pstate) > + return -EINVAL; > + > + nvkm_debug(subdev,...
2014 Jul 26
0
[RFC PATCH 10/11] PCI/MSI: Split the generic MSI code into new file
...+} + +int __weak arch_setup_msi_irqs(struct msi_irqs *msi, int nvec, int type) +{ + struct msi_desc *entry; + int ret; + + /* + * If an architecture wants to support multiple MSI, it needs to + * override arch_setup_msi_irqs() + */ + if (type == MSI_TYPE && nvec > 1) + return 1; + + list_for_each_entry(entry, &msi->msi_list, list) { + ret = arch_setup_msi_irq(msi, entry); + if (ret < 0) + return ret; + if (ret > 0) + return -ENOSPC; + } + return 0; +} + + +void __weak arch_teardown_msi_irqs(struct msi_irqs *msi) +{ + return default_teardown_msi_irqs(msi); +} + +/* + * We have...
2014 Sep 09
2
mutex
...if (need_resched()) schedule_timeout_interruptible(1); @@ -233,10 +234,10 @@ static ssize_t hwrng_attr_current_store(struct device *dev, int err; struct hwrng *rng; + err = -ENODEV; err = mutex_lock_interruptible(&rng_mutex); if (err) return -ERESTARTSYS; - err = -ENODEV; list_for_each_entry(rng, &rng_list, list) { if (strcmp(rng->name, buf) == 0) { if (rng == current_rng) { @@ -270,8 +271,8 @@ static ssize_t hwrng_attr_current_show(struct device *dev, return -ERESTARTSYS; if (current_rng) name = current_rng->name; - ret = snprintf(buf, PAGE_SIZE, "%s\n&qu...
2014 Sep 09
2
mutex
...if (need_resched()) schedule_timeout_interruptible(1); @@ -233,10 +234,10 @@ static ssize_t hwrng_attr_current_store(struct device *dev, int err; struct hwrng *rng; + err = -ENODEV; err = mutex_lock_interruptible(&rng_mutex); if (err) return -ERESTARTSYS; - err = -ENODEV; list_for_each_entry(rng, &rng_list, list) { if (strcmp(rng->name, buf) == 0) { if (rng == current_rng) { @@ -270,8 +271,8 @@ static ssize_t hwrng_attr_current_show(struct device *dev, return -ERESTARTSYS; if (current_rng) name = current_rng->name; - ret = snprintf(buf, PAGE_SIZE, "%s\n&qu...
2013 Apr 08
1
[PATCH] drm/nouveau: idle all channels before suspending
...u_drm.c index b6bdc9f..5032c31 100644 --- a/drivers/gpu/drm/nouveau/nouveau_drm.c +++ b/drivers/gpu/drm/nouveau/nouveau_drm.c @@ -464,6 +464,23 @@ nouveau_do_suspend(struct drm_device *dev) NV_INFO(drm, "evicting buffers...\n"); ttm_bo_evict_mm(&drm->ttm.bdev, TTM_PL_VRAM); + list_for_each_entry(cli, &drm->clients, head) { + struct nouveau_abi16 *abi16 = cli->abi16; + struct nouveau_abi16_chan *chan; + + if (!abi16) + continue; + + list_for_each_entry(chan, &abi16->channels, head) + nouveau_channel_idle(chan->chan); + } + + if (drm->channel) + nouveau_channe...
2019 Sep 27
2
[PATCH] vsock/virtio: add support for MSG_PEEK
...*msg, > > + size_t len) > > +{ > > + struct virtio_vsock_sock *vvs = vsk->trans; > > + struct virtio_vsock_pkt *pkt; > > + size_t bytes, total = 0; > > + int err = -EFAULT; > > + > > + spin_lock_bh(&vvs->rx_lock); > > + > > + list_for_each_entry(pkt, &vvs->rx_queue, list) { > > + if (total == len) > > + break; > > + > > + bytes = len - total; > > + if (bytes > pkt->len - pkt->off) > > + bytes = pkt->len - pkt->off; > > + > > + /* sk_lock is held by caller so no o...