linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jason Gunthorpe <jgunthorpe@obsidianresearch.com>
To: Arnd Bergmann <arnd@arndb.de>
Cc: Peter Huewe <peterhuewe@gmx.de>,
	Marcel Selhorst <tpmdd@selhorst.net>,
	Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>,
	Colin Ian King <colin.king@canonical.com>,
	tpmdd-devel@lists.sourceforge.net, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] tpm: constify transmit data pointers
Date: Thu, 7 Sep 2017 14:01:53 -0600	[thread overview]
Message-ID: <20170907200153.GA6350@obsidianresearch.com> (raw)
In-Reply-To: <20170907133130.2463746-1-arnd@arndb.de>

On Thu, Sep 07, 2017 at 03:30:45PM +0200, Arnd Bergmann wrote:
> Making cmd_getticks 'const' introduced a couple of harmless warnings:
> 
> drivers/char/tpm/tpm_tis_core.c: In function 'probe_itpm':
> drivers/char/tpm/tpm_tis_core.c:469:31: error: passing argument 2 of 'tpm_tis_send_data' discards 'const' qualifier from pointer target type [-Werror=discarded-qualifiers]
>   rc = tpm_tis_send_data(chip, cmd_getticks, len);
> drivers/char/tpm/tpm_tis_core.c:477:31: error: passing argument 2 of 'tpm_tis_send_data' discards 'const' qualifier from pointer target type [-Werror=discarded-qualifiers]
>   rc = tpm_tis_send_data(chip, cmd_getticks, len);
> drivers/char/tpm/tpm_tis_core.c:255:12: note: expected 'u8 * {aka unsigned char *}' but argument is of type 'const u8 * {aka const unsigned char *}'
>  static int tpm_tis_send_data(struct tpm_chip *chip, u8 *buf, size_t len)
> 
> This changes the related functions to all take 'const' pointers
> so that gcc can see this as being correct. I had to slightly
> modify the logic around tpm_tis_spi_transfer() for this to work
> without introducing ugly casts.
> 
> Fixes: 5e35bd8e06b9 ("tpm_tis: make array cmd_getticks static const to shink object code size")
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>

Reviewed-by: Jason Gunthorpe <jgunthorpe@obsidianresearch.com>

Bit confused how the compile warnings introduced by the original patch
were missed?? Jarkko do you run compile tests and sparse before
sending pull requests?

Cheers,
Jason

  parent reply	other threads:[~2017-09-07 20:02 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-09-07 13:30 [PATCH] tpm: constify transmit data pointers Arnd Bergmann
2017-09-07 16:24 ` Jarkko Sakkinen
2017-09-08 20:58   ` Arnd Bergmann
2017-09-08 21:46     ` Jarkko Sakkinen
2017-09-07 20:01 ` Jason Gunthorpe [this message]
2017-09-08 21:28   ` Jarkko Sakkinen

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=20170907200153.GA6350@obsidianresearch.com \
    --to=jgunthorpe@obsidianresearch.com \
    --cc=arnd@arndb.de \
    --cc=colin.king@canonical.com \
    --cc=jarkko.sakkinen@linux.intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=peterhuewe@gmx.de \
    --cc=tpmdd-devel@lists.sourceforge.net \
    --cc=tpmdd@selhorst.net \
    /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;
as well as URLs for NNTP newsgroup(s).