All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Dmitry V. Levin" <ldv@altlinux.org>
To: Lauro Ramos Venancio <lauro.venancio@openbossa.org>,
	Aloisio Almeida Jr <aloisio.almeida@openbossa.org>,
	Samuel Ortiz <sameo@linux.intel.com>,
	Thomas Gleixner <tglx@linutronix.de>,
	Ingo Molnar <mingo@redhat.com>, "H. Peter Anvin" <hpa@zytor.com>
Cc: linux-wireless@vger.kernel.org, x86@kernel.org,
	linux-mips@linux-mips.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/2] uapi: fix definition of struct sockaddr_nfc_llcp on x32 and mips n32
Date: Tue, 21 Feb 2017 00:28:14 +0300	[thread overview]
Message-ID: <20170220212814.GA13795@altlinux.org> (raw)
In-Reply-To: <20170220181533.GA11185@altlinux.org>

On Mon, Feb 20, 2017 at 09:15:33PM +0300, Dmitry V. Levin wrote:
> Replace size_t with __kernel_size_t to fix definition of struct
> sockaddr_nfc_llcp on architectures like x32 and mips n32 where
> sizeof(size_t) < sizeof(__kernel_size_t).
> 
> This also fixes the following linux/nfc.h userspace compilation error:
> 
> /usr/include/linux/nfc.h:279:2: error: unknown type name 'size_t'
>   size_t service_name_len;
> 
> Cc: stable@vger.kernel.org
> Signed-off-by: Dmitry V. Levin <ldv@altlinux.org>
> ---
>  include/uapi/linux/nfc.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/include/uapi/linux/nfc.h b/include/uapi/linux/nfc.h
> index 399f39f..f8ccc12 100644
> --- a/include/uapi/linux/nfc.h
> +++ b/include/uapi/linux/nfc.h
> @@ -276,7 +276,7 @@ struct sockaddr_nfc_llcp {
>  	__u8 dsap; /* Destination SAP, if known */
>  	__u8 ssap; /* Source SAP to be bound to */
>  	char service_name[NFC_LLCP_MAX_SERVICE_NAME]; /* Service name URI */;
> -	size_t service_name_len;
> +	__kernel_size_t service_name_len;
>  };
>  
>  /* NFC socket protocols */

Unfortunately, this is not the right fix for the problem.

It was definitely a bad idea to use architecture dependent types
in the definition of struct sockaddr_nfc_llcp.  Somebody will have
to implement a compat layer to make it work properly with x86, x32,
and other compat personalities.


-- 
ldv

      reply	other threads:[~2017-02-20 21:28 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-02-20 18:15 [PATCH 1/2] uapi: fix definition of struct sockaddr_nfc_llcp on x32 and mips n32 Dmitry V. Levin
2017-02-20 21:28 ` Dmitry V. Levin [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170220212814.GA13795@altlinux.org \
    --to=ldv@altlinux.org \
    --cc=aloisio.almeida@openbossa.org \
    --cc=hpa@zytor.com \
    --cc=lauro.venancio@openbossa.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mips@linux-mips.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=sameo@linux.intel.com \
    --cc=tglx@linutronix.de \
    --cc=x86@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.