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: <20201105120640.5ltlf4vu5vmkf3xl@skbuf>
Date:   Thu, 5 Nov 2020 14:06:40 +0200
From:   Vladimir Oltean <olteanv@...il.com>
To:     Marek Behún <kabel@...nel.org>
Cc:     netdev@...r.kernel.org, linux-usb@...r.kernel.org,
        Hayes Wang <hayeswang@...ltek.com>
Subject: Re: [PATCH net-next 3/5] r8152: add MCU typed read/write functions

On Thu, Nov 05, 2020 at 12:30:43PM +0100, Marek Behún wrote:
> On Thu, 5 Nov 2020 12:56:42 +0200
> Vladimir Oltean <olteanv@...il.com> wrote:
>
> > On Thu, Nov 05, 2020 at 10:54:18AM +0100, Marek Behún wrote:
> > > I thought that static inline functions are preferred to macros, since
> > > compiler warns better if they are used incorrectly...
> >
> > Citation needed.
>
> Just search for substring "instead of macro" in git log, there are
> multiple such changes that were accepted since it provides better
> typechecking. I am not saying it is documented anywhere, just that I
> thought it was preffered.
>
> > Also, how do static inline functions wrapped in macros
> > (i.e. your patch) stack up against your claim about better warnings?
>
> If they are defined as functions (they don't have to be inline,
> of course) instead of macros and they are used incorrectly, the compiler
> provides more readable warnings. (Yes, in current versions of gcc it is
> much better than in the past, but still there are more lines of
> warnings printed: "in expansion of macro"...).

Ok, but I mean, we're not even in contradiction at this point? I only
provided you macro definitions of pla_ocp_* and usb_ocp_* to prove that
they can be defined in a cleaner way than your attempt. If you still
think it's worth having the pla_ocp_* and usb_ocp_* helpers defined as
separate functions just to avoid passing the extra MCU_TYPE_* argument,
then go ahead.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ