linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [0/8] patches vs. 2.6.10-mm1
@ 2005-01-03 17:20 William Lee Irwin III
  2005-01-03 17:23 ` [1/8] there is no generic_file_(get|set)_policy() William Lee Irwin III
  0 siblings, 1 reply; 23+ messages in thread
From: William Lee Irwin III @ 2005-01-03 17:20 UTC (permalink / raw)
  To: linux-kernel; +Cc: akpm

This is a series of patches against 2.6.10-mm1. They are mostly warning
cleanups, starting with a compilefix.


-- wli

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

* [1/8] there is no generic_file_(get|set)_policy()
  2005-01-03 17:20 [0/8] patches vs. 2.6.10-mm1 William Lee Irwin III
@ 2005-01-03 17:23 ` William Lee Irwin III
  2005-01-03 17:26   ` [2/8] kill quota_v2.c printk() of size_t warning William Lee Irwin III
  0 siblings, 1 reply; 23+ messages in thread
From: William Lee Irwin III @ 2005-01-03 17:23 UTC (permalink / raw)
  To: linux-kernel; +Cc: akpm

There is no generic_file_set_policy() or generic_file_get_policy.
This patch removes the dangling references to them.

Without this patch, the kernel fails to build from source with
CONFIG_NUMA=y

Signed-off-by: William Irwin <wli@holomorphy.com>


Index: mm1-2.6.10/mm/filemap.c
===================================================================
--- mm1-2.6.10.orig/mm/filemap.c	2005-01-03 06:46:04.000000000 -0800
+++ mm1-2.6.10/mm/filemap.c	2005-01-03 07:50:55.000000000 -0800
@@ -1542,10 +1542,6 @@
 	.nopage		= filemap_nopage,
 	.populate	= filemap_populate,
 	.page_mkwrite	= filemap_page_mkwrite,
-#ifdef CONFIG_NUMA
-	.set_policy     = generic_file_set_policy,
-	.get_policy     = generic_file_get_policy,
-#endif
 };
 
 /* This is used for a general mmap of a disk file */

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

* [2/8] kill quota_v2.c printk() of size_t warning
  2005-01-03 17:23 ` [1/8] there is no generic_file_(get|set)_policy() William Lee Irwin III
@ 2005-01-03 17:26   ` William Lee Irwin III
  2005-01-03 17:28     ` [3/8] kill gen_init_cpio.c " William Lee Irwin III
  0 siblings, 1 reply; 23+ messages in thread
From: William Lee Irwin III @ 2005-01-03 17:26 UTC (permalink / raw)
  To: linux-kernel; +Cc: akpm

The printk() of a size_t is off, tripping a warning. This patch qualifies
the integer format with a 'z' to suppress the warning.

Signed-off-by: William Irwin <wli@holomorphy.com>


Index: mm1-2.6.10/fs/quota_v2.c
===================================================================
--- mm1-2.6.10.orig/fs/quota_v2.c	2005-01-03 06:44:20.000000000 -0800
+++ mm1-2.6.10/fs/quota_v2.c	2005-01-03 07:51:53.000000000 -0800
@@ -396,7 +396,7 @@
 	/* dq_off is guarded by dqio_sem */
 	if (!dquot->dq_off)
 		if ((ret = dq_insert_tree(dquot)) < 0) {
-			printk(KERN_ERR "VFS: Error %d occurred while creating quota.\n", ret);
+			printk(KERN_ERR "VFS: Error %zd occurred while creating quota.\n", ret);
 			return ret;
 		}
 	spin_lock(&dq_data_lock);

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

* [3/8] kill gen_init_cpio.c printk() of size_t warning
  2005-01-03 17:26   ` [2/8] kill quota_v2.c printk() of size_t warning William Lee Irwin III
@ 2005-01-03 17:28     ` William Lee Irwin III
  2005-01-03 17:31       ` [4/8] fix arch/x86_64/ia32/syscall32.c misdeclared pud variable William Lee Irwin III
                         ` (3 more replies)
  0 siblings, 4 replies; 23+ messages in thread
From: William Lee Irwin III @ 2005-01-03 17:28 UTC (permalink / raw)
  To: linux-kernel; +Cc: akpm

The rest of gen_init_cpio.c seems to cast the result of strlen() to
handle this situation, so this patch follows suit while killing off
size_t -related printk() warnings.

Signed-off-by: William Irwin <wli@holomorphy.com>

Index: mm1-2.6.10/usr/gen_init_cpio.c
===================================================================
--- mm1-2.6.10.orig/usr/gen_init_cpio.c	2005-01-03 06:45:53.000000000 -0800
+++ mm1-2.6.10/usr/gen_init_cpio.c	2005-01-03 08:11:18.000000000 -0800
@@ -86,7 +86,7 @@
 		0,			/* minor */
 		0,			/* rmajor */
 		0,			/* rminor */
-		(unsigned)strlen(name) + 1, /* namesize */
+		(unsigned)strlen(name)+1, /* namesize */
 		0);			/* chksum */
 	push_hdr(s);
 	push_rest(name);
@@ -112,7 +112,7 @@
 		(long) gid,		/* gid */
 		1,			/* nlink */
 		(long) mtime,		/* mtime */
-		strlen(target) + 1,	/* filesize */
+		(unsigned)strlen(target)+1, /* filesize */
 		3,			/* major */
 		1,			/* minor */
 		0,			/* rmajor */

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

* [4/8] fix arch/x86_64/ia32/syscall32.c misdeclared pud variable
  2005-01-03 17:28     ` [3/8] kill gen_init_cpio.c " William Lee Irwin III
@ 2005-01-03 17:31       ` William Lee Irwin III
  2005-01-03 17:34       ` William Lee Irwin III
                         ` (2 subsequent siblings)
  3 siblings, 0 replies; 23+ messages in thread
From: William Lee Irwin III @ 2005-01-03 17:31 UTC (permalink / raw)
  To: linux-kernel; +Cc: akpm

This __map_syscall32() gets an assignment from incompatible pointer type
warning; the following patch kills it by declaring the pud variable as a
pud_t as is necessary.

Signed-off-by: William Irwin <wli@holomorphy.com>

Index: mm1-2.6.10/arch/x86_64/ia32/syscall32.c
===================================================================
--- mm1-2.6.10.orig/arch/x86_64/ia32/syscall32.c	2005-01-03 06:44:20.000000000 -0800
+++ mm1-2.6.10/arch/x86_64/ia32/syscall32.c	2005-01-03 07:56:06.000000000 -0800
@@ -41,7 +41,7 @@
 int __map_syscall32(struct mm_struct *mm, unsigned long address)
 { 
 	pgd_t *pgd;
-	pgd_t *pud;
+	pud_t *pud;
 	pte_t *pte;
 	pmd_t *pmd;
 	int err = -ENOMEM;

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

* [4/8] fix arch/x86_64/ia32/syscall32.c misdeclared pud variable
  2005-01-03 17:28     ` [3/8] kill gen_init_cpio.c " William Lee Irwin III
  2005-01-03 17:31       ` [4/8] fix arch/x86_64/ia32/syscall32.c misdeclared pud variable William Lee Irwin III
@ 2005-01-03 17:34       ` William Lee Irwin III
  2005-01-03 17:36         ` [5/8] silence numerous size_t warnings in drivers/acpi/processor_idle.c William Lee Irwin III
  2005-01-03 17:42       ` [3/8] kill gen_init_cpio.c printk() of size_t warning linux-os
  2005-01-03 17:59       ` Jeff Garzik
  3 siblings, 1 reply; 23+ messages in thread
From: William Lee Irwin III @ 2005-01-03 17:34 UTC (permalink / raw)
  To: linux-kernel; +Cc: akpm

pud needs to be declared as a pud_t in order to avoid an assignment
from incompatible pointer type warning or two; this patch makes it so.

Signed-off-by: William Irwin <wli@holomorphy.com>

Index: mm1-2.6.10/arch/x86_64/ia32/syscall32.c
===================================================================
--- mm1-2.6.10.orig/arch/x86_64/ia32/syscall32.c	2005-01-03 06:44:20.000000000 -0800
+++ mm1-2.6.10/arch/x86_64/ia32/syscall32.c	2005-01-03 07:56:06.000000000 -0800
@@ -41,7 +41,7 @@
 int __map_syscall32(struct mm_struct *mm, unsigned long address)
 { 
 	pgd_t *pgd;
-	pgd_t *pud;
+	pud_t *pud;
 	pte_t *pte;
 	pmd_t *pmd;
 	int err = -ENOMEM;

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

* [5/8] silence numerous size_t warnings in drivers/acpi/processor_idle.c
  2005-01-03 17:34       ` William Lee Irwin III
@ 2005-01-03 17:36         ` William Lee Irwin III
  2005-01-03 17:39           ` [6/8] make IRDA string tables conditional on CONFIG_IRDA_DEBUG William Lee Irwin III
  0 siblings, 1 reply; 23+ messages in thread
From: William Lee Irwin III @ 2005-01-03 17:36 UTC (permalink / raw)
  To: linux-kernel; +Cc: akpm

Multiple format -related warnings arise from size_t issues. This
patch peppers the seq_printf()'s with 'z' qualifiers and casts to
silence them all.

Signed-off-by: Wililam Irwin <wli@holomorphy.com>

Index: mm1-2.6.10/drivers/acpi/processor_idle.c
===================================================================
--- mm1-2.6.10.orig/drivers/acpi/processor_idle.c	2005-01-03 06:45:54.000000000 -0800
+++ mm1-2.6.10/drivers/acpi/processor_idle.c	2005-01-03 08:02:46.000000000 -0800
@@ -838,12 +838,12 @@
 	if (!pr)
 		goto end;
 
-	seq_printf(seq, "active state:            C%d\n"
+	seq_printf(seq, "active state:            C%zd\n"
 			"max_cstate:              C%d\n"
 			"bus master activity:     %08x\n",
 			pr->power.state ? pr->power.state - pr->power.states : 0,
 			max_cstate,
-			pr->power.bm_activity);
+			(unsigned)pr->power.bm_activity);
 
 	seq_puts(seq, "states:\n");
 
@@ -872,14 +872,14 @@
 		}
 
 		if (pr->power.states[i].promotion.state)
-			seq_printf(seq, "promotion[C%d] ",
+			seq_printf(seq, "promotion[C%zd] ",
 				(pr->power.states[i].promotion.state -
 				 pr->power.states));
 		else
 			seq_puts(seq, "promotion[--] ");
 
 		if (pr->power.states[i].demotion.state)
-			seq_printf(seq, "demotion[C%d] ",
+			seq_printf(seq, "demotion[C%zd] ",
 				(pr->power.states[i].demotion.state -
 				 pr->power.states));
 		else

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

* [6/8] make IRDA string tables conditional on CONFIG_IRDA_DEBUG
  2005-01-03 17:36         ` [5/8] silence numerous size_t warnings in drivers/acpi/processor_idle.c William Lee Irwin III
@ 2005-01-03 17:39           ` William Lee Irwin III
  2005-01-03 17:45             ` [7/8] fix unresolved MTD symbols in scx200_docflash.c William Lee Irwin III
  0 siblings, 1 reply; 23+ messages in thread
From: William Lee Irwin III @ 2005-01-03 17:39 UTC (permalink / raw)
  To: linux-kernel; +Cc: akpm

There are some string tables only used for debugging printk()'s in IRDA
that trip warnings when CONFIG_IRDA_DEBUG is not set.

This patch makes them conditional on CONFIG_IRDA_DEBUG to silence warnings.

Signed-off-by: William Irwin <wli@holomorphy.com>

Index: mm1-2.6.10/net/irda/ircomm/ircomm_event.c
===================================================================
--- mm1-2.6.10.orig/net/irda/ircomm/ircomm_event.c	2005-01-03 06:44:20.000000000 -0800
+++ mm1-2.6.10/net/irda/ircomm/ircomm_event.c	2005-01-03 08:19:38.000000000 -0800
@@ -57,6 +57,7 @@
 	"IRCOMM_CONN",
 };
 
+#ifdef CONFIG_IRDA_DEBUG
 static char *ircomm_event[] = {
 	"IRCOMM_CONNECT_REQUEST",
         "IRCOMM_CONNECT_RESPONSE",
@@ -75,6 +76,7 @@
         "IRCOMM_CONTROL_REQUEST",
         "IRCOMM_CONTROL_INDICATION",
 };
+#endif /* CONFIG_IRDA_DEBUG */
 
 static int (*state[])(struct ircomm_cb *self, IRCOMM_EVENT event,
 		      struct sk_buff *skb, struct ircomm_info *info) = 
Index: mm1-2.6.10/net/irda/ircomm/ircomm_tty_attach.c
===================================================================
--- mm1-2.6.10.orig/net/irda/ircomm/ircomm_tty_attach.c	2005-01-03 06:44:20.000000000 -0800
+++ mm1-2.6.10/net/irda/ircomm/ircomm_tty_attach.c	2005-01-03 08:18:48.000000000 -0800
@@ -91,6 +91,7 @@
 	"*** ERROR *** ",
 };
 
+#ifdef CONFIG_IRDA_DEBUG
 static char *ircomm_tty_event[] = {
 	"IRCOMM_TTY_ATTACH_CABLE",
 	"IRCOMM_TTY_DETACH_CABLE",
@@ -107,6 +108,7 @@
 	"IRCOMM_TTY_GOT_LSAPSEL",
 	"*** ERROR ****",
 };
+#endif /* CONFIG_IRDA_DEBUG */
 
 static int (*state[])(struct ircomm_tty_cb *self, IRCOMM_TTY_EVENT event,
 		      struct sk_buff *skb, struct ircomm_tty_info *info) = 

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

* Re: [3/8] kill gen_init_cpio.c printk() of size_t warning
  2005-01-03 17:28     ` [3/8] kill gen_init_cpio.c " William Lee Irwin III
  2005-01-03 17:31       ` [4/8] fix arch/x86_64/ia32/syscall32.c misdeclared pud variable William Lee Irwin III
  2005-01-03 17:34       ` William Lee Irwin III
@ 2005-01-03 17:42       ` linux-os
  2005-01-03 17:59       ` Jeff Garzik
  3 siblings, 0 replies; 23+ messages in thread
From: linux-os @ 2005-01-03 17:42 UTC (permalink / raw)
  To: William Lee Irwin III; +Cc: Linux kernel, akpm

On Mon, 3 Jan 2005, William Lee Irwin III wrote:

> The rest of gen_init_cpio.c seems to cast the result of strlen() to
> handle this situation, so this patch follows suit while killing off
> size_t -related printk() warnings.
>
> Signed-off-by: William Irwin <wli@holomorphy.com>
>
> Index: mm1-2.6.10/usr/gen_init_cpio.c
> ===================================================================
> --- mm1-2.6.10.orig/usr/gen_init_cpio.c	2005-01-03 06:45:53.000000000 -0800
> +++ mm1-2.6.10/usr/gen_init_cpio.c	2005-01-03 08:11:18.000000000 -0800
> @@ -86,7 +86,7 @@
> 		0,			/* minor */
> 		0,			/* rmajor */
> 		0,			/* rminor */
> -		(unsigned)strlen(name) + 1, /* namesize */
> +		(unsigned)strlen(name)+1, /* namesize */
> 		0);			/* chksum */
> 	push_hdr(s);
> 	push_rest(name);
> @@ -112,7 +112,7 @@
> 		(long) gid,		/* gid */
> 		1,			/* nlink */
> 		(long) mtime,		/* mtime */
> -		strlen(target) + 1,	/* filesize */
> +		(unsigned)strlen(target)+1, /* filesize */
> 		3,			/* major */
> 		1,			/* minor */
> 		0,			/* rmajor */
> -

The problem is that '1' is an int, not an unsigned int.
So, the correct fix is:

 		strlen(target) + 1U;

Cheers,
Dick Johnson
Penguin : Linux version 2.6.9 on an i686 machine (5537.79 BogoMips).
  Notice : All mail here is now cached for review by Dictator Bush.
                  98.36% of all statistics are fiction.

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

* [7/8] fix unresolved MTD symbols in scx200_docflash.c
  2005-01-03 17:39           ` [6/8] make IRDA string tables conditional on CONFIG_IRDA_DEBUG William Lee Irwin III
@ 2005-01-03 17:45             ` William Lee Irwin III
  2005-01-03 17:47               ` [8/8] fix module_param() type mismatch in drivers/char/n_hdlc.c William Lee Irwin III
  0 siblings, 1 reply; 23+ messages in thread
From: William Lee Irwin III @ 2005-01-03 17:45 UTC (permalink / raw)
  To: linux-kernel; +Cc: akpm

This driver is using some private #ifdef to try to control the use of
partitions and calling functions that get compiled out of the kernel
if it's set (which it is by default). This results in unresolved module
symbols, which are bad.

This patch synchronizes the conditional compilation of partition
management in the driver with the global config option for MTD
partition management and thereby fixes the unresolved symbol problem.

Signed-off-by: William Irwin <wli@holomorphy.com>

Index: mm1-2.6.10/drivers/mtd/maps/scx200_docflash.c
===================================================================
--- mm1-2.6.10.orig/drivers/mtd/maps/scx200_docflash.c	2005-01-03 06:46:06.000000000 -0800
+++ mm1-2.6.10/drivers/mtd/maps/scx200_docflash.c	2005-01-03 08:25:39.000000000 -0800
@@ -26,9 +26,6 @@
 MODULE_DESCRIPTION("NatSemi SCx200 DOCCS Flash Driver");
 MODULE_LICENSE("GPL");
 
-/* Set this to one if you want to partition the flash */
-#define PARTITION 1
-
 static int probe = 0;		/* Don't autoprobe */
 static unsigned size = 0x1000000; /* 16 MiB the whole ISA address space */
 static unsigned width = 8;	/* Default to 8 bits wide */
@@ -50,7 +47,7 @@
 
 static struct mtd_info *mymtd;
 
-#if PARTITION
+#ifdef CONFIG_MTD_PARTITIONS
 static struct mtd_partition partition_info[] = {
 	{ 
 		.name   = "DOCCS Boot kernel", 
@@ -200,7 +197,7 @@
 
 	mymtd->owner = THIS_MODULE;
 
-#if PARTITION
+#ifdef CONFIG_MTD_PARTITIONS
 	partition_info[3].offset = mymtd->size-partition_info[3].size;
 	partition_info[2].size = partition_info[3].offset-partition_info[2].offset;
 	add_mtd_partitions(mymtd, partition_info, NUM_PARTITIONS);
@@ -213,7 +210,7 @@
 static void __exit cleanup_scx200_docflash(void)
 {
 	if (mymtd) {
-#if PARTITION
+#ifdef CONFIG_MTD_PARTITIONS
 		del_mtd_partitions(mymtd);
 #else
 		del_mtd_device(mymtd);

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

* [8/8] fix module_param() type mismatch in drivers/char/n_hdlc.c
  2005-01-03 17:45             ` [7/8] fix unresolved MTD symbols in scx200_docflash.c William Lee Irwin III
@ 2005-01-03 17:47               ` William Lee Irwin III
  2005-01-03 18:11                 ` William Lee Irwin III
  0 siblings, 1 reply; 23+ messages in thread
From: William Lee Irwin III @ 2005-01-03 17:47 UTC (permalink / raw)
  To: linux-kernel; +Cc: akpm

maxframe is a variable of type ssize_t; this patch repairs the warning
arising from the type mismatch in the module_param() declaration.

Signed-off-by: William Irwin <wli@holomorphy.com>

Index: mm1-2.6.10/drivers/char/n_hdlc.c
===================================================================
--- mm1-2.6.10.orig/drivers/char/n_hdlc.c	2005-01-03 06:46:06.000000000 -0800
+++ mm1-2.6.10/drivers/char/n_hdlc.c	2005-01-03 08:35:57.000000000 -0800
@@ -976,5 +976,5 @@
 MODULE_LICENSE("GPL");
 MODULE_AUTHOR("Paul Fulghum paulkf@microgate.com");
 module_param(debuglevel, int, 0);
-module_param(maxframe, int, 0);
+module_param(maxframe, ssize_t, 0);
 MODULE_ALIAS_LDISC(N_HDLC);

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

* Re: [3/8] kill gen_init_cpio.c printk() of size_t warning
  2005-01-03 17:28     ` [3/8] kill gen_init_cpio.c " William Lee Irwin III
                         ` (2 preceding siblings ...)
  2005-01-03 17:42       ` [3/8] kill gen_init_cpio.c printk() of size_t warning linux-os
@ 2005-01-03 17:59       ` Jeff Garzik
  2005-01-03 18:09         ` William Lee Irwin III
  3 siblings, 1 reply; 23+ messages in thread
From: Jeff Garzik @ 2005-01-03 17:59 UTC (permalink / raw)
  To: William Lee Irwin III; +Cc: linux-kernel, akpm

William Lee Irwin III wrote:
> The rest of gen_init_cpio.c seems to cast the result of strlen() to
> handle this situation, so this patch follows suit while killing off
> size_t -related printk() warnings.
> 
> Signed-off-by: William Irwin <wli@holomorphy.com>
> 
> Index: mm1-2.6.10/usr/gen_init_cpio.c
> ===================================================================
> --- mm1-2.6.10.orig/usr/gen_init_cpio.c	2005-01-03 06:45:53.000000000 -0800
> +++ mm1-2.6.10/usr/gen_init_cpio.c	2005-01-03 08:11:18.000000000 -0800
> @@ -86,7 +86,7 @@
>  		0,			/* minor */
>  		0,			/* rmajor */
>  		0,			/* rminor */
> -		(unsigned)strlen(name) + 1, /* namesize */
> +		(unsigned)strlen(name)+1, /* namesize */
>  		0);			/* chksum */
>  	push_hdr(s);
>  	push_rest(name);
> @@ -112,7 +112,7 @@
>  		(long) gid,		/* gid */
>  		1,			/* nlink */
>  		(long) mtime,		/* mtime */
> -		strlen(target) + 1,	/* filesize */
> +		(unsigned)strlen(target)+1, /* filesize */

This removes whitespace in the process, violating the file's chosen 
style (and typical lkml style).

	Jeff




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

* Re: [3/8] kill gen_init_cpio.c printk() of size_t warning
  2005-01-03 17:59       ` Jeff Garzik
@ 2005-01-03 18:09         ` William Lee Irwin III
  2005-01-03 18:33           ` linux-os
  0 siblings, 1 reply; 23+ messages in thread
From: William Lee Irwin III @ 2005-01-03 18:09 UTC (permalink / raw)
  To: Jeff Garzik; +Cc: linux-kernel, akpm

On Mon, Jan 03, 2005 at 12:59:55PM -0500, Jeff Garzik wrote:
> This removes whitespace in the process, violating the file's chosen 
> style (and typical lkml style).

I have no personal interest in the whitespace involved. The following
amended patch is likely to avoid inconsistencies with the rest of the
file regarding whitespace.


-- wli


Index: mm1-2.6.10/usr/gen_init_cpio.c
===================================================================
--- mm1-2.6.10.orig/usr/gen_init_cpio.c	2005-01-03 06:45:53.000000000 -0800
+++ mm1-2.6.10/usr/gen_init_cpio.c	2005-01-03 09:42:18.000000000 -0800
@@ -112,7 +112,7 @@
 		(long) gid,		/* gid */
 		1,			/* nlink */
 		(long) mtime,		/* mtime */
-		strlen(target) + 1,	/* filesize */
+		(unsigned)strlen(target) + 1,/* filesize */
 		3,			/* major */
 		1,			/* minor */
 		0,			/* rmajor */

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

* Re: [8/8] fix module_param() type mismatch in drivers/char/n_hdlc.c
  2005-01-03 17:47               ` [8/8] fix module_param() type mismatch in drivers/char/n_hdlc.c William Lee Irwin III
@ 2005-01-03 18:11                 ` William Lee Irwin III
  0 siblings, 0 replies; 23+ messages in thread
From: William Lee Irwin III @ 2005-01-03 18:11 UTC (permalink / raw)
  To: linux-kernel; +Cc: akpm

On Mon, Jan 03, 2005 at 09:47:13AM -0800, William Lee Irwin III wrote:
> maxframe is a variable of type ssize_t; this patch repairs the warning
> arising from the type mismatch in the module_param() declaration.
> Signed-off-by: William Irwin <wli@holomorphy.com>

I flubbed the testing cycle for that patch only. The following patch
should be applied instead.

Index: mm1-2.6.10/drivers/char/n_hdlc.c
===================================================================
--- mm1-2.6.10.orig/drivers/char/n_hdlc.c	2005-01-03 06:46:06.000000000 -0800
+++ mm1-2.6.10/drivers/char/n_hdlc.c	2005-01-03 09:38:17.000000000 -0800
@@ -177,7 +177,7 @@
 static int debuglevel;
 
 /* max frame size for memory allocations */
-static ssize_t maxframe = 4096;
+static int maxframe = 4096;
 
 /* TTY callbacks */
 
@@ -672,7 +672,7 @@
 		if (debuglevel & DEBUG_LEVEL_INFO)
 			printk (KERN_WARNING
 				"n_hdlc_tty_write: truncating user packet "
-				"from %lu to %Zd\n", (unsigned long) count,
+				"from %lu to %d\n", (unsigned long) count,
 				maxframe );
 		count = maxframe;
 	}

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

* Re: [3/8] kill gen_init_cpio.c printk() of size_t warning
  2005-01-03 18:09         ` William Lee Irwin III
@ 2005-01-03 18:33           ` linux-os
  2005-01-03 21:09             ` H. Peter Anvin
  0 siblings, 1 reply; 23+ messages in thread
From: linux-os @ 2005-01-03 18:33 UTC (permalink / raw)
  To: William Lee Irwin III; +Cc: Jeff Garzik, Linux kernel, akpm

On Mon, 3 Jan 2005, William Lee Irwin III wrote:

> On Mon, Jan 03, 2005 at 12:59:55PM -0500, Jeff Garzik wrote:
>> This removes whitespace in the process, violating the file's chosen
>> style (and typical lkml style).
>
> I have no personal interest in the whitespace involved. The following
> amended patch is likely to avoid inconsistencies with the rest of the
> file regarding whitespace.
>
>
> -- wli
>

But it's wrong.
It should be:
> +		strlen(target) + 1U,	/* filesize */

strlen() already returns a size_t. You need an unsigned 1 to
not affect it. As previously stated, an integer constant
is an int, not an unsigned int unless you make it so with
"U".

>
> Index: mm1-2.6.10/usr/gen_init_cpio.c
> ===================================================================
> --- mm1-2.6.10.orig/usr/gen_init_cpio.c	2005-01-03 06:45:53.000000000 -0800
> +++ mm1-2.6.10/usr/gen_init_cpio.c	2005-01-03 09:42:18.000000000 -0800
> @@ -112,7 +112,7 @@
> 		(long) gid,		/* gid */
> 		1,			/* nlink */
> 		(long) mtime,		/* mtime */
> -		strlen(target) + 1,	/* filesize */
> +		(unsigned)strlen(target) + 1,/* filesize */
> 		3,			/* major */
> 		1,			/* minor */
> 		0,			/* rmajor */
> -
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at  http://www.tux.org/lkml/
>

Cheers,
Dick Johnson
Penguin : Linux version 2.6.9 on an i686 machine (5537.79 BogoMips).
  Notice : All mail here is now cached for review by Dictator Bush.
                  98.36% of all statistics are fiction.

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

* Re: [3/8] kill gen_init_cpio.c printk() of size_t warning
  2005-01-03 18:33           ` linux-os
@ 2005-01-03 21:09             ` H. Peter Anvin
  2005-01-03 21:36               ` William Lee Irwin III
  0 siblings, 1 reply; 23+ messages in thread
From: H. Peter Anvin @ 2005-01-03 21:09 UTC (permalink / raw)
  To: linux-kernel

Followup to:  <Pine.LNX.4.61.0501031329030.13385@chaos.analogic.com>
By author:    linux-os <linux-os@chaos.analogic.com>
In newsgroup: linux.dev.kernel
> 
> But it's wrong.
> It should be:
> > +		strlen(target) + 1U,	/* filesize */
> 
> strlen() already returns a size_t. You need an unsigned 1 to
> not affect it. As previously stated, an integer constant
> is an int, not an unsigned int unless you make it so with
> "U".
> 

Dear Wrongbot,

Bullshit.  Signed is promoted to unsigned.

	-hpa

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

* Re: [3/8] kill gen_init_cpio.c printk() of size_t warning
  2005-01-03 21:09             ` H. Peter Anvin
@ 2005-01-03 21:36               ` William Lee Irwin III
  2005-01-03 21:41                 ` H. Peter Anvin
  2005-01-03 21:55                 ` Al Viro
  0 siblings, 2 replies; 23+ messages in thread
From: William Lee Irwin III @ 2005-01-03 21:36 UTC (permalink / raw)
  To: H. Peter Anvin; +Cc: linux-kernel

Followup to:  <Pine.LNX.4.61.0501031329030.13385@chaos.analogic.com>
By author:    linux-os <linux-os@chaos.analogic.com>
In newsgroup: linux.dev.kernel
>> But it's wrong.
>> It should be:
>>> +		strlen(target) + 1U,	/* filesize */
>> strlen() already returns a size_t. You need an unsigned 1 to
>> not affect it. As previously stated, an integer constant
>> is an int, not an unsigned int unless you make it so with
>> "U".

On Mon, Jan 03, 2005 at 09:09:48PM +0000, H. Peter Anvin wrote:
> Dear Wrongbot,
> Bullshit.  Signed is promoted to unsigned.

I'm not sure who you're responding to here, but gcc emitted an actual
warning and I was only attempting to carry out the minimal effort
necessary to silence it. I'm not really interested in creating or
being involved with controversy, just silencing the core build in the
least invasive and so on way possible, leaving deeper drivers/ issues
to the resolution of the true underlying problems.

I don't have anything to do with the code excerpt above; I merely
followed the style of the other unsigned integer coercions in the file.


-- wli

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

* Re: [3/8] kill gen_init_cpio.c printk() of size_t warning
  2005-01-03 21:36               ` William Lee Irwin III
@ 2005-01-03 21:41                 ` H. Peter Anvin
  2005-01-03 22:03                   ` linux-os
  2005-01-03 21:55                 ` Al Viro
  1 sibling, 1 reply; 23+ messages in thread
From: H. Peter Anvin @ 2005-01-03 21:41 UTC (permalink / raw)
  To: William Lee Irwin III; +Cc: linux-kernel

William Lee Irwin III wrote:
> 
> On Mon, Jan 03, 2005 at 09:09:48PM +0000, H. Peter Anvin wrote:
> 
>>Dear Wrongbot,
>>Bullshit.  Signed is promoted to unsigned.
> 
> I'm not sure who you're responding to here, but gcc emitted an actual
> warning and I was only attempting to carry out the minimal effort
> necessary to silence it. I'm not really interested in creating or
> being involved with controversy, just silencing the core build in the
> least invasive and so on way possible, leaving deeper drivers/ issues
> to the resolution of the true underlying problems.
> 
> I don't have anything to do with the code excerpt above; I merely
> followed the style of the other unsigned integer coercions in the file.
> 

I was not responding to you, your stuff is perfectly sane.

The claim from the Wrongbot was that "foo + 1" is bad when foo is a 
size_t.  This is utter bullshit, since that's EXACTLY equivalent to:

	foo + (size_t)1

... because of promotion rules.

	-hpa

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

* Re: [3/8] kill gen_init_cpio.c printk() of size_t warning
  2005-01-03 21:36               ` William Lee Irwin III
  2005-01-03 21:41                 ` H. Peter Anvin
@ 2005-01-03 21:55                 ` Al Viro
  2005-01-03 22:09                   ` William Lee Irwin III
  2005-01-03 23:03                   ` Ben Pfaff
  1 sibling, 2 replies; 23+ messages in thread
From: Al Viro @ 2005-01-03 21:55 UTC (permalink / raw)
  To: William Lee Irwin III; +Cc: H. Peter Anvin, linux-kernel

On Mon, Jan 03, 2005 at 01:36:27PM -0800, William Lee Irwin III wrote:
> I'm not sure who you're responding to here, but gcc emitted an actual
> warning and I was only attempting to carry out the minimal effort
> necessary to silence it. I'm not really interested in creating or
> being involved with controversy, just silencing the core build in the
> least invasive and so on way possible, leaving deeper drivers/ issues
> to the resolution of the true underlying problems.
> 
> I don't have anything to do with the code excerpt above; I merely
> followed the style of the other unsigned integer coercions in the file.

Egads...  Just use %zd for size_t.  It's going to have rank no less than
that of int, so you'll get 1 converted to size_t and size_t as type of
result.

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

* Re: [3/8] kill gen_init_cpio.c printk() of size_t warning
  2005-01-03 21:41                 ` H. Peter Anvin
@ 2005-01-03 22:03                   ` linux-os
  0 siblings, 0 replies; 23+ messages in thread
From: linux-os @ 2005-01-03 22:03 UTC (permalink / raw)
  To: H. Peter Anvin; +Cc: William Lee Irwin III, linux-kernel

On Mon, 3 Jan 2005, H. Peter Anvin wrote:

> William Lee Irwin III wrote:
>> 
>> On Mon, Jan 03, 2005 at 09:09:48PM +0000, H. Peter Anvin wrote:
>> 
>>> Dear Wrongbot,
>>> Bullshit.  Signed is promoted to unsigned.
>> 
>> I'm not sure who you're responding to here, but gcc emitted an actual
>> warning and I was only attempting to carry out the minimal effort
>> necessary to silence it. I'm not really interested in creating or
>> being involved with controversy, just silencing the core build in the
>> least invasive and so on way possible, leaving deeper drivers/ issues
>> to the resolution of the true underlying problems.
>> 
>> I don't have anything to do with the code excerpt above; I merely
>> followed the style of the other unsigned integer coercions in the file.
>> 
>
> I was not responding to you, your stuff is perfectly sane.
>
> The claim from the Wrongbot was that "foo + 1" is bad when foo is a size_t. 
> This is utter bullshit, since that's EXACTLY equivalent to:
>
> 	foo + (size_t)1
>
> ... because of promotion rules.
>
> 	-hpa
> -

I made no such claim. I claimed that the posted fix was wrong:

>
> Index: mm1-2.6.10/usr/gen_init_cpio.c
> ===================================================================
> --- mm1-2.6.10.orig/usr/gen_init_cpio.c	2005-01-03 06:45:53.000000000 -0800
> +++ mm1-2.6.10/usr/gen_init_cpio.c	2005-01-03 09:42:18.000000000 -0800
> @@ -112,7 +112,7 @@
> 		(long) gid,		/* gid */
> 		1,			/* nlink */
> 		(long) mtime,		/* mtime */
> -		strlen(target) + 1,	/* filesize */
> +		(unsigned)strlen(target) + 1,/* filesize */
> 		3,			/* major */
> 		1,			/* minor */
> 		0,			/* rmajor */
> -


This is wrong because strlen() already returns a size_t (unsigned).
This "fix" only served to quiet the compiler which was warning
about the conversion. It is a "conversion", not a "promotion".
The simple fix to quiet this conversion warning is to use 1U
as previously shown.

Cheers,
Dick Johnson
Penguin : Linux version 2.6.9 on an i686 machine (5537.79 BogoMips).
  Notice : All mail here is now cached for review by Dictator Bush.
                  98.36% of all statistics are fiction.

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

* Re: [3/8] kill gen_init_cpio.c printk() of size_t warning
  2005-01-03 21:55                 ` Al Viro
@ 2005-01-03 22:09                   ` William Lee Irwin III
  2005-01-03 23:03                   ` Ben Pfaff
  1 sibling, 0 replies; 23+ messages in thread
From: William Lee Irwin III @ 2005-01-03 22:09 UTC (permalink / raw)
  To: Al Viro; +Cc: H. Peter Anvin, linux-kernel

On Mon, Jan 03, 2005 at 01:36:27PM -0800, William Lee Irwin III wrote:
>> I'm not sure who you're responding to here, but gcc emitted an actual
>> warning and I was only attempting to carry out the minimal effort
>> necessary to silence it. I'm not really interested in creating or
>> being involved with controversy, just silencing the core build in the
>> least invasive and so on way possible, leaving deeper drivers/ issues
>> to the resolution of the true underlying problems.
>> I don't have anything to do with the code excerpt above; I merely
>> followed the style of the other unsigned integer coercions in the file.

On Mon, Jan 03, 2005 at 09:55:03PM +0000, Al Viro wrote:
> Egads...  Just use %zd for size_t.  It's going to have rank no less than
> that of int, so you'll get 1 converted to size_t and size_t as type of
> result.

My personal preference was to do that, but it would have been
inconsistent with the approach used in the rest of the file.


-- wli

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

* Re: [3/8] kill gen_init_cpio.c printk() of size_t warning
  2005-01-03 21:55                 ` Al Viro
  2005-01-03 22:09                   ` William Lee Irwin III
@ 2005-01-03 23:03                   ` Ben Pfaff
  2005-01-03 23:56                     ` H. Peter Anvin
  1 sibling, 1 reply; 23+ messages in thread
From: Ben Pfaff @ 2005-01-03 23:03 UTC (permalink / raw)
  To: linux-kernel

Al Viro <viro@parcelfarce.linux.theplanet.co.uk> writes:

> Egads...  Just use %zd for size_t.

%zu?


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

* Re: [3/8] kill gen_init_cpio.c printk() of size_t warning
  2005-01-03 23:03                   ` Ben Pfaff
@ 2005-01-03 23:56                     ` H. Peter Anvin
  0 siblings, 0 replies; 23+ messages in thread
From: H. Peter Anvin @ 2005-01-03 23:56 UTC (permalink / raw)
  To: linux-kernel

Followup to:  <87oeg6t8t5.fsf@benpfaff.org>
By author:    Ben Pfaff <blp@cs.stanford.edu>
In newsgroup: linux.dev.kernel
>
> Al Viro <viro@parcelfarce.linux.theplanet.co.uk> writes:
> 
> > Egads...  Just use %zd for size_t.
> 
> %zu?
> 

Right, %zu for size_t, %zd for ssize_t.

       -hpa

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

end of thread, other threads:[~2005-01-04  0:01 UTC | newest]

Thread overview: 23+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-01-03 17:20 [0/8] patches vs. 2.6.10-mm1 William Lee Irwin III
2005-01-03 17:23 ` [1/8] there is no generic_file_(get|set)_policy() William Lee Irwin III
2005-01-03 17:26   ` [2/8] kill quota_v2.c printk() of size_t warning William Lee Irwin III
2005-01-03 17:28     ` [3/8] kill gen_init_cpio.c " William Lee Irwin III
2005-01-03 17:31       ` [4/8] fix arch/x86_64/ia32/syscall32.c misdeclared pud variable William Lee Irwin III
2005-01-03 17:34       ` William Lee Irwin III
2005-01-03 17:36         ` [5/8] silence numerous size_t warnings in drivers/acpi/processor_idle.c William Lee Irwin III
2005-01-03 17:39           ` [6/8] make IRDA string tables conditional on CONFIG_IRDA_DEBUG William Lee Irwin III
2005-01-03 17:45             ` [7/8] fix unresolved MTD symbols in scx200_docflash.c William Lee Irwin III
2005-01-03 17:47               ` [8/8] fix module_param() type mismatch in drivers/char/n_hdlc.c William Lee Irwin III
2005-01-03 18:11                 ` William Lee Irwin III
2005-01-03 17:42       ` [3/8] kill gen_init_cpio.c printk() of size_t warning linux-os
2005-01-03 17:59       ` Jeff Garzik
2005-01-03 18:09         ` William Lee Irwin III
2005-01-03 18:33           ` linux-os
2005-01-03 21:09             ` H. Peter Anvin
2005-01-03 21:36               ` William Lee Irwin III
2005-01-03 21:41                 ` H. Peter Anvin
2005-01-03 22:03                   ` linux-os
2005-01-03 21:55                 ` Al Viro
2005-01-03 22:09                   ` William Lee Irwin III
2005-01-03 23:03                   ` Ben Pfaff
2005-01-03 23:56                     ` H. Peter Anvin

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).