mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH 0/2] stm/intel_th: Fix compilation warnings
@ 2015-10-06  9:47 Alexander Shishkin
  2015-10-06  9:47 ` [PATCH 1/2] stm class: Mark src::link __rcu Alexander Shishkin
  2015-10-06  9:47 ` [PATCH 2/2] intel_th: Fix integer mismatch warnings Alexander Shishkin
  0 siblings, 2 replies; 3+ messages in thread
From: Alexander Shishkin @ 2015-10-06  9:47 UTC (permalink / raw)
  To: Greg Kroah-Hartman; +Cc: linux-kernel, Alexander Shishkin

Hi Greg,

Here are the fixes for char-misc-testing warnings introduced by my
STM/Intel TH patchset.

Alexander Shishkin (2):
  stm class: Mark src::link __rcu
  intel_th: Fix integer mismatch warnings

 drivers/hwtracing/intel_th/msu.c | 2 +-
 drivers/hwtracing/stm/core.c     | 9 ++++++---
 drivers/hwtracing/stm/stm.h      | 2 +-
 3 files changed, 8 insertions(+), 5 deletions(-)

-- 
2.5.3


^ permalink raw reply	[flat|nested] 3+ messages in thread

* [PATCH 1/2] stm class: Mark src::link __rcu
  2015-10-06  9:47 [PATCH 0/2] stm/intel_th: Fix compilation warnings Alexander Shishkin
@ 2015-10-06  9:47 ` Alexander Shishkin
  2015-10-06  9:47 ` [PATCH 2/2] intel_th: Fix integer mismatch warnings Alexander Shishkin
  1 sibling, 0 replies; 3+ messages in thread
From: Alexander Shishkin @ 2015-10-06  9:47 UTC (permalink / raw)
  To: Greg Kroah-Hartman; +Cc: linux-kernel, Alexander Shishkin

Source device's link is protected with srcu, mark it as such to have
proper build-time validation of accesses to this field. The update
side that's dereferencing it under an update lock also needs an
accessor to dereference this field to keep sparse happy.

Signed-off-by: Alexander Shishkin <alexander.shishkin@linux.intel.com>
---
 drivers/hwtracing/stm/core.c | 9 ++++++---
 drivers/hwtracing/stm/stm.h  | 2 +-
 2 files changed, 7 insertions(+), 4 deletions(-)

diff --git a/drivers/hwtracing/stm/core.c b/drivers/hwtracing/stm/core.c
index b79c42c625..b6445d9e54 100644
--- a/drivers/hwtracing/stm/core.c
+++ b/drivers/hwtracing/stm/core.c
@@ -781,17 +781,20 @@ fail_detach:
 static void __stm_source_link_drop(struct stm_source_device *src,
 				   struct stm_device *stm)
 {
+	struct stm_device *link;
+
 	spin_lock(&src->link_lock);
-	if (WARN_ON_ONCE(src->link != stm)) {
+	link = srcu_dereference_check(src->link, &stm_source_srcu, 1);
+	if (WARN_ON_ONCE(link != stm)) {
 		spin_unlock(&src->link_lock);
 		return;
 	}
 
-	stm_output_free(src->link, &src->output);
+	stm_output_free(link, &src->output);
 	/* caller must hold stm::link_lock */
 	list_del_init(&src->link_entry);
 	/* matches stm_find_device() from stm_source_link_store() */
-	stm_put_device(src->link);
+	stm_put_device(link);
 	rcu_assign_pointer(src->link, NULL);
 
 	spin_unlock(&src->link_lock);
diff --git a/drivers/hwtracing/stm/stm.h b/drivers/hwtracing/stm/stm.h
index cf33bf976a..95ece0292c 100644
--- a/drivers/hwtracing/stm/stm.h
+++ b/drivers/hwtracing/stm/stm.h
@@ -74,7 +74,7 @@ struct stm_source_device {
 	struct device		dev;
 	struct stm_source_data	*data;
 	spinlock_t		link_lock;
-	struct stm_device	*link;
+	struct stm_device __rcu	*link;
 	struct list_head	link_entry;
 	/* one output per stm_source device */
 	struct stp_policy_node	*policy_node;
-- 
2.5.3


^ permalink raw reply	[flat|nested] 3+ messages in thread

* [PATCH 2/2] intel_th: Fix integer mismatch warnings
  2015-10-06  9:47 [PATCH 0/2] stm/intel_th: Fix compilation warnings Alexander Shishkin
  2015-10-06  9:47 ` [PATCH 1/2] stm class: Mark src::link __rcu Alexander Shishkin
@ 2015-10-06  9:47 ` Alexander Shishkin
  1 sibling, 0 replies; 3+ messages in thread
From: Alexander Shishkin @ 2015-10-06  9:47 UTC (permalink / raw)
  To: Greg Kroah-Hartman; +Cc: linux-kernel, Alexander Shishkin

Use unsigned long in place of size_t to operate on buffer sizes and
offsets to clean up the 32 bit build.

Signed-off-by: Alexander Shishkin <alexander.shishkin@linux.intel.com>
---
 drivers/hwtracing/intel_th/msu.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/hwtracing/intel_th/msu.c b/drivers/hwtracing/intel_th/msu.c
index 99f7662e27..80a12384ed 100644
--- a/drivers/hwtracing/intel_th/msu.c
+++ b/drivers/hwtracing/intel_th/msu.c
@@ -1056,7 +1056,7 @@ static int intel_th_msc_release(struct inode *inode, struct file *file)
 static ssize_t
 msc_single_to_user(struct msc *msc, char __user *buf, loff_t off, size_t len)
 {
-	size_t size = msc->nr_pages << PAGE_SHIFT, rem = len;
+	unsigned long size = msc->nr_pages << PAGE_SHIFT, rem = len;
 	unsigned long start = off, tocopy = 0;
 
 	if (msc->single_wrap) {
-- 
2.5.3


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2015-10-06  9:49 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-10-06  9:47 [PATCH 0/2] stm/intel_th: Fix compilation warnings Alexander Shishkin
2015-10-06  9:47 ` [PATCH 1/2] stm class: Mark src::link __rcu Alexander Shishkin
2015-10-06  9:47 ` [PATCH 2/2] intel_th: Fix integer mismatch warnings Alexander Shishkin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®