All of lore.kernel.org
 help / color / mirror / Atom feed
From: Greg KH <gregkh@linuxfoundation.org>
To: Madhumthia Prabakaran <madhumithabiw@gmail.com>
Cc: outreachy-kernel@googlegroups.com
Subject: Re: [PATCH v2] Staging: media: davinci_vpfe: Convert ceil macro into an inline function
Date: Tue, 2 Apr 2019 07:21:51 +0200	[thread overview]
Message-ID: <20190402052151.GA11987@kroah.com> (raw)
In-Reply-To: <20190401223215.GA30112@madhuleo>

On Mon, Apr 01, 2019 at 05:32:16PM -0500, Madhumthia Prabakaran wrote:
> On Fri, Mar 29, 2019 at 05:04:51PM +0100, Greg KH wrote:
> > On Wed, Mar 27, 2019 at 01:00:52PM -0500, Madhumitha Prabakaran wrote:
> > > Convert macro into an inline function in order to maintain Linux kernel
> > > coding style based on which the inline function is preferable over the
> > > macro.
> > > 
> > > Signed-off-by: Madhumitha Prabakaran <madhumithabiw@gmail.com>
> > > 
> > > ---
> > > Changes in v2 -
> > > 
> > > - Corrected commit log spelling
> > > - Made the subject line unique from previous commit
> > > ---
> > >  drivers/staging/media/davinci_vpfe/dm365_ipipe.h   | 5 ++++-
> > >  drivers/staging/media/davinci_vpfe/dm365_resizer.c | 4 ++--
> > >  2 files changed, 6 insertions(+), 3 deletions(-)
> > > 
> > > diff --git a/drivers/staging/media/davinci_vpfe/dm365_ipipe.h b/drivers/staging/media/davinci_vpfe/dm365_ipipe.h
> > > index 174334b53f96..32dce3c95304 100644
> > > --- a/drivers/staging/media/davinci_vpfe/dm365_ipipe.h
> > > +++ b/drivers/staging/media/davinci_vpfe/dm365_ipipe.h
> > > @@ -27,7 +27,10 @@
> > >  #include "davinci_vpfe_user.h"
> > >  #include "vpfe_video.h"
> > >  
> > > -#define CEIL(a, b)	(((a) + (b-1)) / (b))
> > > +inline unsigned int ceil(unsigned int a, unsigned int b)
> > > +{
> > > +	return ((a + (b - 1)) / b);
> > > +}
> > 
> > Please just convert the caller to use the in-kernel function for this
> > instead of having a second one in just this driver.
> 
> I'm not able to find in-kernel function for ceil. Though there is ceil
> function in math.h, which has return type of double, and i'm sure that  kernel
> cann't accept floating type. how can i resolve this issue?

The kernel does not have a math.h file, I do not think you are looking
in the kernel include directory.

Look at DIV_ROUND_UP(), that's what you want, right?

thanks,

greg k-h


  reply	other threads:[~2019-04-02  5:21 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-27 18:00 [PATCH v2] Staging: media: davinci_vpfe: Convert ceil macro into an inline function Madhumitha Prabakaran
2019-03-29 16:04 ` Greg KH
2019-04-01 22:32   ` Madhumthia Prabakaran
2019-04-02  5:21     ` Greg KH [this message]
2019-04-02 14:58       ` Madhumthia Prabakaran

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=20190402052151.GA11987@kroah.com \
    --to=gregkh@linuxfoundation.org \
    --cc=madhumithabiw@gmail.com \
    --cc=outreachy-kernel@googlegroups.com \
    /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.