public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Dimitri Sivanich <sivanich@hpe.com>
To: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Cc: Xiyu Yang <xiyuyang19@fudan.edu.cn>,
	linux-kernel@vger.kernel.org,
	Dimitri Sivanich <dimitri.sivanich@hpe.com>,
	Arnd Bergmann <arnd@arndb.de>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Subject: Re: [PATCH v1 1/1] misc: sgi-gru: Don't cast parameter in bit operations
Date: Mon, 14 Feb 2022 09:57:09 -0600	[thread overview]
Message-ID: <20220214155709.GA3858@hpe.com> (raw)
In-Reply-To: <20220214153958.9721-1-andriy.shevchenko@linux.intel.com>

Acked-by: Dimitri Sivanich <sivanich@hpe.com>

On Mon, Feb 14, 2022 at 05:39:58PM +0200, Andy Shevchenko wrote:
> While in this particular case (*) it would not be an issue,
> the pattern itself is bad and error prone in case somebody
> blindly copies to their code.
> 
> Don't cast parameter to unsigned long pointer in the bit
> operations. Note, new compilers might warn on this line for
> potential outbound access.
> 
> *) it seems a dead code, so remove it all for good
> 
> Fixes: 13d19498b044 ("GRU Driver: driver internal header files")
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> ---
>  drivers/misc/sgi-gru/grutables.h | 6 ------
>  1 file changed, 6 deletions(-)
> 
> diff --git a/drivers/misc/sgi-gru/grutables.h b/drivers/misc/sgi-gru/grutables.h
> index e4c067c61251..5efc869fe59a 100644
> --- a/drivers/misc/sgi-gru/grutables.h
> +++ b/drivers/misc/sgi-gru/grutables.h
> @@ -530,12 +530,6 @@ struct gru_blade_state {
>  		for ((i) = (k)*GRU_CBR_AU_SIZE;				\
>  				(i) < ((k) + 1) * GRU_CBR_AU_SIZE; (i)++)
>  
> -/* Scan each DSR in a DSR bitmap. Note: multiple DSRs in an allocation unit */
> -#define for_each_dsr_in_allocation_map(i, map, k)			\
> -	for_each_set_bit((k), (const unsigned long *)(map), GRU_DSR_AU)	\
> -		for ((i) = (k) * GRU_DSR_AU_CL;				\
> -				(i) < ((k) + 1) * GRU_DSR_AU_CL; (i)++)
> -
>  #define gseg_physical_address(gru, ctxnum)				\
>  		((gru)->gs_gru_base_paddr + ctxnum * GRU_GSEG_STRIDE)
>  #define gseg_virtual_address(gru, ctxnum)				\
> -- 
> 2.34.1

      reply	other threads:[~2022-02-14 16:20 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-14 15:39 [PATCH v1 1/1] misc: sgi-gru: Don't cast parameter in bit operations Andy Shevchenko
2022-02-14 15:57 ` Dimitri Sivanich [this message]

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=20220214155709.GA3858@hpe.com \
    --to=sivanich@hpe.com \
    --cc=andriy.shevchenko@linux.intel.com \
    --cc=arnd@arndb.de \
    --cc=dimitri.sivanich@hpe.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=xiyuyang19@fudan.edu.cn \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox