search for: __must_check

Displaying 20 results from an estimated 172 matches for "__must_check".

2017 Dec 15
2
[PATCH v19 3/7] xbitmap: add more operations
...ome flaws: - how does xbit_alloc communicate back which bit it allocated? - What if xbit_find_set() is called on a completely empty array with a range of 0, ULONG_MAX -- there's no invalid number to return. - xbit_clear() can't return an error. Neither can xbit_zero(). - Need to add __must_check to various return values to discourage sloppy programming So I modify the proposed API we compete with thusly: bool xbit_test(struct xbitmap *, unsigned long bit); int __must_check xbit_set(struct xbitmap *, unsigned long bit, gfp_t); void xbit_clear(struct xbitmap *, unsigned long bit); int _...
2017 Dec 15
2
[PATCH v19 3/7] xbitmap: add more operations
...ome flaws: - how does xbit_alloc communicate back which bit it allocated? - What if xbit_find_set() is called on a completely empty array with a range of 0, ULONG_MAX -- there's no invalid number to return. - xbit_clear() can't return an error. Neither can xbit_zero(). - Need to add __must_check to various return values to discourage sloppy programming So I modify the proposed API we compete with thusly: bool xbit_test(struct xbitmap *, unsigned long bit); int __must_check xbit_set(struct xbitmap *, unsigned long bit, gfp_t); void xbit_clear(struct xbitmap *, unsigned long bit); int _...
2008 Jan 18
2
[PATCH 2/3] Make IRQ handlers typesafe.
...0 deletions(-) diff -r 0fe1a980708b include/linux/interrupt.h --- a/include/linux/interrupt.h Thu Jan 17 14:48:56 2008 +1100 +++ b/include/linux/interrupt.h Thu Jan 17 15:42:01 2008 +1100 @@ -69,13 +69,26 @@ struct irqaction { }; extern irqreturn_t no_action(int cpl, void *dev_id); -extern int __must_check request_irq(unsigned int, irq_handler_t handler, + +/* Typesafe version of request_irq. Also takes old-style void * handlers. */ +#define request_irq(irq, handler, flags, name, dev_id) \ + __request_irq((irq), \ + check_either_type((handler), irq_handler_t, \ + int (*)(int, typeo...
2008 Jan 18
2
[PATCH 2/3] Make IRQ handlers typesafe.
...0 deletions(-) diff -r 0fe1a980708b include/linux/interrupt.h --- a/include/linux/interrupt.h Thu Jan 17 14:48:56 2008 +1100 +++ b/include/linux/interrupt.h Thu Jan 17 15:42:01 2008 +1100 @@ -69,13 +69,26 @@ struct irqaction { }; extern irqreturn_t no_action(int cpl, void *dev_id); -extern int __must_check request_irq(unsigned int, irq_handler_t handler, + +/* Typesafe version of request_irq. Also takes old-style void * handlers. */ +#define request_irq(irq, handler, flags, name, dev_id) \ + __request_irq((irq), \ + check_either_type((handler), irq_handler_t, \ + int (*)(int, typeo...
2018 May 07
2
[PATCH 3/3] drm/vc4: Attach underscan props to the HDMI connector
...which > + * should be more than enough for real use cases. Note that the actual > + * limitation comes from the display mode: > + * hborder < hdisplay && vborder < vdisplay > + */ > + drm_connector_attach_underscan_properties(connector, We should probably sprinkle __must_check over all these :-) -Daniel > + BIT(DRM_UNDERSCAN_OFF) | > + BIT(DRM_UNDERSCAN_ON), > + 1024, 1024); > + > connector->polled = (DRM_CONNECTOR_POLL_CONNECT | > DRM_CONNECTOR_POLL_DISCONNECT); > > @@ -408,6 +418,9 @@ static void vc4_hdmi_wr...
2017 Dec 17
0
[PATCH v19 3/7] xbitmap: add more operations
...s found. > - xbit_clear() can't return an error. Neither can xbit_zero(). I found the current xbit_clear implementation only returns 0, and there isn't an error to be returned from this function. In this case, is it better to make the function "void"? > - Need to add __must_check to various return values to discourage sloppy > programming > > So I modify the proposed API we compete with thusly: > > bool xbit_test(struct xbitmap *, unsigned long bit); int __must_check > xbit_set(struct xbitmap *, unsigned long bit, gfp_t); void xbit_clear(struct > x...
2017 Nov 03
1
[PATCH v17 1/6] lib/xbitmap: Introduce xbitmap
I'm commenting without understanding the logic. Wei Wang wrote: > + > +bool xb_preload(gfp_t gfp); > + Want __must_check annotation, for __radix_tree_preload() is marked with __must_check annotation. By error failing to check result of xb_preload() will lead to preemption kept disabled unexpectedly. > +int xb_set_bit(struct xb *xb, unsigned long bit) > +{ > + int err; > + unsigned long index = bit / ID...
2017 Nov 03
1
[PATCH v17 1/6] lib/xbitmap: Introduce xbitmap
I'm commenting without understanding the logic. Wei Wang wrote: > + > +bool xb_preload(gfp_t gfp); > + Want __must_check annotation, for __radix_tree_preload() is marked with __must_check annotation. By error failing to check result of xb_preload() will lead to preemption kept disabled unexpectedly. > +int xb_set_bit(struct xb *xb, unsigned long bit) > +{ > + int err; > + unsigned long index = bit / ID...
2018 May 09
0
[PATCH 3/3] drm/vc4: Attach underscan props to the HDMI connector
...than enough for real use cases. Note that the actual > > + * limitation comes from the display mode: > > + * hborder < hdisplay && vborder < vdisplay > > + */ > > + drm_connector_attach_underscan_properties(connector, > > We should probably sprinkle __must_check over all these :-) I'm perfectly fine adding __must_check to drm_connector_attach_underscan_properties(), but I'm definitely not volunteering for a massive __must_check sanitization :P.
2023 Mar 22
3
[PATCH v3 01/10] kobject: introduce kobject_del_and_put()
...+++++ lib/kobject.c | 3 +-- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/include/linux/kobject.h b/include/linux/kobject.h index bdab370a24f4..e21b7c22e355 100644 --- a/include/linux/kobject.h +++ b/include/linux/kobject.h @@ -112,6 +112,19 @@ extern struct kobject * __must_check kobject_get_unless_zero( struct kobject *kobj); extern void kobject_put(struct kobject *kobj); +/** + * kobject_del_and_put() - Delete kobject. + * @kobj: object. + * + * Unlink kobject from hierarchy and decrement the refcount. + * If refcount is 0, call kobject_cleanup(). + */ +static i...
2017 Jun 30
0
[Intel-gfx] [PATCH 1/2] drm/atomic: Change drm_atomic_helper_swap_state to return an error.
...ra at vger.kernel.org > Signed-off-by: Maarten Lankhorst <maarten.lankhorst at linux.intel.com> We kinda need to backport this to older kernels, but I don't really see how :( Maybe we should split this up: patch 1: Change to int return type patches 2-(n-1): Driver conversions patch n: __must_check addition That would at least somewhat make this backportable ... > --- > drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_dc.c | 14 ++++++++++++-- > drivers/gpu/drm/drm_atomic_helper.c | 18 ++++++++++++------ > drivers/gpu/drm/i915/intel_display.c | 10 +++++++++- > driv...
2017 Jun 28
5
[PATCH 1/2] drm/atomic: Change drm_atomic_helper_swap_state to return an error.
...0644 --- a/include/drm/drm_atomic_helper.h +++ b/include/drm/drm_atomic_helper.h @@ -80,8 +80,8 @@ void drm_atomic_helper_disable_planes_on_crtc(struct drm_crtc_state *old_crtc_state, bool atomic); -void drm_atomic_helper_swap_state(struct drm_atomic_state *state, - bool stall); +int __must_check drm_atomic_helper_swap_state(struct drm_atomic_state *state, + bool stall); /* nonblocking commit helpers */ int drm_atomic_helper_setup_commit(struct drm_atomic_state *state, -- 2.11.0
2018 Nov 07
2
[PATCH v3 2/5] drm/dp_mst: Start tracking per-port VCPI allocations
...e ports from the new > state, which would prevent us from incorrectly considering their > bandwidth requirements alongside legitimate new payloads. > - Add function references in drm_dp_atomic_release_vcpi_slots() - danvet > - Annotate atomic VCPI and atomic check functions with __must_check > - danvet > > Changes since v1: > - Don't use the now-removed ->atomic_check() for private objects hook, > just give drivers a function to call themselves > > Signed-off-by: Lyude Paul <lyude at redhat.com> > Cc: Daniel Vetter <daniel.vetter at ffwl...
2023 Mar 20
1
[RESEND, PATCH v2 01/10] kobject: introduce kobject_del_and_put()
...16 insertions(+), 2 deletions(-) diff --git a/include/linux/kobject.h b/include/linux/kobject.h index bdab370a24f4..782d4bd119f8 100644 --- a/include/linux/kobject.h +++ b/include/linux/kobject.h @@ -111,6 +111,7 @@ extern struct kobject *kobject_get(struct kobject *kobj); extern struct kobject * __must_check kobject_get_unless_zero( struct kobject *kobj); extern void kobject_put(struct kobject *kobj); +extern void kobject_del_and_put(struct kobject *kobj); extern const void *kobject_namespace(const struct kobject *kobj); extern void kobject_get_ownership(const struct kobject *kobj, diff --g...
2018 Nov 07
0
[PATCH v3 2/5] drm/dp_mst: Start tracking per-port VCPI allocations
...ns to prune any stale ports from the new state, which would prevent us from incorrectly considering their bandwidth requirements alongside legitimate new payloads. - Add function references in drm_dp_atomic_release_vcpi_slots() - danvet - Annotate atomic VCPI and atomic check functions with __must_check - danvet Changes since v1: - Don't use the now-removed ->atomic_check() for private objects hook, just give drivers a function to call themselves Signed-off-by: Lyude Paul <lyude at redhat.com> Cc: Daniel Vetter <daniel.vetter at ffwll.ch> --- drivers/gpu/drm/drm_dp_mst...
2020 Jun 16
1
[PATCH v5 2/2] mm, treewide: Rename kzfree() to kfree_sensitive()
...e_sensitive() kerneldoc and adding > a kzfree backward compatibility macro in slab.h. > > ... > > --- a/include/linux/slab.h > +++ b/include/linux/slab.h > @@ -186,10 +186,12 @@ void memcg_deactivate_kmem_caches(struct mem_cgroup *, struct mem_cgroup *); > */ > void * __must_check krealloc(const void *, size_t, gfp_t); > void kfree(const void *); > -void kzfree(const void *); > +void kfree_sensitive(const void *); > size_t __ksize(const void *); > size_t ksize(const void *); > > +#define kzfree(x) kfree_sensitive(x) /* For backward compatibility */...
2020 Mar 19
2
[PATCH v3] PCI: Use ioremap(), not phys_to_virt() for platform ROM
...ORT_SYMBOL(pci_platform_rom); diff --git a/include/linux/pci.h b/include/linux/pci.h index 3840a541a9de..7268dcf1f23e 100644 --- a/include/linux/pci.h +++ b/include/linux/pci.h @@ -1214,7 +1214,6 @@ int pci_enable_rom(struct pci_dev *pdev); void pci_disable_rom(struct pci_dev *pdev); void __iomem __must_check *pci_map_rom(struct pci_dev *pdev, size_t *size); void pci_unmap_rom(struct pci_dev *pdev, void __iomem *rom); -void __iomem __must_check *pci_platform_rom(struct pci_dev *pdev, size_t *size); /* Power management related routines */ int pci_save_state(struct pci_dev *dev); -- 2.13.7
2023 Apr 10
2
[PATCH v2 2/2] tools/virtio: fix build caused by virtio_ring changes
...; index 051fdeaf2670..f1896b70a8e5 100644 > > --- a/tools/include/linux/types.h > > +++ b/tools/include/linux/types.h > > @@ -49,7 +49,6 @@ typedef __s8 s8; > > #endif > > > > #define __force > > -#define __user Why is this needed? > > #define __must_check > > #define __cold > > > > diff --git a/tools/virtio/linux/compiler.h b/tools/virtio/linux/compiler.h > > index 2c51bccb97bb..1f3a15b954b9 100644 > > --- a/tools/virtio/linux/compiler.h > > +++ b/tools/virtio/linux/compiler.h > > @@ -2,6 +2,8 @@ > &gt...
2018 Nov 07
2
[PATCH v3 2/5] drm/dp_mst: Start tracking per-port VCPI allocations
...ld prevent us from incorrectly considering their > > > bandwidth requirements alongside legitimate new payloads. > > > - Add function references in drm_dp_atomic_release_vcpi_slots() - > > > danvet > > > - Annotate atomic VCPI and atomic check functions with __must_check > > > - danvet > > > > > > Changes since v1: > > > - Don't use the now-removed ->atomic_check() for private objects hook, > > > just give drivers a function to call themselves > > > > > > Signed-off-by: Lyude Paul <ly...
2018 Nov 07
6
[PATCH v3 0/5] drm/dp_mst: Add some atomic state iterator macros
This patchset does some cleaning up of the atomic VCPI helpers for MST, and converts nouveau over to using them. I would have included amdgpu in this patch as well, but at the moment moving them over to the atomic helpers is nontrivial. Cc: Daniel Vetter <daniel at ffwll.ch> Lyude Paul (5): drm/dp_mst: Add some atomic state iterator macros drm/dp_mst: Start tracking per-port VCPI