Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 30 Nov 2020 09:02:57 -0700
From:      Ian Lepore <ian@freebsd.org>
To:        Michal Meloun <mmel@FreeBSD.org>, src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   Re: svn commit: r368187 - head/sys/dev/nvme
Message-ID:  <5bd6eb969c3a198246ab915257375b02c7b14e0c.camel@freebsd.org>
In-Reply-To: <202011301451.0AUEpn9w002536@repo.freebsd.org>
References:  <202011301451.0AUEpn9w002536@repo.freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Mon, 2020-11-30 at 14:51 +0000, Michal Meloun wrote:
> Author: mmel
> Date: Mon Nov 30 14:51:48 2020
> New Revision: 368187
> URL: https://svnweb.freebsd.org/changeset/base/368187
> 
> Log:
>   Unbreak r368167 in userland. Decorate unused arguments.
>   
>   Reported by:	kp, tuexen, jenkins, and many others
>   MFC with:	r368167
> 
> Modified:
>   head/sys/dev/nvme/nvme.h
> 
> Modified: head/sys/dev/nvme/nvme.h
> =====================================================================
> =========
> --- head/sys/dev/nvme/nvme.h	Mon Nov 30 14:49:13 2020	(r368186)
> +++ head/sys/dev/nvme/nvme.h	Mon Nov 30 14:51:48 2020	(r368187)
> @@ -1728,9 +1728,15 @@ extern int nvme_use_nvd;
>  
>  #endif /* _KERNEL */
>  
> +#if _BYTE_ORDER != _LITTLE_ENDIAN
> +#define MODIF
> +#else
> +#define MODIF __unused
> +#endif
> +
>  /* Endianess conversion functions for NVMe structs */
>  static inline
> -void	nvme_completion_swapbytes(struct nvme_completion *s)
> +void	nvme_completion_swapbytes(struct nvme_completion *s MODIF)

IMO, this is pretty ugly, it causes the brain to screech to a halt when
you see it.  Why not just add an unconditional __unused to the
functions?  The unused attribute is defined as marking the variable as
"potentially unused" -- there is no penalty for having it there and
then actually using the variable.

-- Ian






Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?5bd6eb969c3a198246ab915257375b02c7b14e0c.camel>