* [PATCH] bcma: make some functions static
@ 2012-05-31 20:40 Hauke Mehrtens
2012-06-01 7:58 ` Arend van Spriel
0 siblings, 1 reply; 3+ messages in thread
From: Hauke Mehrtens @ 2012-05-31 20:40 UTC (permalink / raw)
To: linville; +Cc: zajec5, b43-dev, linux-wireless, Hauke Mehrtens
The functions and structs are not used in an other file and the
prototypes are in no header file, just make them static so the compiler
is able to optimize them better.
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
---
drivers/bcma/driver_chipcommon_pmu.c | 6 +++---
drivers/bcma/host_pci.c | 11 ++++++-----
drivers/bcma/host_soc.c | 2 +-
3 files changed, 10 insertions(+), 9 deletions(-)
diff --git a/drivers/bcma/driver_chipcommon_pmu.c b/drivers/bcma/driver_chipcommon_pmu.c
index a058842..ee4d39c 100644
--- a/drivers/bcma/driver_chipcommon_pmu.c
+++ b/drivers/bcma/driver_chipcommon_pmu.c
@@ -96,7 +96,7 @@ static void bcma_pmu_resources_init(struct bcma_drv_cc *cc)
bcma_cc_write32(cc, BCMA_CC_PMU_MAXRES_MSK, max_msk);
}
-void bcma_pmu_swreg_init(struct bcma_drv_cc *cc)
+static void bcma_pmu_swreg_init(struct bcma_drv_cc *cc)
{
struct bcma_bus *bus = cc->core->bus;
@@ -130,7 +130,7 @@ void bcma_chipco_bcm4331_ext_pa_lines_ctl(struct bcma_drv_cc *cc, bool enable)
bcma_cc_write32(cc, BCMA_CC_CHIPCTL, val);
}
-void bcma_pmu_workarounds(struct bcma_drv_cc *cc)
+static void bcma_pmu_workarounds(struct bcma_drv_cc *cc)
{
struct bcma_bus *bus = cc->core->bus;
@@ -249,7 +249,7 @@ static u32 bcma_pmu_clock(struct bcma_drv_cc *cc, u32 pll0, u32 m)
}
/* query bus clock frequency for PMU-enabled chipcommon */
-u32 bcma_pmu_get_clockcontrol(struct bcma_drv_cc *cc)
+static u32 bcma_pmu_get_clockcontrol(struct bcma_drv_cc *cc)
{
struct bcma_bus *bus = cc->core->bus;
diff --git a/drivers/bcma/host_pci.c b/drivers/bcma/host_pci.c
index 6c05cf4..f7fbae7 100644
--- a/drivers/bcma/host_pci.c
+++ b/drivers/bcma/host_pci.c
@@ -77,8 +77,8 @@ static void bcma_host_pci_write32(struct bcma_device *core, u16 offset,
}
#ifdef CONFIG_BCMA_BLOCKIO
-void bcma_host_pci_block_read(struct bcma_device *core, void *buffer,
- size_t count, u16 offset, u8 reg_width)
+static void bcma_host_pci_block_read(struct bcma_device *core, void *buffer,
+ size_t count, u16 offset, u8 reg_width)
{
void __iomem *addr = core->bus->mmio + offset;
if (core->bus->mapped_core != core)
@@ -100,8 +100,9 @@ void bcma_host_pci_block_read(struct bcma_device *core, void *buffer,
}
}
-void bcma_host_pci_block_write(struct bcma_device *core, const void *buffer,
- size_t count, u16 offset, u8 reg_width)
+static void bcma_host_pci_block_write(struct bcma_device *core,
+ const void *buffer, size_t count,
+ u16 offset, u8 reg_width)
{
void __iomem *addr = core->bus->mmio + offset;
if (core->bus->mapped_core != core)
@@ -139,7 +140,7 @@ static void bcma_host_pci_awrite32(struct bcma_device *core, u16 offset,
iowrite32(value, core->bus->mmio + (1 * BCMA_CORE_SIZE) + offset);
}
-const struct bcma_host_ops bcma_host_pci_ops = {
+static const struct bcma_host_ops bcma_host_pci_ops = {
.read8 = bcma_host_pci_read8,
.read16 = bcma_host_pci_read16,
.read32 = bcma_host_pci_read32,
diff --git a/drivers/bcma/host_soc.c b/drivers/bcma/host_soc.c
index 3c381fb..3475e60 100644
--- a/drivers/bcma/host_soc.c
+++ b/drivers/bcma/host_soc.c
@@ -143,7 +143,7 @@ static void bcma_host_soc_awrite32(struct bcma_device *core, u16 offset,
writel(value, core->io_wrap + offset);
}
-const struct bcma_host_ops bcma_host_soc_ops = {
+static const struct bcma_host_ops bcma_host_soc_ops = {
.read8 = bcma_host_soc_read8,
.read16 = bcma_host_soc_read16,
.read32 = bcma_host_soc_read32,
--
1.7.9.5
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] bcma: make some functions static
2012-05-31 20:40 [PATCH] bcma: make some functions static Hauke Mehrtens
@ 2012-06-01 7:58 ` Arend van Spriel
2012-06-01 20:19 ` Hauke Mehrtens
0 siblings, 1 reply; 3+ messages in thread
From: Arend van Spriel @ 2012-06-01 7:58 UTC (permalink / raw)
To: Hauke Mehrtens; +Cc: linville, zajec5, b43-dev, linux-wireless
On 05/31/2012 10:40 PM, Hauke Mehrtens wrote:
> The functions and structs are not used in an other file and the
> prototypes are in no header file, just make them static so the compiler
> is able to optimize them better.
>
> Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
> ---
> diff --git a/drivers/bcma/host_pci.c b/drivers/bcma/host_pci.c
> index 6c05cf4..f7fbae7 100644
> --- a/drivers/bcma/host_pci.c
> +++ b/drivers/bcma/host_pci.c
> @@ -77,8 +77,8 @@ static void bcma_host_pci_write32(struct bcma_device *core, u16 offset,
> }
>
> #ifdef CONFIG_BCMA_BLOCKIO
> -void bcma_host_pci_block_read(struct bcma_device *core, void *buffer,
> - size_t count, u16 offset, u8 reg_width)
> +static void bcma_host_pci_block_read(struct bcma_device *core, void *buffer,
> + size_t count, u16 offset, u8 reg_width)
align this with struct keyword above.
> {
> void __iomem *addr = core->bus->mmio + offset;
> if (core->bus->mapped_core != core)
> @@ -100,8 +100,9 @@ void bcma_host_pci_block_read(struct bcma_device *core, void *buffer,
> }
> }
>
> -void bcma_host_pci_block_write(struct bcma_device *core, const void *buffer,
> - size_t count, u16 offset, u8 reg_width)
> +static void bcma_host_pci_block_write(struct bcma_device *core,
> + const void *buffer, size_t count,
> + u16 offset, u8 reg_width)
same here. checkpatch also spews warnings about DOS line endings.
Gr. AvS
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] bcma: make some functions static
2012-06-01 7:58 ` Arend van Spriel
@ 2012-06-01 20:19 ` Hauke Mehrtens
0 siblings, 0 replies; 3+ messages in thread
From: Hauke Mehrtens @ 2012-06-01 20:19 UTC (permalink / raw)
To: Arend van Spriel; +Cc: linville, zajec5, b43-dev, linux-wireless
On 06/01/2012 09:58 AM, Arend van Spriel wrote:
> On 05/31/2012 10:40 PM, Hauke Mehrtens wrote:
>> The functions and structs are not used in an other file and the
>> prototypes are in no header file, just make them static so the compiler
>> is able to optimize them better.
>>
>> Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
>> ---
>> diff --git a/drivers/bcma/host_pci.c b/drivers/bcma/host_pci.c
>> index 6c05cf4..f7fbae7 100644
>> --- a/drivers/bcma/host_pci.c
>> +++ b/drivers/bcma/host_pci.c
>> @@ -77,8 +77,8 @@ static void bcma_host_pci_write32(struct bcma_device *core, u16 offset,
>> }
>>
>> #ifdef CONFIG_BCMA_BLOCKIO
>> -void bcma_host_pci_block_read(struct bcma_device *core, void *buffer,
>> - size_t count, u16 offset, u8 reg_width)
>> +static void bcma_host_pci_block_read(struct bcma_device *core, void *buffer,
>> + size_t count, u16 offset, u8 reg_width)
>
> align this with struct keyword above.
This is about formating? The s from struct and the s from size_t are in
the same column, in this patch it is a little bit shifted because the
first tab is just 7 spaces long because of the + in front of it, if you
apply it it is in the same line.
>
>> {
>> void __iomem *addr = core->bus->mmio + offset;
>> if (core->bus->mapped_core != core)
>> @@ -100,8 +100,9 @@ void bcma_host_pci_block_read(struct bcma_device *core, void *buffer,
>> }
>> }
>>
>> -void bcma_host_pci_block_write(struct bcma_device *core, const void *buffer,
>> - size_t count, u16 offset, u8 reg_width)
>> +static void bcma_host_pci_block_write(struct bcma_device *core,
>> + const void *buffer, size_t count,
>> + u16 offset, u8 reg_width)
>
> same here. checkpatch also spews warnings about DOS line endings.
When I run this mail thought checkpatch I also get these DOS line ending
messages. I do not have the original mail many more, but when I generate
the same file I send with git send mail it doe snot contain any DOS line
endings, checkpatch does not complain at all. Either the mail I
generated yesterday was somehow different or something added these DOS
line endings.
Hauke
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2012-06-01 20:20 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-05-31 20:40 [PATCH] bcma: make some functions static Hauke Mehrtens
2012-06-01 7:58 ` Arend van Spriel
2012-06-01 20:19 ` Hauke Mehrtens
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).