Re: [PATCH v3 2/7] staging: sm750fb: unifying macro usage and definitions

From: Matej Dujava
Date: Tue Jun 13 2017 - 03:43:29 EST


On Thu, May 18, 2017 at 03:56:26PM +0200, Greg KH wrote:
> On Tue, May 16, 2017 at 11:20:18AM +0200, Matej Dujava wrote:
> > This patch adds tabs into macro definitions so all rhs are on same column.
> > Move MHz macro from ddk_chip.c to ddk_chip.h.
> >
> > Signed-off-by: Matej Dujava <mdujava@xxxxxxxxxxxx>
> > ---
> > drivers/staging/sm750fb/ddk750_chip.c | 18 ++++----
> > drivers/staging/sm750fb/ddk750_chip.h | 5 +-
> > drivers/staging/sm750fb/ddk750_display.h | 78 ++++++++++++++++----------------
> > drivers/staging/sm750fb/ddk750_hwi2c.c | 4 +-
> > drivers/staging/sm750fb/sm750.h | 6 +--
> > 5 files changed, 55 insertions(+), 56 deletions(-)
> >
> > diff --git a/drivers/staging/sm750fb/ddk750_chip.c b/drivers/staging/sm750fb/ddk750_chip.c
> > index 944dd25..64d0a53 100644
> > --- a/drivers/staging/sm750fb/ddk750_chip.c
> > +++ b/drivers/staging/sm750fb/ddk750_chip.c
> > @@ -5,8 +5,6 @@
> > #include "ddk750_chip.h"
> > #include "ddk750_power.h"
> >
> > -#define MHz(x) ((x) * 1000000)
> > -
> > static logical_chip_type_t chip;
> >
> > logical_chip_type_t sm750_get_chip_type(void)
> > @@ -36,7 +34,7 @@ static unsigned int get_mxclk_freq(void)
> > unsigned int M, N, OD, POD;
> >
> > if (sm750_get_chip_type() == SM750LE)
> > - return MHz(130);
> > + return MHZ(130);
>
> But MHz makes more sense, don't you think so?
>
> Please leave that as-is.
>
> thanks,
>
> greg k-h

I see it, but there is:
sm750.h:#define MHZ(x) ((x) * 1000000)
ddk750_chip.c:#define MHz(x) ((x) * 1000000)
and I think macros should be in header files, so I removed declaration
in c file.

Thank you,

Matej Dujava