From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) (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 38A1921197376 for ; Mon, 14 Jan 2019 12:51:52 -0800 (PST) From: Jeff Moyer Subject: Re: [PATCH] acpi/nfit: Fix command-supported detection References: <154725096972.1367907.12968253382302127133.stgit@dwillia2-desk3.amr.corp.intel.com> Date: Mon, 14 Jan 2019 15:51:49 -0500 In-Reply-To: (Dan Williams's message of "Mon, 14 Jan 2019 08:47:49 -0800") Message-ID: MIME-Version: 1.0 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: linux-nvdimm-bounces@lists.01.org Sender: "Linux-nvdimm" To: Dan Williams Cc: Sujith Pandel , Linux Kernel Mailing List , stable , linux-nvdimm List-ID: Dan Williams writes: > On Mon, Jan 14, 2019 at 8:43 AM Dan Williams wrote: >> On Mon, Jan 14, 2019 at 7:19 AM Jeff Moyer wrote: > [..] >> > > + >> > > + if (cmd == ND_CMD_CALL) { >> > > + int i; >> > > + >> > > + if (call_pkg && nfit_mem->family != call_pkg->nd_family) >> > > + return -ENOTTY; >> > > + >> > > + for (i = 0; i < ARRAY_SIZE(call_pkg->nd_reserved2); i++) >> > > + if (call_pkg->nd_reserved2[i]) >> > > + return -EINVAL; >> > > + return call_pkg->nd_command; >> > > + } >> > > + >> > > + /* Linux ND commands == NVDIMM_FAMILY_INTEL function numbers */ >> > > + if (nfit_mem->family == NVDIMM_FAMILY_INTEL) >> > > + return cmd; >> > > + return 0; >> > >> > Function zero? Is that really the right thing to return here? >> >> Yes, function zero is never set in n > > ...whoops fumble fingered "send" > > Function zero should never be set in nfit_mem->dsm_mask, although the > NVDIMM_FAMILY_MSFT mask violates this assumption. I'll fix that up. OK, I think I see how it all fits together now, thanks. It would be nice if you documented this magical 0 return somehow. Cheers, Jeff _______________________________________________ Linux-nvdimm mailing list Linux-nvdimm@lists.01.org https://lists.01.org/mailman/listinfo/linux-nvdimm