lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <663db13b464f8_25b78929486@iweiny-mobl.notmuch>
Date: Thu, 9 May 2024 22:31:39 -0700
From: Ira Weiny <ira.weiny@...el.com>
To: Dan Williams <dan.j.williams@...el.com>, Ira Weiny <ira.weiny@...el.com>,
	Jonathan Cameron <Jonathan.Cameron@...wei.com>
CC: Dave Jiang <dave.jiang@...el.com>, Fan Ni <fan.ni@...sung.com>, "Navneet
 Singh" <navneet.singh@...el.com>, Dan Williams <dan.j.williams@...el.com>,
	Davidlohr Bueso <dave@...olabs.net>, Alison Schofield
	<alison.schofield@...el.com>, Vishal Verma <vishal.l.verma@...el.com>,
	<linux-btrfs@...r.kernel.org>, <linux-cxl@...r.kernel.org>,
	<linux-kernel@...r.kernel.org>
Subject: Re: [PATCH 06/26] cxl/port: Add Dynamic Capacity mode support to
 endpoint decoders

Dan Williams wrote:
> Ira Weiny wrote:
> [..]
> > > > +	case CXL_DECODER_DC0 ... CXL_DECODER_DC7:
> > > > +		rc = dc_mode_to_region_index(mode);
> > > > +		if (rc < 0)
> > > > +			return rc;
> > > 
> > > Can't fail, so you could not bother checking..  Seems very unlikely
> > > that function will gain other error cases in the future.
> > 
> > Sure, done.
> 
> Can dc_mode_to_region_index() be dropped altogether? Is there any
> scenario where dc_mode_to_region_index() is really handling an anonymous
> @mode argument? I.e. just replace all dc_mode_to_region_index() with
> "mode - CXL_DECODER_DC0"?

Once we open up DC partitions to support multiple regions, no.

How about we remove the check in dc_mode_to_region_index() but keep the
function?  That makes it clear that we are converting from an enum to int
index?

Ira

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ