All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Christian König" <christian.koenig@amd.com>
To: Jani Nikula <jani.nikula@intel.com>, linux-kernel@vger.kernel.org
Cc: intel-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org,
	Andrew Morton <akpm@linux-foundation.org>,
	David Gow <davidgow@google.com>
Subject: Re: [PATCH 0/4] log2: make is_power_of_2() more generic
Date: Thu, 30 Mar 2023 12:59:18 +0200	[thread overview]
Message-ID: <7e7fa796-2614-92ea-012b-aa04f04a7312@amd.com> (raw)
In-Reply-To: <20230330104243.2120761-1-jani.nikula@intel.com>

Am 30.03.23 um 12:42 schrieb Jani Nikula:
> is_power_of_2() only works for types <= sizeof(unsigned long) and it's
> also not a constant expression. There are a number of places in kernel
> where is_power_of_2() is called on u64, which fails on 32-bit
> builds. Try to remedy that. While at it, make it a constant expression
> when possible.
>
> I admit I've only lightly tested this, and I haven't tried it with
> allmodconfig.

Looks good to me from a one mile high level pov. But I'm really not an 
expert on that type of compiler magic, so only:

Acked-by: Christian König <christian.koenig@amd.com>

for the series.

Regards,
Christian.

>
>
> Jani Nikula (4):
>    log2: add helper __IS_POWER_OF_2()
>    log2: have is_power_of_2() support bigger types than unsigned long
>    log2: allow use of is_power_of_2() in constant expressions
>    drm/i915/reg: use is_power_of_2() from log2.h
>
>   drivers/gpu/drm/i915/i915_reg_defs.h |  7 +------
>   include/linux/log2.h                 | 25 ++++++++++++++++++++-----
>   2 files changed, 21 insertions(+), 11 deletions(-)
>


WARNING: multiple messages have this Message-ID (diff)
From: "Christian König" <christian.koenig@amd.com>
To: Jani Nikula <jani.nikula@intel.com>, linux-kernel@vger.kernel.org
Cc: David Gow <davidgow@google.com>,
	intel-gfx@lists.freedesktop.org,
	Andrew Morton <akpm@linux-foundation.org>,
	dri-devel@lists.freedesktop.org
Subject: Re: [PATCH 0/4] log2: make is_power_of_2() more generic
Date: Thu, 30 Mar 2023 12:59:18 +0200	[thread overview]
Message-ID: <7e7fa796-2614-92ea-012b-aa04f04a7312@amd.com> (raw)
In-Reply-To: <20230330104243.2120761-1-jani.nikula@intel.com>

Am 30.03.23 um 12:42 schrieb Jani Nikula:
> is_power_of_2() only works for types <= sizeof(unsigned long) and it's
> also not a constant expression. There are a number of places in kernel
> where is_power_of_2() is called on u64, which fails on 32-bit
> builds. Try to remedy that. While at it, make it a constant expression
> when possible.
>
> I admit I've only lightly tested this, and I haven't tried it with
> allmodconfig.

Looks good to me from a one mile high level pov. But I'm really not an 
expert on that type of compiler magic, so only:

Acked-by: Christian König <christian.koenig@amd.com>

for the series.

Regards,
Christian.

>
>
> Jani Nikula (4):
>    log2: add helper __IS_POWER_OF_2()
>    log2: have is_power_of_2() support bigger types than unsigned long
>    log2: allow use of is_power_of_2() in constant expressions
>    drm/i915/reg: use is_power_of_2() from log2.h
>
>   drivers/gpu/drm/i915/i915_reg_defs.h |  7 +------
>   include/linux/log2.h                 | 25 ++++++++++++++++++++-----
>   2 files changed, 21 insertions(+), 11 deletions(-)
>


WARNING: multiple messages have this Message-ID (diff)
From: "Christian König" <christian.koenig@amd.com>
To: Jani Nikula <jani.nikula@intel.com>, linux-kernel@vger.kernel.org
Cc: David Gow <davidgow@google.com>,
	intel-gfx@lists.freedesktop.org,
	Andrew Morton <akpm@linux-foundation.org>,
	dri-devel@lists.freedesktop.org
Subject: Re: [Intel-gfx] [PATCH 0/4] log2: make is_power_of_2() more generic
Date: Thu, 30 Mar 2023 12:59:18 +0200	[thread overview]
Message-ID: <7e7fa796-2614-92ea-012b-aa04f04a7312@amd.com> (raw)
In-Reply-To: <20230330104243.2120761-1-jani.nikula@intel.com>

Am 30.03.23 um 12:42 schrieb Jani Nikula:
> is_power_of_2() only works for types <= sizeof(unsigned long) and it's
> also not a constant expression. There are a number of places in kernel
> where is_power_of_2() is called on u64, which fails on 32-bit
> builds. Try to remedy that. While at it, make it a constant expression
> when possible.
>
> I admit I've only lightly tested this, and I haven't tried it with
> allmodconfig.

Looks good to me from a one mile high level pov. But I'm really not an 
expert on that type of compiler magic, so only:

Acked-by: Christian König <christian.koenig@amd.com>

for the series.

Regards,
Christian.

>
>
> Jani Nikula (4):
>    log2: add helper __IS_POWER_OF_2()
>    log2: have is_power_of_2() support bigger types than unsigned long
>    log2: allow use of is_power_of_2() in constant expressions
>    drm/i915/reg: use is_power_of_2() from log2.h
>
>   drivers/gpu/drm/i915/i915_reg_defs.h |  7 +------
>   include/linux/log2.h                 | 25 ++++++++++++++++++++-----
>   2 files changed, 21 insertions(+), 11 deletions(-)
>


  parent reply	other threads:[~2023-03-30 10:59 UTC|newest]

Thread overview: 41+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-30 10:42 [PATCH 0/4] log2: make is_power_of_2() more generic Jani Nikula
2023-03-30 10:42 ` [Intel-gfx] " Jani Nikula
2023-03-30 10:42 ` Jani Nikula
2023-03-30 10:42 ` [PATCH 1/4] log2: add helper __IS_POWER_OF_2() Jani Nikula
2023-03-30 10:42   ` [Intel-gfx] " Jani Nikula
2023-03-30 10:42   ` Jani Nikula
2023-03-30 10:42 ` [PATCH 2/4] log2: have is_power_of_2() support bigger types than unsigned long Jani Nikula
2023-03-30 10:42   ` [Intel-gfx] " Jani Nikula
2023-03-30 10:42   ` Jani Nikula
2023-03-30 10:42 ` [PATCH 3/4] log2: allow use of is_power_of_2() in constant expressions Jani Nikula
2023-03-30 10:42   ` [Intel-gfx] " Jani Nikula
2023-03-30 10:42   ` Jani Nikula
2023-03-30 10:42 ` [PATCH 4/4] drm/i915/reg: use is_power_of_2() from log2.h Jani Nikula
2023-03-30 10:42   ` [Intel-gfx] " Jani Nikula
2023-03-30 10:42   ` Jani Nikula
2023-03-30 10:59 ` Christian König [this message]
2023-03-30 10:59   ` [Intel-gfx] [PATCH 0/4] log2: make is_power_of_2() more generic Christian König
2023-03-30 10:59   ` Christian König
2023-03-30 11:10 ` [Intel-gfx] ✗ Fi.CI.CHECKPATCH: warning for " Patchwork
2023-03-30 11:10 ` [Intel-gfx] ✗ Fi.CI.SPARSE: " Patchwork
2023-03-30 11:23 ` [Intel-gfx] ✓ Fi.CI.BAT: success " Patchwork
2023-03-30 19:50 ` [PATCH 0/4] " Andrew Morton
2023-03-30 19:50   ` [Intel-gfx] " Andrew Morton
2023-03-30 19:50   ` Andrew Morton
2023-03-30 21:53   ` David Laight
2023-03-30 21:53     ` [Intel-gfx] " David Laight
2023-03-30 21:53     ` David Laight
2023-03-30 22:18     ` Andrew Morton
2023-03-30 22:18       ` Andrew Morton
2023-03-30 22:18       ` [Intel-gfx] " Andrew Morton
2023-03-31  7:33       ` David Laight
2023-03-31  7:33         ` [Intel-gfx] " David Laight
2023-03-31  7:33         ` David Laight
2023-03-31  8:31       ` Jani Nikula
2023-03-31  8:31         ` [Intel-gfx] " Jani Nikula
2023-03-31  8:31         ` Jani Nikula
2023-04-05 15:27         ` Steven Price
2023-04-05 15:27           ` [Intel-gfx] " Steven Price
2023-04-05 15:27           ` Steven Price
2024-04-12 10:01           ` Jani Nikula
2023-03-31  5:58 ` [Intel-gfx] ✓ Fi.CI.IGT: success for " Patchwork

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=7e7fa796-2614-92ea-012b-aa04f04a7312@amd.com \
    --to=christian.koenig@amd.com \
    --cc=akpm@linux-foundation.org \
    --cc=davidgow@google.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=jani.nikula@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.