search for: __mptr

Displaying 20 results from an estimated 32 matches for "__mptr".

Did you mean: __attr
2023 Apr 10
1
[PATCH] tools/virtio: fix build caused by virtio_ring changes
...o the containing structure + * @ptr: the pointer to the member. + * @type: the type of the container struct this is embedded in. + * @member: the name of the member within the struct. + * + * WARNING: any const qualifier of @ptr is lost. + */ +#define container_of(ptr, type, member) ({ \ + void *__mptr = (void *)(ptr); \ + static_assert(__same_type(*(ptr), ((type *)0)->member) || \ + __same_type(*(ptr), void), \ + "pointer type mismatch in container_of()"); \ + ((type *)(__mptr - offsetof(type, member))); }) + +/** + * container_of_const - cast a member of a struc...
2007 Nov 13
0
[LLVMdev] BasicAliasAnalysis and out-of-bound GEP indices
...d > *hcd_to_ehci (struct usb_hcd *hcd) > { > return (struct ehci_hcd *) (hcd->hcd_priv); > } > > static inline __attribute__((always_inline)) struct usb_hcd > *ehci_to_hcd (struct ehci_hcd *ehci) > { > return ({ const typeof( ((struct usb_hcd *)0)->hcd_priv ) *__mptr = > ((void *) ehci); (struct usb_hcd *)( (char *)__mptr - > __builtin_offsetof(struct usb_hcd,hcd_priv) );}); > } > > struct device *x; > > static int ehci_pci_setup(struct usb_hcd *hcd) > { > struct ehci_hcd *ehci = hcd_to_ehci(hcd); > // [...] > // store of...
2023 Apr 10
2
[PATCH v2 2/2] tools/virtio: fix build caused by virtio_ring changes
...s.h> > > #include <linux/overflow.h> > > @@ -107,10 +108,6 @@ static inline void free_page(unsigned long addr) > > free((void *)addr); > > } > > > > -#define container_of(ptr, type, member) ({ \ > > - const typeof( ((type *)0)->member ) *__mptr = (ptr); \ > > - (type *)( (char *)__mptr - offsetof(type,member) );}) > > - > > # ifndef likely > > # define likely(x) (__builtin_expect(!!(x), 1)) > > # endif > > diff --git a/tools/virtio/linux/module.h b/tools/virtio/linux/module.h > > index 9dfa96f...
2007 Nov 13
2
[LLVMdev] BasicAliasAnalysis and out-of-bound GEP indices
Hi! While investigating into the PR1782 I spent some time analyzing BasicAliasAnalysis.cpp. While the mentioned problem should be fixed now (I hope), I have discovered some other possibilities for a bug to occur. In the case of checking for aliasing of two pointer values, where at least one of them is a GEP instruction with out-of-bound indices, BasicAliasAnalysis can return NoAlias, even if the
2020 Mar 26
0
[PATCH nbdkit 5/9 patch split 3/5] server: Move some definitions in server/internal.h to the top of the file.
...#if HAVE_DECL_PROGRAM_INVOCATION_SHORT_NAME == 1 +#include <errno.h> +#define program_name program_invocation_short_name +#else +#define program_name "nbdkit" +#endif + #define container_of(ptr, type, member) ({ \ const typeof (((type *) 0)->member) *__mptr = (ptr); \ (type *) ((char *) __mptr - offsetof(type, member)); \ }) +#define debug(fs, ...) \ + do { \ + if_verbose \ + nbdkit_debug ((fs...
2023 Apr 17
1
[PATCH v3 RESEND 1/2] virtio_ring: add a struct device forward declaration
The virtio_ring header file uses the struct device without a forward declaration. Signed-off-by: Shunsuke Mie <mie at igel.co.jp> --- Changes from v2: https://lore.kernel.org/virtualization/20230410074929-mutt-send-email-mst at kernel.org/ - Fix a typo of commit title include/linux/virtio_ring.h | 1 + 1 file changed, 1 insertion(+) diff --git a/include/linux/virtio_ring.h
2004 Jun 02
1
Problem compiling ZAPTEL on Linux 2.6.6
...ptel.c:1237: warning: passing arg 1 of `hdlc_close' from incompatible pointer type /usr/src/zaptel/zaptel.c: In function `zt_xmit': /usr/src/zaptel/zaptel.c:1293: structure has no member named `netdev' /usr/src/zaptel/zaptel.c:1293: warning: type defaults to `int' in declaration of `__mptr' /usr/src/zaptel/zaptel.c:1293: warning: initialization from incompatible pointer type /usr/src/zaptel/zaptel.c:1293: structure has no member named `netdev' /usr/src/zaptel/zaptel.c:1293: invalid type argument of `->' /usr/src/zaptel/zaptel.c:1353: warning: comparison of distinct poi...
2023 Apr 10
2
[PATCH v2 1/2] virtio_ring: add a struce device forward declaration
The virtio_ring header file uses the struct device without a forward declaration. Signed-off-by: Shunsuke Mie <mie at igel.co.jp> --- include/linux/virtio_ring.h | 1 + 1 file changed, 1 insertion(+) diff --git a/include/linux/virtio_ring.h b/include/linux/virtio_ring.h index 8b95b69ef694..77a9c2f52919 100644 --- a/include/linux/virtio_ring.h +++ b/include/linux/virtio_ring.h @@ -58,6
2018 Jul 01
2
[PATCH nbdkit] valgrind: Don't call dlclose when running under valgrind.
...E_VALGRIND +# include <valgrind.h> +/* http://valgrind.org/docs/manual/faq.html#faq.unhelpful */ +# define DO_DLCLOSE !RUNNING_ON_VALGRIND +#else +# define DO_DLCLOSE 1 +#endif + #define container_of(ptr, type, member) ({ \ const typeof (((type *) 0)->member) *__mptr = (ptr); \ (type *) ((char *) __mptr - offsetof(type, member)); \ diff --git a/src/plugins.c b/src/plugins.c index 23223b3..a56ad79 100644 --- a/src/plugins.c +++ b/src/plugins.c @@ -73,7 +73,8 @@ plugin_free (struct backend *b) if (p->plugin.unload) p->plugin.unloa...
2007 Nov 15
2
[LLVMdev] BasicAliasAnalysis and out-of-bound GEP indices
...*hcd) > > { > > return (struct ehci_hcd *) (hcd->hcd_priv); > > } > > > > static inline __attribute__((always_inline)) struct usb_hcd > > *ehci_to_hcd (struct ehci_hcd *ehci) > > { > > return ({ const typeof( ((struct usb_hcd *)0)->hcd_priv ) *__mptr = > > ((void *) ehci); (struct usb_hcd *)( (char *)__mptr - > > __builtin_offsetof(struct usb_hcd,hcd_priv) );}); > > } > > > > struct device *x; > > > > static int ehci_pci_setup(struct usb_hcd *hcd) > > { > > struct ehci_hcd *ehci = hcd_to_eh...
2010 Nov 16
1
[PATCH RFC] tools/virtio: virtio_ring testing tool
...ATOMIC, +} gfp_t; +typedef enum { + IRQ_NONE, + IRQ_HANDLED +} irqreturn_t; + +static inline void *kmalloc(size_t s, gfp_t gfp) +{ + return malloc(s); +} + +static inline void kfree(void *p) +{ + free(p); +} + +#define container_of(ptr, type, member) ({ \ + const typeof( ((type *)0)->member ) *__mptr = (ptr); \ + (type *)( (char *)__mptr - offsetof(type,member) );}) + +#define uninitialized_var(x) x = x + +# ifndef likely +# define likely(x) (__builtin_expect(!!(x), 1)) +# endif +# ifndef unlikely +# define unlikely(x) (__builtin_expect(!!(x), 0)) +# endif + +#define pr_err(format, ...) fprin...
2010 Nov 16
1
[PATCH RFC] tools/virtio: virtio_ring testing tool
...ATOMIC, +} gfp_t; +typedef enum { + IRQ_NONE, + IRQ_HANDLED +} irqreturn_t; + +static inline void *kmalloc(size_t s, gfp_t gfp) +{ + return malloc(s); +} + +static inline void kfree(void *p) +{ + free(p); +} + +#define container_of(ptr, type, member) ({ \ + const typeof( ((type *)0)->member ) *__mptr = (ptr); \ + (type *)( (char *)__mptr - offsetof(type,member) );}) + +#define uninitialized_var(x) x = x + +# ifndef likely +# define likely(x) (__builtin_expect(!!(x), 1)) +# endif +# ifndef unlikely +# define unlikely(x) (__builtin_expect(!!(x), 0)) +# endif + +#define pr_err(format, ...) fprin...
2018 Jan 17
0
[PATCH 2/9] Refactor plugin_* functions into a backend struct.
...L_H #include <stdbool.h> +#include <stddef.h> #include <stdarg.h> #include <sys/socket.h> #include <pthread.h> @@ -91,6 +92,11 @@ # endif #endif +#define container_of(ptr, type, member) ({ \ + const typeof (((type *) 0)->member) *__mptr = (ptr); \ + (type *) ((char *) __mptr - offsetof(type, member)); \ + }) + /* main.c */ extern const char *exportname; extern const char *ipaddr; @@ -108,6 +114,8 @@ extern int threads; extern volatile int quit; extern int quit_fd; +extern struct backend *backend; + /* c...
2018 Jan 16
0
[PATCH nbdkit v2 2/3] Refactor plugin_* functions into a backend struct.
...L_H #include <stdbool.h> +#include <stddef.h> #include <stdarg.h> #include <sys/socket.h> #include <pthread.h> @@ -91,6 +92,11 @@ # endif #endif +#define container_of(ptr, type, member) ({ \ + const typeof (((type *) 0)->member) *__mptr = (ptr); \ + (type *) ((char *) __mptr - offsetof(type, member)); \ + }) + /* main.c */ extern const char *exportname; extern const char *ipaddr; @@ -108,6 +114,8 @@ extern int threads; extern volatile int quit; extern int quit_fd; +extern struct backend *backend; + /* c...
2018 Jan 19
0
[nbdkit PATCH v2 13/13] RFC: plugins: Add callbacks for FUA semantics
...ndex 7fd52a2..c76c0d3 100644 --- a/src/internal.h +++ b/src/internal.h @@ -40,6 +40,7 @@ #include <sys/socket.h> #include <pthread.h> +#define NBDKIT_API_VERSION 2 #include "nbdkit-plugin.h" #include "nbdkit-filter.h" @@ -98,9 +99,6 @@ (type *) ((char *) __mptr - offsetof(type, member)); \ }) -#define NBDKIT_FLAG_MAY_TRIM (1<<0) /* Maps to !NBD_CMD_FLAG_NO_HOLE */ -#define NBDKIT_FLAG_FUA (1<<1) /* Maps to NBD_CMD_FLAG_FUA */ - /* main.c */ extern const char *exportname; extern const char *ipaddr; diff --git a/src/plugins.c...
2013 Feb 18
9
[PATCH 0/5] vringh
This introduces vringh, which are generic accessors for virtio rings (host side). There's a host-side implementation in vhost, but it assumes that the rings are in userspace, and is tied to the vhost implementation. I have patches to adapt it to use vringh, but I'm pushing this in the next merge window for Sjur, who has CAIF patches which need it. This also includes a test program in
2013 Feb 18
9
[PATCH 0/5] vringh
This introduces vringh, which are generic accessors for virtio rings (host side). There's a host-side implementation in vhost, but it assumes that the rings are in userspace, and is tied to the vhost implementation. I have patches to adapt it to use vringh, but I'm pushing this in the next merge window for Sjur, who has CAIF patches which need it. This also includes a test program in
2018 Jan 16
4
[PATCH nbdkit v2 2/3] Refactor plugin_* functions into a backend
v1 -> v2: - Fixed everything mentioned in the review. Rich.
2018 Jan 16
6
[PATCH nbdkit 0/3] Refactor plugin_* functions into a backend struct.
Somewhat invasive but mostly mechanical change to how plugins are called. This patch is in preparation for adding a second backend subtype for filters. Rich.
2013 Aug 14
23
[RFC] btrfs-progs: fix sparse checking and warnings
Hi gang, I was a little surprised to see that patch go by recently which fixed an endian bug. I went to see how sparse checking looked and it was.. broken. I got it going again in my Fedora environment. Most of the patches are just cleanups, but there *were* three real bugs lurking in all that sparse warning spam. So I maintain that it''s worth our time to keep it going and fix