All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stewart Smith <stewart@linux.ibm.com>
To: Eddie James <eajames@linux.vnet.ibm.com>, openbmc@lists.ozlabs.org
Cc: Eddie James <eajames@linux.vnet.ibm.com>
Subject: Re: [PATCH linux dev-4.13] fsi: occ: Add check for OCC response checksum
Date: Tue, 01 May 2018 10:02:24 +1000	[thread overview]
Message-ID: <87po2g6y5r.fsf@linux.vnet.ibm.com> (raw)
In-Reply-To: <1525122321-12244-1-git-send-email-eajames@linux.vnet.ibm.com>

Eddie James <eajames@linux.vnet.ibm.com> writes:
> The OCC specification indicates that it is an error scenario if the
> response checksum doesn't match the sum of the bytes of the response.
> The driver needs to perform this calculation and check, and return an
> error if it's a mismatch.
>
> Signed-off-by: Eddie James <eajames@linux.vnet.ibm.com>
> ---
>  drivers/fsi/fsi-occ.c | 23 +++++++++++++++++++++++
>  1 file changed, 23 insertions(+)
>
> diff --git a/drivers/fsi/fsi-occ.c b/drivers/fsi/fsi-occ.c
> index 45ae13c..16f18df 100644
> --- a/drivers/fsi/fsi-occ.c
> +++ b/drivers/fsi/fsi-occ.c
> @@ -427,6 +427,27 @@ static int occ_release(struct inode *inode, struct file *file)
>  	.release = occ_release,
>  };
>  
> +static int occ_check_sum(struct occ_response *resp, u16 data_length)

Minor nitpick: It looks like 'checksum' is the standard rather than 'check_sum':

[stewart@birb linux]$ ack check_sum|wc -l
133
[stewart@birb linux]$ ack checksum|wc -l
7284

Would a more accurate name be occ_resp_verify_checksum() ? By the name
'occ_check_sum' alone, I'd assume that it was returning the calculated
checksum rather than verifying it.

-- 
Stewart Smith
OPAL Architect, IBM.

      parent reply	other threads:[~2018-05-01  0:02 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-04-30 21:05 [PATCH linux dev-4.13] fsi: occ: Add check for OCC response checksum Eddie James
2018-04-30 23:44 ` Andrew Jeffery
2018-05-01 14:40   ` Eddie James
2018-05-01 15:22     ` Andrew Jeffery
2018-05-01  0:02 ` Stewart Smith [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=87po2g6y5r.fsf@linux.vnet.ibm.com \
    --to=stewart@linux.ibm.com \
    --cc=eajames@linux.vnet.ibm.com \
    --cc=openbmc@lists.ozlabs.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.