2013-05-09 07:57:45

by Denis Efremov

[permalink] [raw]
Subject: [PATCH 00/21] Exported funtions that are marked inline

Hello everyone,
this is a patchset to remove inline marking of exported functions.
Patchset is motivated by
https://lkml.org/lkml/2012/5/10/545 (af3b56289)

I run some tests and inspect the binaries. (You can find the tests
here: https://bitbucket.org/evdenis/tests/src) And it seems (at least
on my configuration) that EXPORT_SYMBOL completely revokes inline
directive. GCC can handle this, but other compilers may be confused
by these two directives. Anyway, you can't inline function that you
expect not to be available for modules with incompatible license and
to be available for the rest.

The tool I use to check the sources:
https://bitbucket.org/evdenis/export_checking.git

arch/arm/mach-sa1100/jornada720_ssp.c | 2 +-
arch/arm64/lib/delay.c | 2 +-
arch/cris/arch-v32/kernel/cache.c | 2 +-
arch/m68k/sun3/sun3dvma.c | 2 +-
arch/metag/lib/delay.c | 2 +-
arch/mips/pmcs-msp71xx/msp_prom.c | 2 +-
arch/openrisc/lib/delay.c | 2 +-
arch/powerpc/platforms/ps3/spu.c | 2 +-
arch/sparc/prom/tree_64.c | 14 +++++++-------
arch/tile/lib/spinlock_32.c | 2 +-
arch/x86/lib/delay.c | 2 +-
arch/x86/um/delay.c | 2 +-
drivers/dma/dw_dmac.c | 4 ++--
drivers/net/wireless/iwlegacy/common.c | 2 +-
drivers/scsi/libiscsi.c | 2 +-
drivers/scsi/libiscsi_tcp.c | 8 ++++----
drivers/staging/nvec/nvec.c | 2 +-
fs/bio.c | 2 +-
fs/block_dev.c | 2 +-
fs/buffer.c | 2 +-
mm/filemap.c | 2 +-
net/9p/client.c | 4 ++--
net/ipv4/ip_output.c | 2 +-
net/netfilter/nf_nat_core.c | 2 +-
net/nfc/core.c | 2 +-
25 files changed, 36 insertions(+), 36 deletions(-)


2013-05-09 07:59:19

by Denis Efremov

[permalink] [raw]
Subject: [PATCH 01/21] [SCSI] libiscsi: remove inline marking of EXPORT_SYMBOL functions

EXPORT_SYMBOL and inline directives are contradictory to each other.
The patch fixes this inconsistency.

Found by Linux Driver Verification project (linuxtesting.org).

Signed-off-by: Denis Efremov <[email protected]>
---
drivers/scsi/libiscsi.c | 2 +-
drivers/scsi/libiscsi_tcp.c | 8 ++++----
2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/scsi/libiscsi.c b/drivers/scsi/libiscsi.c
index 5de9469..8d8d3a5 100644
--- a/drivers/scsi/libiscsi.c
+++ b/drivers/scsi/libiscsi.c
@@ -85,7 +85,7 @@ MODULE_PARM_DESC(debug_libiscsi_eh,
__func__, ##arg); \
} while (0);

-inline void iscsi_conn_queue_work(struct iscsi_conn *conn)
+void iscsi_conn_queue_work(struct iscsi_conn *conn)
{
struct Scsi_Host *shost = conn->session->host;
struct iscsi_host *ihost = shost_priv(shost);
diff --git a/drivers/scsi/libiscsi_tcp.c b/drivers/scsi/libiscsi_tcp.c
index 552e8a2..2e37fcc 100644
--- a/drivers/scsi/libiscsi_tcp.c
+++ b/drivers/scsi/libiscsi_tcp.c
@@ -309,7 +309,7 @@ iscsi_tcp_segment_recv(struct iscsi_tcp_conn *tcp_conn,
return copied;
}

-inline void
+void
iscsi_tcp_dgst_header(struct hash_desc *hash, const void *hdr, size_t hdrlen,
unsigned char digest[ISCSI_DIGEST_SIZE])
{
@@ -353,7 +353,7 @@ __iscsi_segment_init(struct iscsi_segment *segment, size_t size,
}
}

-inline void
+void
iscsi_segment_init_linear(struct iscsi_segment *segment, void *data,
size_t size, iscsi_segment_done_fn_t *done,
struct hash_desc *hash)
@@ -364,7 +364,7 @@ iscsi_segment_init_linear(struct iscsi_segment *segment, void *data,
}
EXPORT_SYMBOL_GPL(iscsi_segment_init_linear);

-inline int
+int
iscsi_segment_seek_sg(struct iscsi_segment *segment,
struct scatterlist *sg_list, unsigned int sg_count,
unsigned int offset, size_t size,
@@ -852,7 +852,7 @@ iscsi_tcp_hdr_recv_done(struct iscsi_tcp_conn *tcp_conn,
* returns non zero if we are currently processing or setup to process
* a header.
*/
-inline int iscsi_tcp_recv_segment_is_hdr(struct iscsi_tcp_conn *tcp_conn)
+int iscsi_tcp_recv_segment_is_hdr(struct iscsi_tcp_conn *tcp_conn)
{
return tcp_conn->in.segment.done == iscsi_tcp_hdr_recv_done;
}
--
1.8.1.4

2013-05-09 07:59:51

by Denis Efremov

[permalink] [raw]
Subject: [PATCH 02/21] fs: remove inline marking of EXPORT_SYMBOL functions

EXPORT_SYMBOL and inline directives are contradictory to each other.
The patch fixes this inconsistency.

Found by Linux Driver Verification project (linuxtesting.org).

Signed-off-by: Denis Efremov <[email protected]>
---
fs/bio.c | 2 +-
fs/block_dev.c | 2 +-
fs/buffer.c | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/fs/bio.c b/fs/bio.c
index b96fc6c..4e1235f 100644
--- a/fs/bio.c
+++ b/fs/bio.c
@@ -402,7 +402,7 @@ void bio_put(struct bio *bio)
}
EXPORT_SYMBOL(bio_put);

-inline int bio_phys_segments(struct request_queue *q, struct bio *bio)
+int bio_phys_segments(struct request_queue *q, struct bio *bio)
{
if (unlikely(!bio_flagged(bio, BIO_SEG_VALID)))
blk_recount_segments(q, bio);
diff --git a/fs/block_dev.c b/fs/block_dev.c
index ce08de7..799d879 100644
--- a/fs/block_dev.c
+++ b/fs/block_dev.c
@@ -42,7 +42,7 @@ static inline struct bdev_inode *BDEV_I(struct inode *inode)
return container_of(inode, struct bdev_inode, vfs_inode);
}

-inline struct block_device *I_BDEV(struct inode *inode)
+struct block_device *I_BDEV(struct inode *inode)
{
return &BDEV_I(inode)->bdev;
}
diff --git a/fs/buffer.c b/fs/buffer.c
index bc1fe14..c3cfe44 100644
--- a/fs/buffer.c
+++ b/fs/buffer.c
@@ -54,7 +54,7 @@ void init_buffer(struct buffer_head *bh, bh_end_io_t *handler, void *private)
}
EXPORT_SYMBOL(init_buffer);

-inline void touch_buffer(struct buffer_head *bh)
+void touch_buffer(struct buffer_head *bh)
{
trace_block_touch_buffer(bh);
mark_page_accessed(bh->b_page);
--
1.8.1.4

2013-05-09 07:59:57

by Denis Efremov

[permalink] [raw]
Subject: [PATCH 03/21] x86: remove inline marking of EXPORT_SYMBOL functions

EXPORT_SYMBOL and inline directives are contradictory to each other.
The patch fixes this inconsistency.

Found by Linux Driver Verification project (linuxtesting.org).

Signed-off-by: Denis Efremov <[email protected]>
---
arch/x86/lib/delay.c | 2 +-
arch/x86/um/delay.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/x86/lib/delay.c b/arch/x86/lib/delay.c
index 7c3bee6..6ce3f87 100644
--- a/arch/x86/lib/delay.c
+++ b/arch/x86/lib/delay.c
@@ -113,7 +113,7 @@ void __delay(unsigned long loops)
}
EXPORT_SYMBOL(__delay);

-inline void __const_udelay(unsigned long xloops)
+void __const_udelay(unsigned long xloops)
{
int d0;

diff --git a/arch/x86/um/delay.c b/arch/x86/um/delay.c
index f3fe1a6..6e35993 100644
--- a/arch/x86/um/delay.c
+++ b/arch/x86/um/delay.c
@@ -33,7 +33,7 @@ void __delay(unsigned long loops)
}
EXPORT_SYMBOL(__delay);

-inline void __const_udelay(unsigned long xloops)
+void __const_udelay(unsigned long xloops)
{
int d0;

--
1.8.1.4

2013-05-09 08:00:05

by Denis Efremov

[permalink] [raw]
Subject: [PATCH 04/21] NFC: remove inline marking of EXPORT_SYMBOL functions

EXPORT_SYMBOL and inline directives are contradictory to each other.
The patch fixes this inconsistency.

Found by Linux Driver Verification project (linuxtesting.org).

Signed-off-by: Denis Efremov <[email protected]>
---
net/nfc/core.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/nfc/core.c b/net/nfc/core.c
index 40d2527..1c4b513 100644
--- a/net/nfc/core.c
+++ b/net/nfc/core.c
@@ -701,7 +701,7 @@ int nfc_target_lost(struct nfc_dev *dev, u32 target_idx)
}
EXPORT_SYMBOL(nfc_target_lost);

-inline void nfc_driver_failure(struct nfc_dev *dev, int err)
+void nfc_driver_failure(struct nfc_dev *dev, int err)
{
nfc_targets_found(dev, NULL, 0);
}
--
1.8.1.4

2013-05-09 08:00:13

by Denis Efremov

[permalink] [raw]
Subject: [PATCH 05/21] 9p: remove inline marking of EXPORT_SYMBOL functions

EXPORT_SYMBOL and inline directives are contradictory to each other.
The patch fixes this inconsistency.

Found by Linux Driver Verification project (linuxtesting.org).

Signed-off-by: Denis Efremov <[email protected]>
---
net/9p/client.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/net/9p/client.c b/net/9p/client.c
index 8eb7542..591c664 100644
--- a/net/9p/client.c
+++ b/net/9p/client.c
@@ -64,13 +64,13 @@ static const match_table_t tokens = {
{Opt_err, NULL},
};

-inline int p9_is_proto_dotl(struct p9_client *clnt)
+int p9_is_proto_dotl(struct p9_client *clnt)
{
return clnt->proto_version == p9_proto_2000L;
}
EXPORT_SYMBOL(p9_is_proto_dotl);

-inline int p9_is_proto_dotu(struct p9_client *clnt)
+int p9_is_proto_dotu(struct p9_client *clnt)
{
return clnt->proto_version == p9_proto_2000u;
}
--
1.8.1.4

2013-05-09 08:07:48

by Al Viro

[permalink] [raw]
Subject: Re: [PATCH 02/21] fs: remove inline marking of EXPORT_SYMBOL functions

On Thu, May 09, 2013 at 11:58:24AM +0400, Denis Efremov wrote:
> EXPORT_SYMBOL and inline directives are contradictory to each other.
> The patch fixes this inconsistency.

What makes them contradictory, in your opinion? With references to
relevant parts of C99, please.

2013-05-09 08:42:30

by Denis Efremov

[permalink] [raw]
Subject: Re: [PATCH 02/21] fs: remove inline marking of EXPORT_SYMBOL functions

On 09.05.2013 12:07, Al Viro wrote:
> On Thu, May 09, 2013 at 11:58:24AM +0400, Denis Efremov wrote:
>> EXPORT_SYMBOL and inline directives are contradictory to each other.
>> The patch fixes this inconsistency.
> What makes them contradictory, in your opinion? With references to
> relevant parts of C99, please.
Looks like the introductory message was rejected by mailing list.
Will try to do something with this. You can find it here:
http://linuxtesting.org/pipermail/ldv-project/2013-May/000101.html

Patchset is based on previous fixes.

2013-05-09 09:20:50

by Denis Efremov

[permalink] [raw]
Subject: [PATCH 06/21] staging: nvec: remove inline marking of EXPORT_SYMBOL functions

EXPORT_SYMBOL and inline directives are contradictory to each other.
The patch fixes this inconsistency.

Found by Linux Driver Verification project (linuxtesting.org).

Signed-off-by: Denis Efremov <[email protected]>
---
drivers/staging/nvec/nvec.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/nvec/nvec.c b/drivers/staging/nvec/nvec.c
index a88959f..954c992 100644
--- a/drivers/staging/nvec/nvec.c
+++ b/drivers/staging/nvec/nvec.c
@@ -185,7 +185,7 @@ static struct nvec_msg *nvec_msg_alloc(struct nvec_chip *nvec,
*
* Free the given message
*/
-inline void nvec_msg_free(struct nvec_chip *nvec, struct nvec_msg *msg)
+void nvec_msg_free(struct nvec_chip *nvec, struct nvec_msg *msg)
{
if (msg != &nvec->tx_scratch)
dev_vdbg(nvec->dev, "INFO: Free %ti\n", msg - nvec->msg_pool);
--
1.8.1.4

2013-05-09 09:21:23

by Denis Efremov

[permalink] [raw]
Subject: [PATCH 07/21] netfilter: nf_nat: remove inline marking of EXPORT_SYMBOL functions

EXPORT_SYMBOL and inline directives are contradictory to each other.
The patch fixes this inconsistency.

Found by Linux Driver Verification project (linuxtesting.org).

Signed-off-by: Denis Efremov <[email protected]>
---
net/netfilter/nf_nat_core.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/netfilter/nf_nat_core.c b/net/netfilter/nf_nat_core.c
index 038eee5..38492e0 100644
--- a/net/netfilter/nf_nat_core.c
+++ b/net/netfilter/nf_nat_core.c
@@ -44,7 +44,7 @@ __nf_nat_l3proto_find(u8 family)
return rcu_dereference(nf_nat_l3protos[family]);
}

-inline const struct nf_nat_l4proto *
+const struct nf_nat_l4proto *
__nf_nat_l4proto_find(u8 family, u8 protonum)
{
return rcu_dereference(nf_nat_l4protos[family][protonum]);
--
1.8.1.4

2013-05-09 09:21:41

by Denis Efremov

[permalink] [raw]
Subject: [PATCH 08/21] iwlegacy: remove inline marking of EXPORT_SYMBOL functions

EXPORT_SYMBOL and inline directives are contradictory to each other.
The patch fixes this inconsistency.

Found by Linux Driver Verification project (linuxtesting.org).

Signed-off-by: Denis Efremov <[email protected]>
---
drivers/net/wireless/iwlegacy/common.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/wireless/iwlegacy/common.c b/drivers/net/wireless/iwlegacy/common.c
index 592d0aa..e9a3cbc 100644
--- a/drivers/net/wireless/iwlegacy/common.c
+++ b/drivers/net/wireless/iwlegacy/common.c
@@ -1423,7 +1423,7 @@ il_setup_rx_scan_handlers(struct il_priv *il)
}
EXPORT_SYMBOL(il_setup_rx_scan_handlers);

-inline u16
+u16
il_get_active_dwell_time(struct il_priv *il, enum ieee80211_band band,
u8 n_probes)
{
--
1.8.1.4

2013-05-09 09:21:46

by Denis Efremov

[permalink] [raw]
Subject: [PATCH 09/21] dw_dmac: remove inline marking of EXPORT_SYMBOL functions

EXPORT_SYMBOL and inline directives are contradictory to each other.
The patch fixes this inconsistency.

Found by Linux Driver Verification project (linuxtesting.org).

Signed-off-by: Denis Efremov <[email protected]>
---
drivers/dma/dw_dmac.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/dma/dw_dmac.c b/drivers/dma/dw_dmac.c
index 43a5329..a526bb9 100644
--- a/drivers/dma/dw_dmac.c
+++ b/drivers/dma/dw_dmac.c
@@ -574,14 +574,14 @@ static void dwc_handle_error(struct dw_dma *dw, struct dw_dma_chan *dwc)

/* --------------------- Cyclic DMA API extensions -------------------- */

-inline dma_addr_t dw_dma_get_src_addr(struct dma_chan *chan)
+dma_addr_t dw_dma_get_src_addr(struct dma_chan *chan)
{
struct dw_dma_chan *dwc = to_dw_dma_chan(chan);
return channel_readl(dwc, SAR);
}
EXPORT_SYMBOL(dw_dma_get_src_addr);

-inline dma_addr_t dw_dma_get_dst_addr(struct dma_chan *chan)
+dma_addr_t dw_dma_get_dst_addr(struct dma_chan *chan)
{
struct dw_dma_chan *dwc = to_dw_dma_chan(chan);
return channel_readl(dwc, DAR);
--
1.8.1.4

2013-05-09 09:21:53

by Denis Efremov

[permalink] [raw]
Subject: [PATCH 10/21] mm: filemap: remove inline marking of EXPORT_SYMBOL functions

EXPORT_SYMBOL and inline directives are contradictory to each other.
The patch fixes this inconsistency.

Found by Linux Driver Verification project (linuxtesting.org).

Signed-off-by: Denis Efremov <[email protected]>
---
mm/filemap.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/mm/filemap.c b/mm/filemap.c
index 7905fe7..6aca7a2 100644
--- a/mm/filemap.c
+++ b/mm/filemap.c
@@ -2092,7 +2092,7 @@ EXPORT_SYMBOL(iov_iter_single_seg_count);
* Returns appropriate error code that caller should return or
* zero in case that write should be allowed.
*/
-inline int generic_write_checks(struct file *file, loff_t *pos, size_t *count, int isblk)
+int generic_write_checks(struct file *file, loff_t *pos, size_t *count, int isblk)
{
struct inode *inode = file->f_mapping->host;
unsigned long limit = rlimit(RLIMIT_FSIZE);
--
1.8.1.4

2013-05-09 09:22:17

by Denis Efremov

[permalink] [raw]
Subject: [PATCH 11/21] ipv4: ip_output: remove inline marking of EXPORT_SYMBOL functions

EXPORT_SYMBOL and inline directives are contradictory to each other.
The patch fixes this inconsistency.

Found by Linux Driver Verification project (linuxtesting.org).

Signed-off-by: Denis Efremov <[email protected]>
---
net/ipv4/ip_output.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/ipv4/ip_output.c b/net/ipv4/ip_output.c
index 147abf5..4bcabf3 100644
--- a/net/ipv4/ip_output.c
+++ b/net/ipv4/ip_output.c
@@ -84,7 +84,7 @@ int sysctl_ip_default_ttl __read_mostly = IPDEFTTL;
EXPORT_SYMBOL(sysctl_ip_default_ttl);

/* Generate a checksum for an outgoing IP datagram. */
-__inline__ void ip_send_check(struct iphdr *iph)
+void ip_send_check(struct iphdr *iph)
{
iph->check = 0;
iph->check = ip_fast_csum((unsigned char *)iph, iph->ihl);
--
1.8.1.4

2013-05-09 09:51:29

by David Laight

[permalink] [raw]
Subject: RE: [PATCH 07/21] netfilter: nf_nat: remove inline marking of EXPORT_SYMBOL functions

> EXPORT_SYMBOL and inline directives are contradictory to each other.
> The patch fixes this inconsistency.
...
> -inline const struct nf_nat_l4proto *
> +const struct nf_nat_l4proto *
> __nf_nat_l4proto_find(u8 family, u8 protonum)
> {
> return rcu_dereference(nf_nat_l4protos[family][protonum]);

If it makes sense to inline the local calls (ie the cost
of the call is significant) then possibly add an inlined
(or inlinable) static function that is called locally and
by the exported one?

I'm not sure that gcc is allowed to make the assumption
that the local exported function will be called - and
thus inline it.

David


2013-05-09 10:37:25

by Denis Efremov

[permalink] [raw]
Subject: [PATCH 12/21] metag: delay: remove inline marking of EXPORT_SYMBOL functions

EXPORT_SYMBOL and inline directives are contradictory to each other.
The patch fixes this inconsistency.

Found by Linux Driver Verification project (linuxtesting.org).

Signed-off-by: Denis Efremov <[email protected]>
---
arch/metag/lib/delay.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/metag/lib/delay.c b/arch/metag/lib/delay.c
index 0b308f4..7ff0ca7 100644
--- a/arch/metag/lib/delay.c
+++ b/arch/metag/lib/delay.c
@@ -36,7 +36,7 @@ void __delay(unsigned long loops)
}
EXPORT_SYMBOL(__delay);

-inline void __const_udelay(unsigned long xloops)
+void __const_udelay(unsigned long xloops)
{
u64 loops = (u64)xloops * (u64)loops_per_jiffy * HZ;
__delay(loops >> 32);
--
1.8.1.4

2013-05-09 10:37:44

by Denis Efremov

[permalink] [raw]
Subject: [PATCH 13/21] openrisc: delay: remove inline marking of EXPORT_SYMBOL functions

EXPORT_SYMBOL and inline directives are contradictory to each other.
The patch fixes this inconsistency.

Found by Linux Driver Verification project (linuxtesting.org).

Signed-off-by: Denis Efremov <[email protected]>
---
arch/openrisc/lib/delay.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/openrisc/lib/delay.c b/arch/openrisc/lib/delay.c
index c82b09f..808a55c 100644
--- a/arch/openrisc/lib/delay.c
+++ b/arch/openrisc/lib/delay.c
@@ -37,7 +37,7 @@ void __delay(unsigned long cycles)
}
EXPORT_SYMBOL(__delay);

-inline void __const_udelay(unsigned long xloops)
+void __const_udelay(unsigned long xloops)
{
unsigned long long loops;

--
1.8.1.4

2013-05-09 10:37:55

by Denis Efremov

[permalink] [raw]
Subject: [PATCH 14/21] arm64: delay: remove inline marking of EXPORT_SYMBOL functions

EXPORT_SYMBOL and inline directives are contradictory to each other.
The patch fixes this inconsistency.

Found by Linux Driver Verification project (linuxtesting.org).

Signed-off-by: Denis Efremov <[email protected]>
---
arch/arm64/lib/delay.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm64/lib/delay.c b/arch/arm64/lib/delay.c
index dad4ec9..368ca15 100644
--- a/arch/arm64/lib/delay.c
+++ b/arch/arm64/lib/delay.c
@@ -33,7 +33,7 @@ void __delay(unsigned long cycles)
}
EXPORT_SYMBOL(__delay);

-inline void __const_udelay(unsigned long xloops)
+void __const_udelay(unsigned long xloops)
{
unsigned long loops;

--
1.8.1.4

2013-05-09 10:39:35

by Denis Efremov

[permalink] [raw]
Subject: [PATCH 15/21] arch/tile: remove inline marking of EXPORT_SYMBOL functions

EXPORT_SYMBOL and inline directives are contradictory to each other.
The patch fixes this inconsistency.

Found by Linux Driver Verification project (linuxtesting.org).

Signed-off-by: Denis Efremov <[email protected]>
---
arch/tile/lib/spinlock_32.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/tile/lib/spinlock_32.c b/arch/tile/lib/spinlock_32.c
index b16ac49..b34f79a 100644
--- a/arch/tile/lib/spinlock_32.c
+++ b/arch/tile/lib/spinlock_32.c
@@ -101,7 +101,7 @@ EXPORT_SYMBOL(arch_spin_unlock_wait);
* preserve the semantic that the same read lock can be acquired in an
* interrupt context.
*/
-inline int arch_read_trylock(arch_rwlock_t *rwlock)
+int arch_read_trylock(arch_rwlock_t *rwlock)
{
u32 val;
__insn_mtspr(SPR_INTERRUPT_CRITICAL_SECTION, 1);
--
1.8.1.4

2013-05-09 10:39:53

by Denis Efremov

[permalink] [raw]
Subject: [PATCH 16/21] sparc: remove inline marking of EXPORT_SYMBOL functions

EXPORT_SYMBOL and inline directives are contradictory to each other.
The patch fixes this inconsistency.

Found by Linux Driver Verification project (linuxtesting.org).

Signed-off-by: Denis Efremov <[email protected]>
---
arch/sparc/prom/tree_64.c | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/arch/sparc/prom/tree_64.c b/arch/sparc/prom/tree_64.c
index 92204c3..75e4c44 100644
--- a/arch/sparc/prom/tree_64.c
+++ b/arch/sparc/prom/tree_64.c
@@ -39,7 +39,7 @@ inline phandle __prom_getchild(phandle node)
return prom_node_to_node("child", node);
}

-inline phandle prom_getchild(phandle node)
+phandle prom_getchild(phandle node)
{
phandle cnode;

@@ -72,7 +72,7 @@ inline phandle __prom_getsibling(phandle node)
return prom_node_to_node(prom_peer_name, node);
}

-inline phandle prom_getsibling(phandle node)
+phandle prom_getsibling(phandle node)
{
phandle sibnode;

@@ -89,7 +89,7 @@ EXPORT_SYMBOL(prom_getsibling);
/* Return the length in bytes of property 'prop' at node 'node'.
* Return -1 on error.
*/
-inline int prom_getproplen(phandle node, const char *prop)
+int prom_getproplen(phandle node, const char *prop)
{
unsigned long args[6];

@@ -113,7 +113,7 @@ EXPORT_SYMBOL(prom_getproplen);
* 'buffer' which has a size of 'bufsize'. If the acquisition
* was successful the length will be returned, else -1 is returned.
*/
-inline int prom_getproperty(phandle node, const char *prop,
+int prom_getproperty(phandle node, const char *prop,
char *buffer, int bufsize)
{
unsigned long args[8];
@@ -141,7 +141,7 @@ EXPORT_SYMBOL(prom_getproperty);
/* Acquire an integer property and return its value. Returns -1
* on failure.
*/
-inline int prom_getint(phandle node, const char *prop)
+int prom_getint(phandle node, const char *prop)
{
int intprop;

@@ -235,7 +235,7 @@ static const char *prom_nextprop_name = "nextprop";
/* Return the first property type for node 'node'.
* buffer should be at least 32B in length
*/
-inline char *prom_firstprop(phandle node, char *buffer)
+char *prom_firstprop(phandle node, char *buffer)
{
unsigned long args[7];

@@ -261,7 +261,7 @@ EXPORT_SYMBOL(prom_firstprop);
* at node 'node' . Returns NULL string if no more
* property types for this node.
*/
-inline char *prom_nextprop(phandle node, const char *oprop, char *buffer)
+char *prom_nextprop(phandle node, const char *oprop, char *buffer)
{
unsigned long args[7];
char buf[32];
--
1.8.1.4

2013-05-09 10:40:31

by Denis Efremov

[permalink] [raw]
Subject: [PATCH 17/21] CRISv32: remove inline marking of EXPORT_SYMBOL functions

EXPORT_SYMBOL and inline directives are contradictory to each other.
The patch fixes this inconsistency.

Found by Linux Driver Verification project (linuxtesting.org).

Signed-off-by: Denis Efremov <[email protected]>
---
arch/cris/arch-v32/kernel/cache.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/cris/arch-v32/kernel/cache.c b/arch/cris/arch-v32/kernel/cache.c
index f38433b..876be53 100644
--- a/arch/cris/arch-v32/kernel/cache.c
+++ b/arch/cris/arch-v32/kernel/cache.c
@@ -5,7 +5,7 @@

/* This file is used to workaround a cache bug, Guinness TR 106. */

-inline void flush_dma_descr(struct dma_descr_data *descr, int flush_buf)
+void flush_dma_descr(struct dma_descr_data *descr, int flush_buf)
{
/* Flush descriptor to make sure we get correct in_eop and after. */
asm volatile ("ftagd [%0]" :: "r" (descr));
--
1.8.1.4

2013-05-09 10:40:41

by Denis Efremov

[permalink] [raw]
Subject: [PATCH 18/21] m68k/sun3/: remove inline marking of EXPORT_SYMBOL functions

EXPORT_SYMBOL and inline directives are contradictory to each other.
The patch fixes this inconsistency.

Found by Linux Driver Verification project (linuxtesting.org).

Signed-off-by: Denis Efremov <[email protected]>
---
arch/m68k/sun3/sun3dvma.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/m68k/sun3/sun3dvma.c b/arch/m68k/sun3/sun3dvma.c
index ca0966c..cab5448 100644
--- a/arch/m68k/sun3/sun3dvma.c
+++ b/arch/m68k/sun3/sun3dvma.c
@@ -275,7 +275,7 @@ void dvma_init(void)

}

-inline unsigned long dvma_map_align(unsigned long kaddr, int len, int align)
+unsigned long dvma_map_align(unsigned long kaddr, int len, int align)
{

unsigned long baddr;
--
1.8.1.4

2013-05-09 10:40:48

by Denis Efremov

[permalink] [raw]
Subject: [PATCH 19/21] MIPS: MSP71xx: remove inline marking of EXPORT_SYMBOL functions

EXPORT_SYMBOL and inline directives are contradictory to each other.
The patch fixes this inconsistency.

Found by Linux Driver Verification project (linuxtesting.org).

Signed-off-by: Denis Efremov <[email protected]>
---
arch/mips/pmcs-msp71xx/msp_prom.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/mips/pmcs-msp71xx/msp_prom.c b/arch/mips/pmcs-msp71xx/msp_prom.c
index 0edb89a..1c98975 100644
--- a/arch/mips/pmcs-msp71xx/msp_prom.c
+++ b/arch/mips/pmcs-msp71xx/msp_prom.c
@@ -83,7 +83,7 @@ static inline unsigned char str2hexnum(unsigned char c)
return 0; /* foo */
}

-static inline int str2eaddr(unsigned char *ea, unsigned char *str)
+int str2eaddr(unsigned char *ea, unsigned char *str)
{
int index = 0;
unsigned char num = 0;
--
1.8.1.4

2013-05-09 10:41:13

by Denis Efremov

[permalink] [raw]
Subject: [PATCH 20/21] powerpc/ps3: remove inline marking of EXPORT_SYMBOL functions

EXPORT_SYMBOL and inline directives are contradictory to each other.
The patch fixes this inconsistency.

Found by Linux Driver Verification project (linuxtesting.org).

Signed-off-by: Denis Efremov <[email protected]>
---
arch/powerpc/platforms/ps3/spu.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/powerpc/platforms/ps3/spu.c b/arch/powerpc/platforms/ps3/spu.c
index e17fa14..a0bca05 100644
--- a/arch/powerpc/platforms/ps3/spu.c
+++ b/arch/powerpc/platforms/ps3/spu.c
@@ -143,7 +143,7 @@ static void _dump_areas(unsigned int spe_id, unsigned long priv2,
pr_debug("%s:%d: shadow: %lxh\n", func, line, shadow);
}

-inline u64 ps3_get_spe_id(void *arg)
+u64 ps3_get_spe_id(void *arg)
{
return spu_pdata(arg)->spe_id;
}
--
1.8.1.4

2013-05-09 10:41:30

by Catalin Marinas

[permalink] [raw]
Subject: Re: [PATCH 14/21] arm64: delay: remove inline marking of EXPORT_SYMBOL functions

On Thu, May 09, 2013 at 11:36:52AM +0100, Denis Efremov wrote:
> EXPORT_SYMBOL and inline directives are contradictory to each other.
> The patch fixes this inconsistency.
>
> Found by Linux Driver Verification project (linuxtesting.org).
>
> Signed-off-by: Denis Efremov <[email protected]>
> ---
> arch/arm64/lib/delay.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/arch/arm64/lib/delay.c b/arch/arm64/lib/delay.c
> index dad4ec9..368ca15 100644
> --- a/arch/arm64/lib/delay.c
> +++ b/arch/arm64/lib/delay.c
> @@ -33,7 +33,7 @@ void __delay(unsigned long cycles)
> }
> EXPORT_SYMBOL(__delay);
>
> -inline void __const_udelay(unsigned long xloops)
> +void __const_udelay(unsigned long xloops)
> {
> unsigned long loops;

Acked-by: Catalin Marinas <[email protected]>

2013-05-09 10:41:11

by Denis Efremov

[permalink] [raw]
Subject: [PATCH 21/21] ARM: remove inline marking of EXPORT_SYMBOL functions

EXPORT_SYMBOL and inline directives are contradictory to each other.
The patch fixes this inconsistency.

Found by Linux Driver Verification project (linuxtesting.org).

Signed-off-by: Denis Efremov <[email protected]>
---
arch/arm/mach-sa1100/jornada720_ssp.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm/mach-sa1100/jornada720_ssp.c b/arch/arm/mach-sa1100/jornada720_ssp.c
index b143c46..737842c 100644
--- a/arch/arm/mach-sa1100/jornada720_ssp.c
+++ b/arch/arm/mach-sa1100/jornada720_ssp.c
@@ -33,7 +33,7 @@ static unsigned long jornada_ssp_flags;
* we need to reverse all data we receive from the mcu due to its physical location
* returns : 01110111 -> 11101110
*/
-u8 inline jornada_ssp_reverse(u8 byte)
+u8 jornada_ssp_reverse(u8 byte)
{
return
((0x80 & byte) >> 7) |
--
1.8.1.4

2013-05-09 10:45:54

by Will Deacon

[permalink] [raw]
Subject: Re: [PATCH 13/21] openrisc: delay: remove inline marking of EXPORT_SYMBOL functions

On Thu, May 09, 2013 at 11:36:51AM +0100, Denis Efremov wrote:
> EXPORT_SYMBOL and inline directives are contradictory to each other.
> The patch fixes this inconsistency.
>
> Found by Linux Driver Verification project (linuxtesting.org).
>
> Signed-off-by: Denis Efremov <[email protected]>
> ---
> arch/openrisc/lib/delay.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/arch/openrisc/lib/delay.c b/arch/openrisc/lib/delay.c
> index c82b09f..808a55c 100644
> --- a/arch/openrisc/lib/delay.c
> +++ b/arch/openrisc/lib/delay.c
> @@ -37,7 +37,7 @@ void __delay(unsigned long cycles)
> }
> EXPORT_SYMBOL(__delay);
>
> -inline void __const_udelay(unsigned long xloops)
> +void __const_udelay(unsigned long xloops)
> {
> unsigned long long loops;

Acked-by: Will Deacon <[email protected]>

Will

2013-05-09 11:04:17

by James Hogan

[permalink] [raw]
Subject: Re: [PATCH 12/21] metag: delay: remove inline marking of EXPORT_SYMBOL functions

On 09/05/13 11:36, Denis Efremov wrote:
> EXPORT_SYMBOL and inline directives are contradictory to each other.
> The patch fixes this inconsistency.
>
> Found by Linux Driver Verification project (linuxtesting.org).
>
> Signed-off-by: Denis Efremov <[email protected]>
> ---
> arch/metag/lib/delay.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/arch/metag/lib/delay.c b/arch/metag/lib/delay.c
> index 0b308f4..7ff0ca7 100644
> --- a/arch/metag/lib/delay.c
> +++ b/arch/metag/lib/delay.c
> @@ -36,7 +36,7 @@ void __delay(unsigned long loops)
> }
> EXPORT_SYMBOL(__delay);
>
> -inline void __const_udelay(unsigned long xloops)
> +void __const_udelay(unsigned long xloops)
> {
> u64 loops = (u64)xloops * (u64)loops_per_jiffy * HZ;
> __delay(loops >> 32);
>

The inline still has an effect on code generation if other functions in
the same compilation unit use it, so this isn't really a trivial change.

I.e. before this patch __udelay and __ndelay inlined __const_udelay, but
after it they are changed to just multiply & branch.

Therefore I'd like to hear some more justification for these changes.

Cheers
James


Attachments:
signature.asc (836.00 B)
OpenPGP digital signature

2013-05-09 11:09:20

by Geert Uytterhoeven

[permalink] [raw]
Subject: Re: [PATCH 18/21] m68k/sun3/: remove inline marking of EXPORT_SYMBOL functions

On Thu, May 9, 2013 at 12:36 PM, Denis Efremov <[email protected]> wrote:
> EXPORT_SYMBOL and inline directives are contradictory to each other.
> The patch fixes this inconsistency.
>
> Found by Linux Driver Verification project (linuxtesting.org).
>
> Signed-off-by: Denis Efremov <[email protected]>

Acked-by: Geert Uytterhoeven <[email protected]>

Do you want me to queue this in the m68k tree?

Gr{oetje,eeting}s,

Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds

2013-05-09 11:36:08

by Geoff Levand

[permalink] [raw]
Subject: Re: [PATCH 20/21] powerpc/ps3: remove inline marking of EXPORT_SYMBOL functions

On Thu, 2013-05-09 at 14:36 +0400, Denis Efremov wrote:
> EXPORT_SYMBOL and inline directives are contradictory to each other.
> The patch fixes this inconsistency.
>
> Found by Linux Driver Verification project (linuxtesting.org).
>
> Signed-off-by: Denis Efremov <[email protected]>
> ---
> arch/powerpc/platforms/ps3/spu.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)

Looks good, thanks.

Acked-by: Geoff Levand <[email protected]>

2013-05-09 13:50:27

by H. Peter Anvin

[permalink] [raw]
Subject: Re: [PATCH 03/21] x86: remove inline marking of EXPORT_SYMBOL functions

On 05/09/2013 12:58 AM, Denis Efremov wrote:
> EXPORT_SYMBOL and inline directives are contradictory to each other.
> The patch fixes this inconsistency.
>
> Found by Linux Driver Verification project (linuxtesting.org).

Nice, but wrong.

They aren't contradictory; in gnu89 syntax this means "this can be
inline, but also create an out-of-line copy that others can call."

That being said, I haven't looked at the code to see if that makes
sense, but the statement isn't correct.

-hpa

2013-05-09 18:02:36

by Chris Metcalf

[permalink] [raw]
Subject: Re: [PATCH 15/21] arch/tile: remove inline marking of EXPORT_SYMBOL functions

On 5/9/2013 6:36 AM, Denis Efremov wrote:
> EXPORT_SYMBOL and inline directives are contradictory to each other.
> The patch fixes this inconsistency.
>
> Found by Linux Driver Verification project (linuxtesting.org).
>
> Signed-off-by: Denis Efremov <[email protected]>
> ---
> arch/tile/lib/spinlock_32.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)

Thanks, taken into the tile tree.

--
Chris Metcalf, Tilera Corp.
http://www.tilera.com

2013-05-11 23:13:15

by David Miller

[permalink] [raw]
Subject: Re: [PATCH 11/21] ipv4: ip_output: remove inline marking of EXPORT_SYMBOL functions

From: Denis Efremov <[email protected]>
Date: Thu, 9 May 2013 13:19:42 +0400

> EXPORT_SYMBOL and inline directives are contradictory to each other.
> The patch fixes this inconsistency.
>
> Found by Linux Driver Verification project (linuxtesting.org).
>
> Signed-off-by: Denis Efremov <[email protected]>

Applied, thanks.

2013-05-12 15:13:49

by Viresh Kumar

[permalink] [raw]
Subject: Re: [PATCH 09/21] dw_dmac: remove inline marking of EXPORT_SYMBOL functions

On Fri, May 10, 2013 at 8:54 PM, Andy Shevchenko
<[email protected]> wrote:
> Seems those inlines are leftovers from first versions of the driver. Anyway,
> looks fine by me. I think Viresh can give you an Ack.
>
> 9.5.2013 12.22 "Denis Efremov" <[email protected]> kirjoitti:
>>
>> EXPORT_SYMBOL and inline directives are contradictory to each other.
>> The patch fixes this inconsistency.
>>
>> Found by Linux Driver Verification project (linuxtesting.org).
>>
>> Signed-off-by: Denis Efremov <[email protected]>
>> ---
>> drivers/dma/dw_dmac.c | 4 ++--
>> 1 file changed, 2 insertions(+), 2 deletions(-)

Acked-by: Viresh Kumar <[email protected]>

2013-05-14 16:36:00

by Jesper Nilsson

[permalink] [raw]
Subject: Re: [PATCH 17/21] CRISv32: remove inline marking of EXPORT_SYMBOL functions

On Thu, May 09, 2013 at 12:36:55PM +0200, Denis Efremov wrote:
> EXPORT_SYMBOL and inline directives are contradictory to each other.
> The patch fixes this inconsistency.
>
> Found by Linux Driver Verification project (linuxtesting.org).
>
> Signed-off-by: Denis Efremov <[email protected]>

Yes, agreed.

Acked-by: Jesper Nilsson <[email protected]>

> ---
> arch/cris/arch-v32/kernel/cache.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/arch/cris/arch-v32/kernel/cache.c b/arch/cris/arch-v32/kernel/cache.c
> index f38433b..876be53 100644
> --- a/arch/cris/arch-v32/kernel/cache.c
> +++ b/arch/cris/arch-v32/kernel/cache.c
> @@ -5,7 +5,7 @@
>
> /* This file is used to workaround a cache bug, Guinness TR 106. */
>
> -inline void flush_dma_descr(struct dma_descr_data *descr, int flush_buf)
> +void flush_dma_descr(struct dma_descr_data *descr, int flush_buf)
> {
> /* Flush descriptor to make sure we get correct in_eop and after. */
> asm volatile ("ftagd [%0]" :: "r" (descr));
> --
> 1.8.1.4

/^JN - Jesper Nilsson
--
Jesper Nilsson -- [email protected]

2013-05-17 16:05:27

by Geert Uytterhoeven

[permalink] [raw]
Subject: Re: [PATCH 20/21] powerpc/ps3: remove inline marking of EXPORT_SYMBOL functions

On Thu, May 9, 2013 at 12:36 PM, Denis Efremov <[email protected]> wrote:
> EXPORT_SYMBOL and inline directives are contradictory to each other.
> The patch fixes this inconsistency.
>
> Found by Linux Driver Verification project (linuxtesting.org).
>
> Signed-off-by: Denis Efremov <[email protected]>
> ---
> arch/powerpc/platforms/ps3/spu.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/arch/powerpc/platforms/ps3/spu.c b/arch/powerpc/platforms/ps3/spu.c
> index e17fa14..a0bca05 100644
> --- a/arch/powerpc/platforms/ps3/spu.c
> +++ b/arch/powerpc/platforms/ps3/spu.c
> @@ -143,7 +143,7 @@ static void _dump_areas(unsigned int spe_id, unsigned long priv2,
> pr_debug("%s:%d: shadow: %lxh\n", func, line, shadow);
> }
>
> -inline u64 ps3_get_spe_id(void *arg)
> +u64 ps3_get_spe_id(void *arg)
> {
> return spu_pdata(arg)->spe_id;
> }

FYI, this symbol is not used in mainline.

IIRC, it's used for profiling only. Any chance the profile code will
ever make it
in mainline?

Gr{oetje,eeting}s,

Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds

2013-05-28 23:15:06

by Geoff Levand

[permalink] [raw]
Subject: Re: [PATCH 20/21] powerpc/ps3: remove inline marking of EXPORT_SYMBOL functions

Hi Geert,

On Fri, 2013-05-17 at 18:05 +0200, Geert Uytterhoeven wrote:
> On Thu, May 9, 2013 at 12:36 PM, Denis Efremov <[email protected]> wrote:
> > -inline u64 ps3_get_spe_id(void *arg)
> > +u64 ps3_get_spe_id(void *arg)
> > {
> > return spu_pdata(arg)->spe_id;
> > }
>
> FYI, this symbol is not used in mainline.
>
> IIRC, it's used for profiling only. Any chance the profile code will
> ever make it
> in mainline?

As I announced (below), I dropped the profiling patches since
ps3-queue-v3.8.

The profiling code does not use ps3_get_spe_id(), so I think we should
remove it. I'll submit a patch.

-Geoff

-------- Forwarded Message --------
From: Geoff Levand <[email protected]>
To: [email protected]
Subject: Dropping PS3 oprofile support in v3.8
Date: Wed, 13 Feb 2013 17:30:39 -0800

Hi All,

I'll be dropping the PS3 oprofile patches from my ps3-linux git tree
from linux-3.8. These are the patches:

7f02610 ps3-debugging: Add oprofile test script
49213b6 powerpc/ps3: PS3 oprofile support
aee2985 powerpc/ps3: Add ps3 pmu platform routines
531c3f4 powerpc/ps3: Rearrange order of lpm routines
9d8a7d3 powerpc/cell: Add pmu platform abstraction
6865b99 powerpc/cell: Rearrange order of pmu routines

These patches will still be available in the ps3-queue-v3.7 and earlier
branches for anyone who wants them.

-Geoff



2013-05-30 18:39:14

by Vinod Koul

[permalink] [raw]
Subject: Re: [PATCH 09/21] dw_dmac: remove inline marking of EXPORT_SYMBOL functions

On Thu, May 09, 2013 at 01:19:40PM +0400, Denis Efremov wrote:
> EXPORT_SYMBOL and inline directives are contradictory to each other.
> The patch fixes this inconsistency.
>
> Found by Linux Driver Verification project (linuxtesting.org).
>
> Signed-off-by: Denis Efremov <[email protected]>
Applied, thanks

--
~Vinod
> ---
> drivers/dma/dw_dmac.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/dma/dw_dmac.c b/drivers/dma/dw_dmac.c
> index 43a5329..a526bb9 100644
> --- a/drivers/dma/dw_dmac.c
> +++ b/drivers/dma/dw_dmac.c
> @@ -574,14 +574,14 @@ static void dwc_handle_error(struct dw_dma *dw, struct dw_dma_chan *dwc)
>
> /* --------------------- Cyclic DMA API extensions -------------------- */
>
> -inline dma_addr_t dw_dma_get_src_addr(struct dma_chan *chan)
> +dma_addr_t dw_dma_get_src_addr(struct dma_chan *chan)
> {
> struct dw_dma_chan *dwc = to_dw_dma_chan(chan);
> return channel_readl(dwc, SAR);
> }
> EXPORT_SYMBOL(dw_dma_get_src_addr);
>
> -inline dma_addr_t dw_dma_get_dst_addr(struct dma_chan *chan)
> +dma_addr_t dw_dma_get_dst_addr(struct dma_chan *chan)
> {
> struct dw_dma_chan *dwc = to_dw_dma_chan(chan);
> return channel_readl(dwc, DAR);
> --
> 1.8.1.4
>

--