diff options
author | Takashi Iwai <tiwai@suse.de> | 2008-09-05 17:04:04 -0400 |
---|---|---|
committer | Jeff Garzik <jgarzik@redhat.com> | 2008-09-24 18:48:56 -0400 |
commit | c2d1eb085d2eb47a3b16726f79fcf0d53648ebc0 (patch) | |
tree | 6600bbedc3b70e679dc4c71ac6464391908a6d0e /drivers/net/skfp/pmf.c | |
parent | d1c5ea33c006e921f706f5075c09edc91e714263 (diff) |
drivers/net/skfp/pmf.c: Use offsetof() macro
Self-baked macros cause bunch of compile warnings like below:
CC [M] drivers/net/skfp/pmf.o
CC net/ipv4/fib_semantics.o
drivers/net/skfp/pmf.c:86: warning: cast from pointer to integer of different size
drivers/net/skfp/pmf.c:87: warning: cast from pointer to integer of different size
...
Use the standard offsetof() macro instead.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Acked-by: Alan Cox <alan@redhat.com>
Cc: Jeff Garzik <jeff@garzik.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
Diffstat (limited to 'drivers/net/skfp/pmf.c')
-rw-r--r-- | drivers/net/skfp/pmf.c | 29 |
1 files changed, 11 insertions, 18 deletions
diff --git a/drivers/net/skfp/pmf.c b/drivers/net/skfp/pmf.c index ea85de918233..79e665e0853d 100644 --- a/drivers/net/skfp/pmf.c +++ b/drivers/net/skfp/pmf.c | |||
@@ -44,17 +44,10 @@ static SMbuf *smt_build_pmf_response(struct s_smc *smc, struct smt_header *req, | |||
44 | int set, int local); | 44 | int set, int local); |
45 | static int port_to_mib(struct s_smc *smc, int p); | 45 | static int port_to_mib(struct s_smc *smc, int p); |
46 | 46 | ||
47 | #define MOFFSS(e) ((int)&(((struct fddi_mib *)0)->e)) | 47 | #define MOFFSS(e) offsetof(struct fddi_mib, e) |
48 | #define MOFFSA(e) ((int) (((struct fddi_mib *)0)->e)) | 48 | #define MOFFMS(e) offsetof(struct fddi_mib_m, e) |
49 | 49 | #define MOFFAS(e) offsetof(struct fddi_mib_a, e) | |
50 | #define MOFFMS(e) ((int)&(((struct fddi_mib_m *)0)->e)) | 50 | #define MOFFPS(e) offsetof(struct fddi_mib_p, e) |
51 | #define MOFFMA(e) ((int) (((struct fddi_mib_m *)0)->e)) | ||
52 | |||
53 | #define MOFFAS(e) ((int)&(((struct fddi_mib_a *)0)->e)) | ||
54 | #define MOFFAA(e) ((int) (((struct fddi_mib_a *)0)->e)) | ||
55 | |||
56 | #define MOFFPS(e) ((int)&(((struct fddi_mib_p *)0)->e)) | ||
57 | #define MOFFPA(e) ((int) (((struct fddi_mib_p *)0)->e)) | ||
58 | 51 | ||
59 | 52 | ||
60 | #define AC_G 0x01 /* Get */ | 53 | #define AC_G 0x01 /* Get */ |
@@ -87,8 +80,8 @@ static const struct s_p_tab { | |||
87 | { SMT_P100D,AC_G, MOFFSS(fddiSMTOpVersionId), "S" } , | 80 | { SMT_P100D,AC_G, MOFFSS(fddiSMTOpVersionId), "S" } , |
88 | { SMT_P100E,AC_G, MOFFSS(fddiSMTHiVersionId), "S" } , | 81 | { SMT_P100E,AC_G, MOFFSS(fddiSMTHiVersionId), "S" } , |
89 | { SMT_P100F,AC_G, MOFFSS(fddiSMTLoVersionId), "S" } , | 82 | { SMT_P100F,AC_G, MOFFSS(fddiSMTLoVersionId), "S" } , |
90 | { SMT_P1010,AC_G, MOFFSA(fddiSMTManufacturerData), "D" } , | 83 | { SMT_P1010,AC_G, MOFFSS(fddiSMTManufacturerData), "D" } , |
91 | { SMT_P1011,AC_GR, MOFFSA(fddiSMTUserData), "D" } , | 84 | { SMT_P1011,AC_GR, MOFFSS(fddiSMTUserData), "D" } , |
92 | { SMT_P1012,AC_G, MOFFSS(fddiSMTMIBVersionId), "S" } , | 85 | { SMT_P1012,AC_G, MOFFSS(fddiSMTMIBVersionId), "S" } , |
93 | 86 | ||
94 | /* StationConfigGrp */ | 87 | /* StationConfigGrp */ |
@@ -103,7 +96,7 @@ static const struct s_p_tab { | |||
103 | { SMT_P101D,AC_GR, MOFFSS(fddiSMTTT_Notify), "wS" } , | 96 | { SMT_P101D,AC_GR, MOFFSS(fddiSMTTT_Notify), "wS" } , |
104 | { SMT_P101E,AC_GR, MOFFSS(fddiSMTStatRptPolicy), "bB" } , | 97 | { SMT_P101E,AC_GR, MOFFSS(fddiSMTStatRptPolicy), "bB" } , |
105 | { SMT_P101F,AC_GR, MOFFSS(fddiSMTTrace_MaxExpiration),"lL" } , | 98 | { SMT_P101F,AC_GR, MOFFSS(fddiSMTTrace_MaxExpiration),"lL" } , |
106 | { SMT_P1020,AC_G, MOFFSA(fddiSMTPORTIndexes), "II" } , | 99 | { SMT_P1020,AC_G, MOFFSS(fddiSMTPORTIndexes), "II" } , |
107 | { SMT_P1021,AC_G, MOFFSS(fddiSMTMACIndexes), "I" } , | 100 | { SMT_P1021,AC_G, MOFFSS(fddiSMTMACIndexes), "I" } , |
108 | { SMT_P1022,AC_G, MOFFSS(fddiSMTBypassPresent), "F" } , | 101 | { SMT_P1022,AC_G, MOFFSS(fddiSMTBypassPresent), "F" } , |
109 | 102 | ||
@@ -117,8 +110,8 @@ static const struct s_p_tab { | |||
117 | 110 | ||
118 | /* MIBOperationGrp */ | 111 | /* MIBOperationGrp */ |
119 | { SMT_P1032,AC_GROUP } , | 112 | { SMT_P1032,AC_GROUP } , |
120 | { SMT_P1033,AC_G, MOFFSA(fddiSMTTimeStamp),"P" } , | 113 | { SMT_P1033,AC_G, MOFFSS(fddiSMTTimeStamp),"P" } , |
121 | { SMT_P1034,AC_G, MOFFSA(fddiSMTTransitionTimeStamp),"P" } , | 114 | { SMT_P1034,AC_G, MOFFSS(fddiSMTTransitionTimeStamp),"P" } , |
122 | /* NOTE : SMT_P1035 is already swapped ! SMT_P_SETCOUNT */ | 115 | /* NOTE : SMT_P1035 is already swapped ! SMT_P_SETCOUNT */ |
123 | { SMT_P1035,AC_G, MOFFSS(fddiSMTSetCount),"4P" } , | 116 | { SMT_P1035,AC_G, MOFFSS(fddiSMTSetCount),"4P" } , |
124 | { SMT_P1036,AC_G, MOFFSS(fddiSMTLastSetStationId),"8" } , | 117 | { SMT_P1036,AC_G, MOFFSS(fddiSMTLastSetStationId),"8" } , |
@@ -129,7 +122,7 @@ static const struct s_p_tab { | |||
129 | * PRIVATE EXTENSIONS | 122 | * PRIVATE EXTENSIONS |
130 | * only accessible locally to get/set passwd | 123 | * only accessible locally to get/set passwd |
131 | */ | 124 | */ |
132 | { SMT_P10F0,AC_GR, MOFFSA(fddiPRPMFPasswd), "8" } , | 125 | { SMT_P10F0,AC_GR, MOFFSS(fddiPRPMFPasswd), "8" } , |
133 | { SMT_P10F1,AC_GR, MOFFSS(fddiPRPMFStation), "8" } , | 126 | { SMT_P10F1,AC_GR, MOFFSS(fddiPRPMFStation), "8" } , |
134 | #ifdef ESS | 127 | #ifdef ESS |
135 | { SMT_P10F2,AC_GR, MOFFSS(fddiESSPayload), "lL" } , | 128 | { SMT_P10F2,AC_GR, MOFFSS(fddiESSPayload), "lL" } , |
@@ -245,7 +238,7 @@ static const struct s_p_tab { | |||
245 | { SMT_P400E,AC_GR, MOFFPS(fddiPORTConnectionPolicies),"bB" } , | 238 | { SMT_P400E,AC_GR, MOFFPS(fddiPORTConnectionPolicies),"bB" } , |
246 | { SMT_P400F,AC_G, MOFFPS(fddiPORTMacIndicated), "2" } , | 239 | { SMT_P400F,AC_G, MOFFPS(fddiPORTMacIndicated), "2" } , |
247 | { SMT_P4010,AC_G, MOFFPS(fddiPORTCurrentPath), "E" } , | 240 | { SMT_P4010,AC_G, MOFFPS(fddiPORTCurrentPath), "E" } , |
248 | { SMT_P4011,AC_GR, MOFFPA(fddiPORTRequestedPaths), "l4" } , | 241 | { SMT_P4011,AC_GR, MOFFPS(fddiPORTRequestedPaths), "l4" } , |
249 | { SMT_P4012,AC_G, MOFFPS(fddiPORTMACPlacement), "S" } , | 242 | { SMT_P4012,AC_G, MOFFPS(fddiPORTMACPlacement), "S" } , |
250 | { SMT_P4013,AC_G, MOFFPS(fddiPORTAvailablePaths), "B" } , | 243 | { SMT_P4013,AC_G, MOFFPS(fddiPORTAvailablePaths), "B" } , |
251 | { SMT_P4016,AC_G, MOFFPS(fddiPORTPMDClass), "E" } , | 244 | { SMT_P4016,AC_G, MOFFPS(fddiPORTPMDClass), "E" } , |