From owner-svn-src-head@freebsd.org Mon Nov 30 16:56:40 2020 Return-Path: Delivered-To: svn-src-head@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 0C7164A27D9; Mon, 30 Nov 2020 16:56:40 +0000 (UTC) (envelope-from melounmichal@gmail.com) Received: from mail-ej1-x630.google.com (mail-ej1-x630.google.com [IPv6:2a00:1450:4864:20::630]) (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 4ClBGH6b8Vz3vCF; Mon, 30 Nov 2020 16:56:39 +0000 (UTC) (envelope-from melounmichal@gmail.com) Received: by mail-ej1-x630.google.com with SMTP id a16so23117247ejj.5; Mon, 30 Nov 2020 08:56:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:reply-to:subject:to:references:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=JJAAee3n9JVdv3hIXhc77jmR/YMmlZZyIqdGNc69/u8=; b=szOVBkwGpthPknpT9q0u+l2o0zt2q830JwfqrA300kSTxYWuiV6CeI/khPcLLhdiLe WylesUdkWj7+TbmMGaDNSqP5oHu+k5TUgz5ywA+dyh561wxjGKEFqdQ3ZIjzoE3GeJx3 8TiBRwqX/AnzymMCf9a73A2PDueZIpRg3IqfaG52Y6+Zv56YrPf7swo7xLKey9kVX6VG TMPcv0aAFI9ckm4dCFGnffrIgMxItLP/ciOs+zNdUkjU7CshRN1rK0IotZRdMiqLoUSm dElFdOSCRRIPfdCZbV7RJs4LdL0OsYzUlQpfZP5Tzm6vsDP3Etuth6kCaHzCipgr05jI Cpfw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:reply-to:subject:to:references :message-id:date:user-agent:mime-version:in-reply-to :content-language:content-transfer-encoding; bh=JJAAee3n9JVdv3hIXhc77jmR/YMmlZZyIqdGNc69/u8=; b=D0kSZ761L+xYiI201BWVpxLqfB0eIrTAk1HSviUdUxYYsYMItzP+6DFHrjI+v6YwLu lNuqNV89hfy2FqBpcOLoUgouKz3OLEb5kb6rZZlkhdGTBLryxtKjOTGPZv1AUuR83Xfs 8cCfyHUh2Mqj9vKuynaMPrVZiiG/N8Rc45STHj4KvWYc35jmHdW6RW58mSUfdHFUCxPE Gr4aMc5ZiF4NPPiiO2lcOhsGKKwIRSInjTr8kBCLB4y+rNe5WX9smNT2RjNMqAR7pXja tZL8Dh/FF2FzDLmCf/mXPgMtVROzwfv4h8XHN2zqPa/HwM5ZsNoa2MCrGFBkKI3yuGIt ufEA== X-Gm-Message-State: AOAM532YT0Le6bXUc03+265VYL4YeJQWlF6TOcA3MrSbPlLjojIu61Bj 9UR92C1UKglhcYuZuy/G8V9Q0wVT3EJSJw== X-Google-Smtp-Source: ABdhPJyltabOMxZYrs20a8f2Fr4hDz1zUaccCYd15RjpEIGs+Zpp3C09y8TNfmNeTHYaQKwA8WkGnA== X-Received: by 2002:a17:906:391b:: with SMTP id f27mr19980137eje.195.1606755397865; Mon, 30 Nov 2020 08:56:37 -0800 (PST) Received: from [88.208.79.100] (halouny.humusoft.cz. [88.208.79.100]) by smtp.gmail.com with ESMTPSA id b14sm6738244edx.0.2020.11.30.08.56.37 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 30 Nov 2020 08:56:37 -0800 (PST) Sender: Michal Meloun From: Michal Meloun X-Google-Original-From: Michal Meloun Reply-To: mmel@freebsd.org Subject: Re: svn commit: r368187 - head/sys/dev/nvme To: Ian Lepore , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <202011301451.0AUEpn9w002536@repo.freebsd.org> <5bd6eb969c3a198246ab915257375b02c7b14e0c.camel@freebsd.org> Message-ID: Date: Mon, 30 Nov 2020 17:56:37 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.5.0 MIME-Version: 1.0 In-Reply-To: <5bd6eb969c3a198246ab915257375b02c7b14e0c.camel@freebsd.org> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 4ClBGH6b8Vz3vCF X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; TAGGED_FROM(0.00)[]; REPLY(-4.00)[] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 30 Nov 2020 16:56:40 -0000 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. Michal