From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=0.8 required=3.0 tests=BAYES_05,DKIM_ADSP_CUSTOM_MED, FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id CA14FC433B4 for ; Fri, 16 Apr 2021 17:34:07 +0000 (UTC) Received: from ml01.01.org (ml01.01.org [198.145.21.10]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 30C6F6124B for ; Fri, 16 Apr 2021 17:34:06 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 30C6F6124B Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-nvdimm-bounces@lists.01.org Received: from ml01.vlan13.01.org (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id CDC6A100EAB68; Fri, 16 Apr 2021 10:34:06 -0700 (PDT) Received-SPF: Softfail (mailfrom) identity=mailfrom; client-ip=134.134.136.24; helo=mga09.intel.com; envelope-from=andy.shevchenko@gmail.com; receiver= Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 1585E100EC1CE for ; Fri, 16 Apr 2021 10:34:03 -0700 (PDT) IronPort-SDR: RjNjenYLQgHytLfIC/qinaWkn9QS5uufXS/Q5bSLiavhQMLn2/b/ejyjyQnpqvHAJGzq7MH2Vp 0uj5/O3Wtctw== X-IronPort-AV: E=McAfee;i="6200,9189,9956"; a="195187178" X-IronPort-AV: E=Sophos;i="5.82,226,1613462400"; d="scan'208";a="195187178" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 16 Apr 2021 10:34:00 -0700 IronPort-SDR: tQrUzqzEe3V356yqOX8dVKzGb6oKF+Dpyp4L/dGsykNQFKvpC6rCseUSSOQKMjSHKIaMDLo+Fk 6DHuR+ZeKZYA== X-IronPort-AV: E=Sophos;i="5.82,226,1613462400"; d="scan'208";a="425668212" Received: from smile.fi.intel.com (HELO smile) ([10.237.68.40]) by orsmga008-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 16 Apr 2021 10:33:58 -0700 Received: from andy by smile with local (Exim 4.94) (envelope-from ) id 1lXSLr-004iQM-GJ; Fri, 16 Apr 2021 20:33:55 +0300 Date: Fri, 16 Apr 2021 20:33:55 +0300 From: Andy Shevchenko To: Dan Williams Subject: Re: [PATCH v1 1/1] ACPI: NFIT: Import GUID before use Message-ID: References: <20210415135901.47131-1-andriy.shevchenko@linux.intel.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo Message-ID-Hash: 5U6T62RKINS3XQLEI2Q5N62XHPMFE5KK X-Message-ID-Hash: 5U6T62RKINS3XQLEI2Q5N62XHPMFE5KK X-MailFrom: andy.shevchenko@gmail.com X-Mailman-Rule-Hits: nonmember-moderation X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation CC: linux-nvdimm , Linux ACPI , Linux Kernel Mailing List , "Rafael J. Wysocki" , Len Brown X-Mailman-Version: 3.1.1 Precedence: list List-Id: "Linux-nvdimm developer list." Archived-At: List-Archive: List-Help: List-Post: List-Subscribe: List-Unsubscribe: Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit On Fri, Apr 16, 2021 at 09:15:34AM -0700, Dan Williams wrote: > On Fri, Apr 16, 2021 at 1:58 AM Andy Shevchenko > wrote: > > On Fri, Apr 16, 2021 at 8:28 AM Dan Williams wrote: > > > On Thu, Apr 15, 2021 at 6:59 AM Andy Shevchenko > > > wrote: > > > > > > > > Strictly speaking the comparison between guid_t and raw buffer > > > > is not correct. Import GUID to variable of guid_t type and then > > > > compare. > > > > > > Hmm, what about something like the following instead, because it adds > > > safety. Any concerns about evaluating x twice in a macro should be > > > alleviated by the fact that ARRAY_SIZE() will fail the build if (x) is > > > not an array. > > > > ARRAY_SIZE doesn't check type. > > See __must_be_array. > > > I don't like hiding ugly casts like this. > > See PTR_ERR, ERR_PTR, ERR_CAST. It's special, i.e. error pointer case. We don't handle such here. > There's nothing broken about the way the code currently stands, so I'd > rather try to find something to move the implementation forward than > sideways. Submit a patch then. I rest my case b/c I consider that ugly castings worse than additional API call, although it's not ideal. -- With Best Regards, Andy Shevchenko _______________________________________________ Linux-nvdimm mailing list -- linux-nvdimm@lists.01.org To unsubscribe send an email to linux-nvdimm-leave@lists.01.org