mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Al Viro <viro@ZenIV.linux.org.uk>
To: linux-kernel@vger.kernel.org
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Subject: [POC][PATCH 34/83] drivers/s390: ger rid of pointless casts
Date: Mon, 21 Dec 2015 23:47:07 +0000	[thread overview]
Message-ID: <1450741676-5865-34-git-send-email-viro@ZenIV.linux.org.uk> (raw)
In-Reply-To: <20151221234615.GW20997@ZenIV.linux.org.uk>

From: Al Viro <viro@zeniv.linux.org.uk>

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
---
 drivers/s390/block/xpram.c        | 24 ++++++++++++------------
 drivers/s390/char/sclp_ftp.c      | 10 +++++-----
 drivers/s390/cio/qdio.h           |  2 +-
 drivers/s390/cio/qdio_main.c      |  2 +-
 drivers/s390/cio/qdio_setup.c     |  4 ++--
 drivers/s390/cio/qdio_thinint.c   |  2 +-
 drivers/s390/net/qeth_core_main.c |  4 ++--
 7 files changed, 24 insertions(+), 24 deletions(-)

diff --git a/drivers/s390/block/xpram.c b/drivers/s390/block/xpram.c
index 542c6d0..87d13a6 100644
--- a/drivers/s390/block/xpram.c
+++ b/drivers/s390/block/xpram.c
@@ -87,7 +87,7 @@ MODULE_LICENSE("GPL");
  *           -EIO:         if pgin failed
  *           -ENXIO:       if xpram has vanished
  */
-static int xpram_page_in (unsigned long page_addr, unsigned int xpage_index)
+static int xpram_page_in (void *page_addr, unsigned int xpage_index)
 {
 	int cc = 2;	/* return unused cc 2 if pgin traps */
 
@@ -117,7 +117,7 @@ static int xpram_page_in (unsigned long page_addr, unsigned int xpage_index)
  *           -EIO:         if pgout failed
  *           -ENXIO:       if xpram has vanished
  */
-static long xpram_page_out (unsigned long page_addr, unsigned int xpage_index)
+static long xpram_page_out (void *page_addr, unsigned int xpage_index)
 {
 	int cc = 2;	/* return unused cc 2 if pgin traps */
 
@@ -142,14 +142,14 @@ static long xpram_page_out (unsigned long page_addr, unsigned int xpage_index)
  */
 static int xpram_present(void)
 {
-	unsigned long mem_page;
+	void *mem_page;
 	int rc;
 
-	mem_page = (unsigned long) __get_free_page(GFP_KERNEL);
+	mem_page = (void *)__get_free_page(GFP_KERNEL);
 	if (!mem_page)
 		return -ENOMEM;
 	rc = xpram_page_in(mem_page, 0);
-	free_page((void *)mem_page);
+	free_page(mem_page);
 	return rc ? -ENXIO : 0;
 }
 
@@ -159,9 +159,9 @@ static int xpram_present(void)
 static unsigned long xpram_highest_page_index(void)
 {
 	unsigned int page_index, add_bit;
-	unsigned long mem_page;
+	void *mem_page;
 
-	mem_page = (unsigned long) __get_free_page(GFP_KERNEL);
+	mem_page = (void *) __get_free_page(GFP_KERNEL);
 	if (!mem_page)
 		return 0;
 
@@ -173,7 +173,7 @@ static unsigned long xpram_highest_page_index(void)
 		add_bit >>= 1;
 	}
 
-	free_page((void *)mem_page);
+	free_page(mem_page);
 
 	return page_index;
 }
@@ -187,7 +187,7 @@ static blk_qc_t xpram_make_request(struct request_queue *q, struct bio *bio)
 	struct bio_vec bvec;
 	struct bvec_iter iter;
 	unsigned int index;
-	unsigned long page_addr;
+	void *page_addr;
 	unsigned long bytes;
 
 	blk_queue_split(q, &bio, q->bio_split);
@@ -203,10 +203,10 @@ static blk_qc_t xpram_make_request(struct request_queue *q, struct bio *bio)
 		goto fail;
 	index = (bio->bi_iter.bi_sector >> 3) + xdev->offset;
 	bio_for_each_segment(bvec, bio, iter) {
-		page_addr = (unsigned long)
-			kmap(bvec.bv_page) + bvec.bv_offset;
+		page_addr = kmap(bvec.bv_page) + bvec.bv_offset;
 		bytes = bvec.bv_len;
-		if ((page_addr & 4095) != 0 || (bytes & 4095) != 0)
+		if (((unsigned long)page_addr & 4095) != 0 ||
+		    (bytes & 4095) != 0)
 			/* More paranoia. */
 			goto fail;
 		while (bytes > 0) {
diff --git a/drivers/s390/char/sclp_ftp.c b/drivers/s390/char/sclp_ftp.c
index 726e736..4de9d40 100644
--- a/drivers/s390/char/sclp_ftp.c
+++ b/drivers/s390/char/sclp_ftp.c
@@ -239,7 +239,7 @@ static struct sclp_register sclp_ftp_event = {
 int sclp_ftp_startup(void)
 {
 #ifdef DEBUG
-	unsigned long info;
+	void *info;
 #endif
 	int rc;
 
@@ -248,10 +248,10 @@ int sclp_ftp_startup(void)
 		return rc;
 
 #ifdef DEBUG
-	info = (unsigned long)get_zeroed_page(GFP_KERNEL);
+	info = get_zeroed_page(GFP_KERNEL);
 
-	if (info != 0) {
-		struct sysinfo_2_2_2 *info222 = (struct sysinfo_2_2_2 *)info;
+	if (info) {
+		struct sysinfo_2_2_2 *info222 = info;
 
 		if (!stsi(info222, 2, 2, 2)) { /* get SYSIB 2.2.2 */
 			info222->name[sizeof(info222->name) - 1] = '\0';
@@ -260,7 +260,7 @@ int sclp_ftp_startup(void)
 				 info222->lpar_number, info222->name);
 		}
 
-		free_page((void *)info);
+		free_page(info);
 	}
 #endif	/* DEBUG */
 	return 0;
diff --git a/drivers/s390/cio/qdio.h b/drivers/s390/cio/qdio.h
index 7e70f92..6551443 100644
--- a/drivers/s390/cio/qdio.h
+++ b/drivers/s390/cio/qdio.h
@@ -300,7 +300,7 @@ struct qdio_irq {
 	int perf_stat_enabled;
 
 	struct qdr *qdr;
-	unsigned long chsc_page;
+	void *chsc_page;
 
 	struct qdio_q *input_qs[QDIO_MAX_QUEUES_PER_IRQ];
 	struct qdio_q *output_qs[QDIO_MAX_QUEUES_PER_IRQ];
diff --git a/drivers/s390/cio/qdio_main.c b/drivers/s390/cio/qdio_main.c
index 0b1ffc2..86c4599 100644
--- a/drivers/s390/cio/qdio_main.c
+++ b/drivers/s390/cio/qdio_main.c
@@ -1282,7 +1282,7 @@ int qdio_allocate(struct qdio_initialize *init_data)
 	 * qdio_establish. In case of low memory and swap on a zfcp disk
 	 * we may not be able to allocate memory otherwise.
 	 */
-	irq_ptr->chsc_page = (unsigned long)get_zeroed_page(GFP_KERNEL);
+	irq_ptr->chsc_page = get_zeroed_page(GFP_KERNEL);
 	if (!irq_ptr->chsc_page)
 		goto out_rel;
 
diff --git a/drivers/s390/cio/qdio_setup.c b/drivers/s390/cio/qdio_setup.c
index 637d1a8..7322dd3 100644
--- a/drivers/s390/cio/qdio_setup.c
+++ b/drivers/s390/cio/qdio_setup.c
@@ -309,7 +309,7 @@ int qdio_setup_get_ssqd(struct qdio_irq *irq_ptr,
 		if (!ssqd)
 			return -ENOMEM;
 	} else {
-		ssqd = (struct chsc_ssqd_area *)irq_ptr->chsc_page;
+		ssqd = irq_ptr->chsc_page;
 	}
 
 	rc = chsc_ssqd(*schid, ssqd);
@@ -389,7 +389,7 @@ void qdio_release_memory(struct qdio_irq *irq_ptr)
 		}
 	}
 	free_page(irq_ptr->qdr);
-	free_page((void *)irq_ptr->chsc_page);
+	free_page(irq_ptr->chsc_page);
 	free_page(irq_ptr);
 }
 
diff --git a/drivers/s390/cio/qdio_thinint.c b/drivers/s390/cio/qdio_thinint.c
index 5d06253..ff0355d5 100644
--- a/drivers/s390/cio/qdio_thinint.c
+++ b/drivers/s390/cio/qdio_thinint.c
@@ -213,7 +213,7 @@ static void tiqdio_thinint_handler(struct airq_struct *airq)
 
 static int set_subchannel_ind(struct qdio_irq *irq_ptr, int reset)
 {
-	struct chsc_scssc_area *scssc = (void *)irq_ptr->chsc_page;
+	struct chsc_scssc_area *scssc = irq_ptr->chsc_page;
 	u64 summary_indicator_addr, subchannel_indicator_addr;
 	int rc;
 
diff --git a/drivers/s390/net/qeth_core_main.c b/drivers/s390/net/qeth_core_main.c
index b6bd54c..18f4db4 100644
--- a/drivers/s390/net/qeth_core_main.c
+++ b/drivers/s390/net/qeth_core_main.c
@@ -3160,7 +3160,7 @@ static int qeth_query_setdiagass(struct qeth_card *card)
 
 static void qeth_get_trap_id(struct qeth_card *card, struct qeth_trap_id *tid)
 {
-	unsigned long info = (unsigned long)get_zeroed_page(GFP_KERNEL);
+	void *info = get_zeroed_page(GFP_KERNEL);
 	struct sysinfo_2_2_2 *info222 = (struct sysinfo_2_2_2 *)info;
 	struct sysinfo_3_2_2 *info322 = (struct sysinfo_3_2_2 *)info;
 	struct ccw_dev_id ccwid;
@@ -3179,7 +3179,7 @@ static void qeth_get_trap_id(struct qeth_card *card, struct qeth_trap_id *tid)
 		EBCASC(info322->vm[0].name, sizeof(info322->vm[0].name));
 		memcpy(tid->vmname, info322->vm[0].name, sizeof(tid->vmname));
 	}
-	free_page((void *)info);
+	free_page(info);
 	return;
 }
 
-- 
2.1.4


  parent reply	other threads:[~2015-12-22  0:02 UTC|newest]

Thread overview: 94+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-12-21 23:46 [RFC] free_pages stuff Al Viro
2015-12-21 23:46 ` [POC][PATCH 01/83] switch free_page() from unsigned long to const void * Al Viro
2015-12-21 23:46 ` [POC][PATCH 02/83] switch free_pages() " Al Viro
2015-12-21 23:46 ` [POC][PATCH 03/83] switch get_zeroed_page() to returning " Al Viro
2015-12-21 23:46 ` [POC][PATCH 04/83] kill unused {get,free}_user_page() Al Viro
2015-12-21 23:46 ` [POC][PATCH 05/83] switch copy_mount_options to storing void * instead of unsigned long Al Viro
2015-12-21 23:46 ` [POC][PATCH 06/83] drivers/net/wireless/libertas/debugfs.c: get rid of pointless casts Al Viro
2015-12-21 23:46 ` [POC][PATCH 07/83] drivers/net/wireless/mwifiex/debugfs.c: " Al Viro
2015-12-21 23:46 ` [POC][PATCH 08/83] affs_evict_inode(): " Al Viro
2015-12-21 23:46 ` [POC][PATCH 09/83] configfs_follow_link(): " Al Viro
2015-12-21 23:46 ` [POC][PATCH 10/83] kernfs_iop_follow_link(): " Al Viro
2015-12-21 23:46 ` [POC][PATCH 11/83] sound/oss/vidc: keep dma_buf[] as pointers Al Viro
2015-12-21 23:46 ` [POC][PATCH 12/83] drivers/tty: get rid of pointless casts Al Viro
2015-12-21 23:46 ` [POC][PATCH 13/83] rds: keep pointers in ->m_page_addrs[] Al Viro
2015-12-21 23:46 ` [POC][PATCH 14/83] proc_dev_atm_read(): get rid of pointless casts Al Viro
2015-12-21 23:46 ` [POC][PATCH 15/83] qib get_map_page(): " Al Viro
2015-12-21 23:46 ` [POC][PATCH 16/83] user_namespace: " Al Viro
2015-12-21 23:46 ` [POC][PATCH 17/83] ftrace: " Al Viro
2015-12-21 23:46 ` [POC][PATCH 18/83] sysctl: " Al Viro
2015-12-21 23:46 ` [POC][PATCH 19/83] xenstored_local_init(): " Al Viro
2015-12-21 23:46 ` [POC][PATCH 20/83] staging/rdma: " Al Viro
2015-12-21 23:46 ` [POC][PATCH 21/83] c6x: remove unused macros Al Viro
2015-12-21 23:46 ` [POC][PATCH 22/83] [davinci] ccdc_update_raw_params() frees the wrong thing Al Viro
2015-12-21 23:46 ` [POC][PATCH 23/83] fd_dma_mem_free(): pass address as void * instead of unsigned long Al Viro
2015-12-21 23:46 ` [POC][PATCH 24/83] ppc: keep ->hpt_virt as a pointer Al Viro
2015-12-21 23:46 ` [POC][PATCH 25/83] dma_4u_alloc_coherent(): don't mix virtual and physical addresses Al Viro
2015-12-21 23:46 ` [POC][PATCH 26/83] dma_4v_alloc_coherent(): " Al Viro
2015-12-21 23:47 ` [POC][PATCH 27/83] new helper: get_dma_pages() Al Viro
2015-12-21 23:47 ` [POC][PATCH 28/83] make fd_dma_mem_alloc/nodma_mem_alloc return a pointer Al Viro
2015-12-21 23:47 ` [POC][PATCH 29/83] switch the remaining users of __get_dma_pages() to get_dma_pages() Al Viro
2015-12-21 23:47 ` [POC][PATCH 30/83] sparc: get rid of pointless casts Al Viro
2015-12-21 23:47 ` [POC][PATCH 31/83] efficeon: " Al Viro
2015-12-21 23:47 ` [POC][PATCH 32/83] lguest: " Al Viro
2015-12-21 23:47 ` [POC][PATCH 33/83] drivers/pci: " Al Viro
2015-12-21 23:47 ` Al Viro [this message]
2015-12-21 23:47 ` [POC][PATCH 35/83] s390 kvm: " Al Viro
2015-12-21 23:47 ` [POC][PATCH 36/83] pcibios: " Al Viro
2015-12-21 23:47 ` [POC][PATCH 37/83] ste_dma40: " Al Viro
2015-12-21 23:47 ` [POC][PATCH 38/83] usb_mon: " Al Viro
2015-12-21 23:47 ` [POC][PATCH 39/83] gnttab_end_foreign_access(): switch the last argument to void * Al Viro
2015-12-21 23:47 ` [POC][PATCH 40/83] nios2: dma_free_coherent(): get rid of pointless casts Al Viro
2015-12-21 23:47 ` [POC][PATCH 41/83] hsi: " Al Viro
2015-12-21 23:47 ` [POC][PATCH 42/83] simserial: " Al Viro
2015-12-21 23:47 ` [POC][PATCH 43/83] arm64 vdso: " Al Viro
2015-12-21 23:47 ` [POC][PATCH 44/83] cris free_init_page(): switch to __free_page() Al Viro
2015-12-21 23:47 ` [POC][PATCH 45/83] arm: switch kvm_arm_hyp_stack_page to void * Al Viro
2015-12-21 23:47 ` [POC][PATCH 46/83] frv consistent_alloc(): switch page " Al Viro
2015-12-21 23:47 ` [POC][PATCH 47/83] ia64: uncached_add_chunk(): switch to __free_pages() Al Viro
2015-12-21 23:47 ` [POC][PATCH 48/83] jfs_readdir(): make dirent_buf a pointer Al Viro
2015-12-21 23:47 ` [POC][PATCH 49/83] get rid of casts in alloc_exact stuff Al Viro
2015-12-21 23:47 ` [POC][PATCH 50/83] s390 cmm: get rid of pointless casts Al Viro
2015-12-21 23:47 ` [POC][PATCH 51/83] microblaze consistent_alloc(): " Al Viro
2015-12-21 23:47 ` [POC][PATCH 52/83] devm_{get_}free_pages(): switch to pointers Al Viro
2015-12-21 23:47 ` [POC][PATCH 53/83] cavium: (partially) get rid of cargo-culting in allocator Al Viro
2015-12-21 23:47 ` [POC][PATCH 54/83] um: store stacks as pointers Al Viro
2015-12-21 23:47 ` [POC][PATCH 55/83] sh: get rid of pointless casts Al Viro
2015-12-21 23:47 ` [POC][PATCH 56/83] amd_gart_64: " Al Viro
2015-12-21 23:47 ` [POC][PATCH 57/83] iwlegacy: " Al Viro
2015-12-21 23:47 ` [POC][PATCH 58/83] iwlwifi: " Al Viro
2015-12-21 23:47 ` [POC][PATCH 59/83] add pointer-returning variants of __get_free_pages/__get_free_page Al Viro
2015-12-21 23:47 ` [POC][PATCH 60/83] switch obvious cases to get_free_pages() Al Viro
2015-12-21 23:47 ` [POC][PATCH 61/83] switch obvious cases to get_free_page() Al Viro
2015-12-21 23:47 ` [POC][PATCH 62/83] m68k: switch pte_alloc_one_kernel() " Al Viro
2015-12-21 23:47 ` [POC][PATCH 63/83] switch kvmppc_core_vcpu_create_pr() " Al Viro
2015-12-21 23:47 ` [POC][PATCH 64/83] drivers/video/fbdev: switch to get_free_pages() Al Viro
2015-12-21 23:47 ` [POC][PATCH 65/83] um: switch to get_free_page() Al Viro
2015-12-21 23:47 ` [POC][PATCH 66/83] switch xen_get_swiotlb_free_pages() to returning a pointer Al Viro
2015-12-21 23:47 ` [POC][PATCH 67/83] mn10300 dma_alloc_coherent(): switch to get_free_pages() Al Viro
2015-12-21 23:47 ` [POC][PATCH 68/83] switch ps3_dma_map() and ps3_dma_region_ops->map() instances to physical address Al Viro
2015-12-21 23:47 ` [POC][PATCH 69/83] ps3_alloc_coherent(): get rid of pointless casts Al Viro
2015-12-21 23:47 ` [POC][PATCH 70/83] s390_dma_alloc(): page_to_phys() result is always a multiple of PAGE_SIZE Al Viro
2015-12-21 23:47 ` [POC][PATCH 71/83] s390_dma_alloc(): use page_address() Al Viro
2015-12-21 23:47 ` [POC][PATCH 72/83] [powerpc] switch cmm_page_array->pages[] to pointers Al Viro
2015-12-21 23:47 ` [POC][PATCH 73/83] niu.c: get rid of pointless casts Al Viro
2015-12-21 23:47 ` [POC][PATCH 74/83] [s390] switch pcpu_alloc_lowcore() to get_free_page() Al Viro
2015-12-21 23:47 ` [POC][PATCH 75/83] kill __get_free_page() Al Viro
2015-12-21 23:47 ` [POC][PATCH 76/83] [mips, s390, score] turn empty_zero_page into pointer Al Viro
2015-12-21 23:47 ` [POC][PATCH 77/83] sparc: switch to get_free_pages() Al Viro
2015-12-21 23:47 ` [POC][PATCH 78/83] x86: " Al Viro
2015-12-21 23:47 ` [POC][PATCH 79/83] s390: turn suspend_zero_pages into a pointer Al Viro
2015-12-21 23:47 ` [POC][PATCH 80/83] [sun3] try to sort dvma types out Al Viro
2015-12-21 23:47 ` [POC][PATCH 81/83] sba_iommu: get rid of pointless casts Al Viro
2015-12-21 23:47 ` [POC][PATCH 82/83] media/platform/omap: " Al Viro
2015-12-21 23:47 ` [POC][PATCH 83/83] nios2: " Al Viro
2015-12-22  0:03 ` [RFC] free_pages stuff Linus Torvalds
2015-12-22  1:04   ` Al Viro
     [not found]     ` <CA+55aFy9NrV_RnziN9z3p5O6rv1A0mirhLD0hL7Wrb77+YyBeg@mail.gmail.com>
2015-12-22  1:23       ` Linus Torvalds
2015-12-22  3:10         ` Al Viro
2015-12-22  2:22       ` Al Viro
2015-12-22  8:21         ` Geert Uytterhoeven
2015-12-22 21:04           ` Al Viro
2016-01-05 13:59             ` Michal Hocko
2016-01-05 15:26               ` Al Viro
2016-01-05 15:42                 ` Michal Hocko

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=1450741676-5865-34-git-send-email-viro@ZenIV.linux.org.uk \
    --to=viro@zeniv.linux.org.uk \
    --cc=linux-kernel@vger.kernel.org \
    --cc=torvalds@linux-foundation.org \
    /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 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®