All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jesse Millan <jessem@cs.pdx.edu>
To: kernel-janitors@vger.kernel.org
Subject: [KJ] GCC4 wavelan_cs.c warning: large integer implicitly truncated
Date: Wed, 06 Jul 2005 23:46:57 +0000	[thread overview]
Message-ID: <42CC6D71.7090605@cs.pdx.edu> (raw)

[-- Attachment #1: Type: text/plain, Size: 2 bytes --]




[-- Attachment #2: wavelan_cs.patch --]
[-- Type: text/x-diff, Size: 1584 bytes --]



ifrm_spc is a 4 bit wide bitfield. Trying to assign the 6 bit value 0x20
to it results in the compiler chopping off the first 2 bits and assigning
the remaining 4 bits (all zeros) to it. Similar story for slottim_low.

I don't think that was the intended purpose. I am not a driver writer,
but by comparing the comments by the assignment along with the code in a
similar driver (znet.c), it looks as if the assignment should be 0x2 not
0x20 i.e. 2*16 is "32 bit times the interframe spacing" not 32*16. 0x20
is 32*16, which seems to be 512 bit times the interframe spacing.

Signed-off-by: Jesse Millan <jessem@cs.pdx.edu>
---


diff -puN drivers/net/wireless/wavelan_cs.c~wavelan_cs drivers/net/wireless/wavelan_cs.c
--- linux-2.6.13-rc2.kj.jm.gcc4/drivers/net/wireless/wavelan_cs.c~wavelan_cs	2005-07-06 15:54:23.107182264 -0700
+++ linux-2.6.13-rc2.kj.jm.gcc4-jessem/drivers/net/wireless/wavelan_cs.c	2005-07-06 16:45:04.972748408 -0700
@@ -3604,8 +3604,8 @@ wv_82593_config(struct net_device *	dev)
   cfblk.lin_prio = 0;   	/* conform to 802.3 backoff algoritm */
   cfblk.exp_prio = 5;	        /* conform to 802.3 backoff algoritm */
   cfblk.bof_met = 1;	        /* conform to 802.3 backoff algoritm */
-  cfblk.ifrm_spc = 0x20;	/* 32 bit times interframe spacing */
-  cfblk.slottim_low = 0x20;	/* 32 bit times slot time */
+  cfblk.ifrm_spc = 0x2;	/* 32 bit times interframe spacing */
+  cfblk.slottim_low = 0x2;	/* 32 bit times slot time */
   cfblk.slottim_hi = 0x0;
   cfblk.max_retr = 15;
   cfblk.prmisc = ((lp->promiscuous) ? TRUE: FALSE);	/* Promiscuous mode */
_


[-- Attachment #3: Type: text/plain, Size: 168 bytes --]

_______________________________________________
Kernel-janitors mailing list
Kernel-janitors@lists.osdl.org
https://lists.osdl.org/mailman/listinfo/kernel-janitors

                 reply	other threads:[~2005-07-06 23:46 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=42CC6D71.7090605@cs.pdx.edu \
    --to=jessem@cs.pdx.edu \
    --cc=kernel-janitors@vger.kernel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.