On 4/11/25 1:53 PM, Alison Schofield wrote:
> On Fri, Apr 11, 2025 at 11:47:36AM -0700, Dave Jiang wrote:
>
> big snip...
>
>> + char path[CXL_PATH_MAX];
>
> A bit of minutiae, not directly related to your patch-
>
> I see:
> ndctl keys code, (ndctl/key.s,load-keys) simply use the PATH_MAX which
> I believe comes from limits.h
>
> The rest of ndctl is doing the calloc'ing, like you originally had it.
> (~/git/ndctl$ git grep char | grep alloc)
I get why the current code does the strlen(PATH) + N. It's just adding a little
more to the existing discovered path since it is looking at specific sysfs
paths. So in these cases, PATH_MAX may not be necessary.
DJ
>
> Is it not safe, or is it wasterful, to make all use PATH_MAX?
> Would it be safe-er to make all use a NDCTL_PATH_MAX?
>
> This may be worth tidying up but not clear which way to go.
>
> snip
>