From: Sudip Mukherjee <sudipm.mukherjee@gmail.com>
To: Shivani Bhardwaj <shivanib134@gmail.com>
Cc: outreachy-kernel <outreachy-kernel@googlegroups.com>
Subject: Re: [Outreachy kernel] [PATCH v2 3/3] Staging: wilc1000: linux_wlan: Replace function calls
Date: Thu, 29 Oct 2015 11:11:35 +0530 [thread overview]
Message-ID: <20151029054135.GA16140@sudip-pc> (raw)
In-Reply-To: <CAKHNQQFRRV3C3wqmatnf4cq525JcmJeXawqzF1-qFB4yy64YxQ@mail.gmail.com>
On Wed, Oct 28, 2015 at 10:28:29PM +0530, Shivani Bhardwaj wrote:
> On Wed, Oct 28, 2015 at 9:39 PM, Shivani Bhardwaj <shivanib134@gmail.com>
> wrote:
> > On Wed, Oct 28, 2015 at 6:40 PM, Sudip Mukherjee
> > <sudipm.mukherjee@gmail.com> wrote:
> >> On Wed, Oct 28, 2015 at 05:19:04PM +0530, Shivani Bhardwaj wrote:
> >>> Replace calls to wrapper functions with the actual functions called by
> >>> wrapper functions. Definitions needed to make those calls should also
> be added.
> >>>
> >>> Signed-off-by: Shivani Bhardwaj <shivanib134@gmail.com>
> >>> ---
> >>
> >> Not build tested. :(
> >>
> >> error: implicit declaration of function ‘linux_sdio_set_speed’
> [-Werror=implicit-function-declaration]
> >> nwi->io_func.u.sdio.sdio_set_max_speed =
> linux_sdio_set_speed(MAX_SPEED);
> >>
> >> drivers/staging/wilc1000/linux_wlan.c:990:41: warning: assignment makes
> pointer from integer without a cast [enabled by default]
> >> nwi->io_func.u.sdio.sdio_set_max_speed =
> linux_sdio_set_speed(MAX_SPEED);
> >>
> >> drivers/staging/wilc1000/linux_wlan.c:991:68: error:
> ‘sdio_default_speed’ undeclared (first use in this function)
> >>
> >> regards
> >> sudip
> >
> > I'm really very sorry I didn't do make allmodconfig, make didn't show
> > me any errors at that time. In order to fix these mistakes, I'm
> > thinking of changing some part of code. Please check the next version.
> > Thank you
>
> I need a bit of help here. While replacing the calls of wrapper function by
> actual function, I get the following:
> warning: assignment makes pointer from integer without a cast
>
> Why is it like that? Wrapper function returns function which in turn
> returns an integer so ultimately the value that is to be returned is int.
>
> I think I'm missing something trivial. I don't know what.
When it is doing nwi->io_func.u.sdio.sdio_set_max_speed = linux_sdio_set_max_speed;
it is saving the address of the function linux_sdio_set_max_speed in
nwi->io_func.u.sdio.sdio_set_max_speed.
But when you are doing:
nwi->io_func.u.sdio.sdio_set_max_speed = linux_sdio_set_speed(MAX_SPEED);
you are trying to save the speed value in a place where the function
pointer is supposed to stay.
If you want to remove this wrapper, then you can do:
nwi->io_func.u.sdio.sdio_set_max_speed = linux_sdio_set_speed;
and then in all places where nwi->io_func.u.sdio.sdio_set_max_speed is
used you need to modify that to use MAX_SPEED as argument.
But I guess that will make the code less readable.
regards
sudip
next prev parent reply other threads:[~2015-10-29 5:41 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-10-28 11:47 [PATCH v2 0/3] Drop wrapper functions and clean up the code Shivani Bhardwaj
2015-10-28 11:48 ` [PATCH v2 1/3] Staging: wilc1000: linux_wlan_sdio: Drop unneeded wrapper functions Shivani Bhardwaj
2015-10-28 13:05 ` [Outreachy kernel] " Sudip Mukherjee
2015-10-28 11:48 ` [PATCH v2 2/3] Staging: wilc1000: linux_wlan_sdio: Remove unnecessary blank lines Shivani Bhardwaj
2015-10-28 11:49 ` [PATCH v2 3/3] Staging: wilc1000: linux_wlan: Replace function calls Shivani Bhardwaj
2015-10-28 13:10 ` [Outreachy kernel] " Sudip Mukherjee
2015-10-28 16:09 ` Shivani Bhardwaj
2015-10-28 16:58 ` Shivani Bhardwaj
2015-10-29 5:41 ` Sudip Mukherjee [this message]
2015-10-28 13:48 ` Julia Lawall
2015-10-28 16:07 ` Shivani Bhardwaj
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=20151029054135.GA16140@sudip-pc \
--to=sudipm.mukherjee@gmail.com \
--cc=outreachy-kernel@googlegroups.com \
--cc=shivanib134@gmail.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.