[PATCH v2] staging: ccree: fixed pointer signedness warnings.

Jeremy Sowden jeremy at azazel.net
Thu Dec 21 18:25:40 UTC 2017


On 2017-12-21, at 18:51:09 +0100, Greg KH wrote:
> On Thu, Dec 21, 2017 at 05:28:00PM +0000, Jeremy Sowden wrote:
> > Changed the types of a number of index and length variables and the
> > return-types of a couple of functions that return values which are
> > assigned to a couple of these variables from signed to unsigned integer
> > types.
> >
> > Fixes a number of warnings arising from the variables' addresses being
> > passed to functions expecting pointers to unsigned integers.
> >
> > Signed-off-by: Jeremy Sowden <jeremy at azazel.net>
> > ---
> >  drivers/staging/ccree/ssi_aead.c       | 13 ++++++++-----
> >  drivers/staging/ccree/ssi_buffer_mgr.c |  2 +-
> >  drivers/staging/ccree/ssi_cipher.c     |  3 ++-
> >  drivers/staging/ccree/ssi_hash.c       | 15 ++++++++-------
> >  4 files changed, 19 insertions(+), 14 deletions(-)
>
> What changed from v1?
>
> Always put that below the --- line, like the documentation says to do.

Apologies.  Time to re-read the doc's.

I amended the change-log to include an explanation of the changes to the
function prototypes.

> Also, why are you not cc:ing the maintainer of this driver?

Cc'ed.

> > diff --git a/drivers/staging/ccree/ssi_aead.c b/drivers/staging/ccree/ssi_aead.c
> > index 1522b00e08cf..638e3b515a1f 100644
> > --- a/drivers/staging/ccree/ssi_aead.c
> > +++ b/drivers/staging/ccree/ssi_aead.c
> > @@ -275,7 +275,8 @@ static void cc_aead_complete(struct device *dev, void *cc_req)
> >  	aead_request_complete(areq, err);
> >  }
> >
> > -static int xcbc_setkey(struct cc_hw_desc *desc, struct cc_aead_ctx *ctx)
> > +static unsigned int xcbc_setkey
> > +	(struct cc_hw_desc *desc, struct cc_aead_ctx *ctx)
>
> Why reformat so horridly?

Will fix.

> And why change this function at all?  It can only return '4' (which is
> crazy for other reasons...)  changeing the return value type makes no
> sense to me, why did you make it?

For consistency.  This is one of two similar functions; in this func-
tion, the return-value is hard-coded, in other one it is not, but in
both cases the return-value indicates the number of array elements that
were set in the function, and both return-values are assigned to the
same unsigned integer variable, which was itself changed from signed to
unsigned in this patch.

J.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://driverdev.linuxdriverproject.org/pipermail/driverdev-devel/attachments/20171221/ffdcde65/attachment.asc>


More information about the devel mailing list