public inbox for linux-input@vger.kernel.org
 help / color / mirror / Atom feed
From: Jeremiah Mahler <jmmahler@gmail.com>
To: Dudley Du <dudl@cypress.com>
Cc: dmitry.torokhov@gmail.com, rydberg@euromail.se,
	bleung@google.com, dan.carpenter@oracle.com,
	linux-input@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/2] input: cyapa: fix sparse warning issue of incorrect type in assiggment
Date: Thu, 22 Jan 2015 01:31:29 -0800	[thread overview]
Message-ID: <20150122093129.GA7133@hudson.localdomain> (raw)
In-Reply-To: <1421909406-1240-1-git-send-email-dudl@cypress.com>

Dudley,

Mis-spelled 'assiggment' in Subject line.

On Thu, Jan 22, 2015 at 02:50:05PM +0800, Dudley Du wrote:
> Fixes the sparse warning issue of the incorrect type in assignment which
> found by the kbuild test robot.
> 
I wasn't able to reproduce the sparse warning.  Was it for a specific
architecture?  Perhaps include a link to the email sent by the kbuild
test robot.

[...]
>  struct gen5_bl_metadata_row_params {
>  	__le16 size;
> -	__le16 maximun_size;
> +	__le16 maximum_size;
I don't think sparse cares about variable names.
Be sure to note these changes in your log.

>  	__le32 app_start;
>  	__le16 app_len;
>  	__le16 app_crc;
> @@ -1192,67 +1192,69 @@ static int cyapa_gen5_bl_enter(struct cyapa *cyapa)
>  static int cyapa_gen5_check_fw(struct cyapa *cyapa, const struct firmware *fw)
>  {
>  	struct device *dev = &cyapa->client->dev;
> -	struct gen5_bl_metadata_row_params metadata;
> -	struct cyapa_tsg_bin_image *image;
> -	int flash_records_count;
> -	u16 app_crc = 0;
> -	u16 app_integrity_crc = 0;
> -	u16 row_num;
> -	u8 *data;
> +	const struct cyapa_tsg_bin_image *image = (const void *)fw->data;
> +	const struct cyapa_tsg_bin_image_data_record *app_integrity;
> +	const struct gen5_bl_metadata_row_params *metadata;
> +	size_t flash_records_count;
> +	u32 fw_app_start, fw_upgrade_start;
> +	u16 fw_app_len, fw_upgrade_len;
> +	u16 app_crc;
> +	u16 app_integrity_crc;
>  	int record_index;
>  	int i;
>  
> -	image = (struct cyapa_tsg_bin_image *)fw->data;
>  	flash_records_count = (fw->size -
>  			sizeof(struct cyapa_tsg_bin_image_head)) /
>  			sizeof(struct cyapa_tsg_bin_image_data_record);
>  
> -	/* APP_INTEGRITY row is always the last row block,
> -	 * and the row id must be 0x01ff */
> -	row_num = get_unaligned_be16(
> -			&image->records[flash_records_count - 1].row_number);
> -	if (image->records[flash_records_count - 1].flash_array_id != 0x00 &&
> -			row_num != 0x01ff) {
> +	/*
> +	 * APP_INTEGRITY row is always the last row block,
> +	 * and the row id must be 0x01ff.
> +	 */
> +	app_integrity = &image->records[flash_records_count - 1];
> +
> +	if (app_integrity->flash_array_id != 0x00 ||
> +	    get_unaligned_be16(&app_integrity->row_number) != 0x01ff) {
I could be wrong but it looks there are a lot of changes un-related to
the sparse warning.  I am not opposed to this per se but they should be
noted in the log message.

[...]

-- 
- Jeremiah Mahler

  parent reply	other threads:[~2015-01-22  9:31 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-01-22  6:50 [PATCH 1/2] input: cyapa: fix sparse warning issue of incorrect type in assiggment Dudley Du
2015-01-22  6:50 ` [PATCH 2/2] input: cyapa: fix variable dereferenced before check 'gen5_pip->resp_len' issue Dudley Du
2015-01-22 16:22   ` Dmitry Torokhov
2015-01-22  9:31 ` Jeremiah Mahler [this message]
2015-01-22  9:54   ` [PATCH 1/2] input: cyapa: fix sparse warning issue of incorrect type in assiggment Dan Carpenter
2015-01-22  9:58     ` Dudley Du
2015-01-23  9:50     ` Jeremiah Mahler
2015-01-22  9:57   ` Dudley Du
2015-01-23  9:56     ` Jeremiah Mahler

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=20150122093129.GA7133@hudson.localdomain \
    --to=jmmahler@gmail.com \
    --cc=bleung@google.com \
    --cc=dan.carpenter@oracle.com \
    --cc=dmitry.torokhov@gmail.com \
    --cc=dudl@cypress.com \
    --cc=linux-input@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rydberg@euromail.se \
    /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