Re: [PATCH v4 1/2] i2c-tools: Allow passing device file paths
"Brigham Campbell" <[email protected]>
| Newsgroups | org.kernel.vger.linux-i2c |
|---|---|
| Message-ID | <[email protected]> |
Hi Gero, On Tue Jul 14, 2026 at 3:42 AM MDT, Gero Schwäricke wrote: > On Mon Jul 13, 2026 at 5:38 PM CEST, Brigham Campbell wrote: >> Maybe it would be easier to understand an approach which simply >> increases the size of the filename buffer to PATH_MAX from limits.h and >> just copies the path directly into the buffer via strcpy? I had >> considered this approach. In this case, I might consider moving the >> (much bigger) buffer from the stack to the heap so as not to overrun the >> stack frame... > > hm, simpler to understand indeed, but 4k is a significant allocation for > smaller targets. I'm a bit torn. In the end both are valid options, but > I think your implementation is fine as is. Maybe just add a comment why > we assign the pointer instead of copying into the buffer, so the intent > is made clear. I'll keep it as-is and add a comment for the next revision, then. >> I appreciate the feedback >> I've received from you and Gero. Woops, I meant to say you and Wolfram. I went backpacking last weekend. Clearly, the Utah heat wave fried my brain! -- Brigham Campbell https://brighamcampbell.com