Re: [PATCH v4 00/13] Introduce parity_odd() and refactor redundant parity code

2025-04-26 Thread Kuan-Wei Chiu
On Fri, Apr 25, 2025 at 12:33:21PM -0700, H. Peter Anvin wrote: > On 4/11/25 09:34, Kuan-Wei Chiu wrote: > > > > > > In either case, instead of packing the cascade into one function, make > > > good > > > use of it. > > > > > > In the latter case, __builtin_constant_p() isn't necessary as it put

Re: [PATCH v4 00/13] Introduce parity_odd() and refactor redundant parity code

2025-04-25 Thread H. Peter Anvin
On 4/11/25 09:34, Kuan-Wei Chiu wrote: In either case, instead of packing the cascade into one function, make good use of it. In the latter case, __builtin_constant_p() isn't necessary as it puts the onus on the architecture to separate out const and non-const cases, if it matters -- which it d

Re: [PATCH v4 00/13] Introduce parity_odd() and refactor redundant parity code

2025-04-11 Thread Kuan-Wei Chiu
On Wed, Apr 09, 2025 at 07:09:28PM -0700, H. Peter Anvin wrote: > On 4/9/25 11:33, Yury Norov wrote: > > > > > > > I don't have a strong preference for the name, but if I had to guess > > > the return value from the function prototype, I would intuitively > > > expect an int to return "0 for even

Re: [PATCH v4 00/13] Introduce parity_odd() and refactor redundant parity code

2025-04-09 Thread H. Peter Anvin
On 4/9/25 11:33, Yury Norov wrote: I don't have a strong preference for the name, but if I had to guess the return value from the function prototype, I would intuitively expect an int to return "0 for even and 1 for odd," and a bool to return "true for even, false for odd." I recall Jiri and Ja

Re: [PATCH v4 00/13] Introduce parity_odd() and refactor redundant parity code

2025-04-09 Thread Yury Norov
On Thu, Apr 10, 2025 at 02:15:30AM +0800, Kuan-Wei Chiu wrote: > On Wed, Apr 09, 2025 at 12:54:35PM -0400, Yury Norov wrote: > > On Wed, Apr 09, 2025 at 11:43:43PM +0800, Kuan-Wei Chiu wrote: > > > Several parts of the kernel contain open-coded and redundant > > > implementations of parity calculat

Re: [PATCH v4 00/13] Introduce parity_odd() and refactor redundant parity code

2025-04-09 Thread Kuan-Wei Chiu
On Wed, Apr 09, 2025 at 12:54:35PM -0400, Yury Norov wrote: > On Wed, Apr 09, 2025 at 11:43:43PM +0800, Kuan-Wei Chiu wrote: > > Several parts of the kernel contain open-coded and redundant > > implementations of parity calculation. This patch series introduces > > a unified helper, parity_odd(), t

Re: [PATCH v4 00/13] Introduce parity_odd() and refactor redundant parity code

2025-04-09 Thread Yury Norov
On Wed, Apr 09, 2025 at 11:43:43PM +0800, Kuan-Wei Chiu wrote: > Several parts of the kernel contain open-coded and redundant > implementations of parity calculation. This patch series introduces > a unified helper, parity_odd(), to simplify and standardize these > cases. > > The first patch renam