From owner-svn-src-all@freebsd.org Mon Nov 30 17:04:15 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 6E0BD4A2ADB for ; Mon, 30 Nov 2020 17:04:15 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-qk1-x72e.google.com (mail-qk1-x72e.google.com [IPv6:2607:f8b0:4864:20::72e]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4ClBR32KhKz3vft for ; Mon, 30 Nov 2020 17:04:15 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-qk1-x72e.google.com with SMTP id q22so11475251qkq.6 for ; Mon, 30 Nov 2020 09:04:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=fYtE6S0oR/+LlHTdDE9+1Oe2fX9JFvzCtA7tK+vxzEw=; b=e7YtjcGUGTWXiPSh1/eQD77rA86e36DETFoY9TzlaXBsGTOIV02Urk2yrcH9tW6HXz y54BzeC8zXjgdr1nzRF99sAnHFTcn76fK9TfjCWgXF/dG9q4J619XoUwpcorDxT1/vnH rUOdmM9cKK6HxOaBX/xKpx/g9ASQrLEdCk/ipfeiFya50eSAMHcgAzbNMeh8RvlS41NV jqKShJtnd7PI+B/9xZpjTvJ7KhL4lHzrFLf+spZcxLYrBsyza/+vxpxUmgh4WcGH6dXy /CI8ZrE98P0AqocCDDBEyxfz4KaHDrrg/a+Z2ohkrBKvaBcHmujxljrmMKZYToI1TxIx atnA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=fYtE6S0oR/+LlHTdDE9+1Oe2fX9JFvzCtA7tK+vxzEw=; b=h5/9Jkn/LRXHL60QnqNH/noIAwAcDvzvvFqmmJpJMSUQ/EJo2MoyRiLGOZF52Du8VE 8W338V2IwAOgeICOKY2iyfpNwrcF9UZrsnqFZKVCw8RYOYuYtTF0sMo1t4GjID2YUOUY odLRo10VE9gV75WyDRUePN8HF9Nmq7ozrYiEU7g38KBnuhai36uM8Ls5QmTSr3kOzDUL dPmqEOoS8qbK7QSTEVNa0AWlrka6/u3Pp20AOoK683MwLqG1RZugzEnLUuf8wdcyQx8K OCnnUbQTqbyqiDvrN2K8o6v1IgzvEqavv4/NpGvCyMsoIGqL+24PJchZnxn2+liRk8cA rhgw== X-Gm-Message-State: AOAM5334Y/9+X6BaEdvGe4zVCA7/o2EzN4gdsfgLnaNjsPv4QOM2dbFS SpsZH2uCt43RMByAKpDLLwQ/dsCSj5T5GeyIk+tIMg== X-Google-Smtp-Source: ABdhPJyOFha1yCWcxSb9RjPhbtjhtBpSorRGS7EpiTzZ241SdP+MlHUpIwbINwfJkpbZQvREn8FjEYuKOVXipVFS16g= X-Received: by 2002:a37:78c:: with SMTP id 134mr24248489qkh.359.1606755854248; Mon, 30 Nov 2020 09:04:14 -0800 (PST) MIME-Version: 1.0 References: <202011301451.0AUEpn9w002536@repo.freebsd.org> <5bd6eb969c3a198246ab915257375b02c7b14e0c.camel@freebsd.org> In-Reply-To: From: Warner Losh Date: Mon, 30 Nov 2020 10:04:02 -0700 Message-ID: Subject: Re: svn commit: r368187 - head/sys/dev/nvme To: Michal Meloun Cc: Ian Lepore , src-committers , svn-src-all , svn-src-head X-Rspamd-Queue-Id: 4ClBR32KhKz3vft X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.34 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 30 Nov 2020 17:04:15 -0000 On Mon, Nov 30, 2020 at 9:56 AM Michal Meloun wrote: > > > On 30.11.2020 17:02, Ian Lepore wrote: > > 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. > > > > I understand, (and I have significant tendency to agree) but I did not > find more correct way how to do it. > Are you sure that __unused is defined as *potentially* unused? I cannot > find nothing about this and you known how are compiler guys creative > with generating of new warnings... > I known that C++17 have 'maybe_unused' attribute, but relationship to > standard '__unused' looks unclear. > > In any case, I have not single problem to change this to the proposed > style if we found that this is the optimal way. > __unused means 'don't warn me if this is unused' elsewhere in the tree. Better to use it here. Warner