lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CABXOdTehAeB+9RZqwU=UK1rMHpweXKdawegKBqQ=TA0UPKLdxw@mail.gmail.com>
Date:	Thu, 14 Jul 2016 20:48:40 -0700
From:	Guenter Roeck <groeck@...gle.com>
To:	Andrey Pronin <apronin@...omium.org>
Cc:	Jason Gunthorpe <jgunthorpe@...idianresearch.com>,
	Jarkko Sakkinen <jarkko.sakkinen@...ux.intel.com>,
	Peter Huewe <peterhuewe@....de>,
	Marcel Selhorst <tpmdd@...horst.net>,
	tpmdd-devel@...ts.sourceforge.net,
	linux-kernel <linux-kernel@...r.kernel.org>,
	Guenter Roeck <groeck@...omium.org>, smbarber@...omium.org,
	Douglas Anderson <dianders@...omium.org>
Subject: Re: [PATCH 1/2] tpm_tis_core: add optional max xfer size check

On Thu, Jul 14, 2016 at 8:25 PM, Andrey Pronin <apronin@...omium.org> wrote:
> On Thu, Jul 14, 2016 at 09:13:51PM -0600, Jason Gunthorpe wrote:
>> On Thu, Jul 14, 2016 at 06:39:04PM -0700, Andrey Pronin wrote:
>>
>> > +static inline u16 tpm_tis_max_xfer_size(struct tpm_tis_data *data)
>> > +{
>> > +   return data->phy_ops->max_xfer_size;
>> > +}
>> > +
>> > +static inline bool tpm_tis_burstcnt_is_valid(struct tpm_tis_data *data,
>> > +                                        u16 burstcnt)
>> > +{
>> > +   return (tpm_tis_max_xfer_size(data) == 0)
>> > +           || (burstcnt <= tpm_tis_max_xfer_size(data));
>> > +}
>>
>> We don't need these accessors, just open code it in the one call
>> site. That is more clear as the ==0 case is important to understand
>> that the flow is correct.
>>
>> BTW, I dodn't think || as the start of a line was cannonical kernel
>> style.. Did checkpatch accept that?
>>
>> Jason
>
> You mean completely open code it inside get_burstcount()? Will do.
> checkpatch.pl had no problems with it, but I can move it to the end
> of the line, if it feels better.
>

I would suggest to use checkpatch --strict; it will tell you. It will
also ask you to align continuation lines with '(' on the previous
line. On that, I would suggest to follow the style used in the file(s)
you are working on (or follow guidance from the maintainer).

Thanks,
Guenter

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ