DragonFly submit List (threaded) for 2006-01
[
Date Prev][
Date Next]
[
Thread Prev][
Thread Next]
[
Date Index][
Thread Index]
netproto/smb warnings patch
Hi,
1) Fix warnings about lvalues assignment
2) Remove unneccessary checks
Index: smb_conn.c
===================================================================
RCS file: /mnt/share/dragonfly-cvs/src/sys/netproto/smb/smb_conn.c,v
retrieving revision 1.9
diff -u -r1.9 smb_conn.c
--- smb_conn.c 6 Dec 2005 04:03:56 -0000 1.9
+++ smb_conn.c 17 Jan 2006 12:51:29 -0000
@@ -116,13 +116,16 @@
struct smb_cred *scred, struct smb_vc **vcpp)
{
struct thread *td = scred->scr_td;
+ struct smb_connobj *scp;
struct smb_vc *vcp;
int exact = 1;
int error;
vcspec->shspec = shspec;
error = ENOENT;
- SMBCO_FOREACH((struct smb_connobj*)vcp, &smb_vclist) {
+ vcp = NULL;
+ SMBCO_FOREACH(scp, &smb_vclist) {
+ vcp = (struct smb_vc *)scp;
error = smb_vc_lock(vcp, LK_EXCLUSIVE, td);
if (error)
continue;
@@ -573,12 +576,14 @@
struct smb_cred *scred, struct smb_share **sspp)
{
struct thread *td = scred->scr_td;
+ struct smb_connobj *scp;
struct smb_share *ssp = NULL;
int error;
*sspp = NULL;
dp->scred = scred;
- SMBCO_FOREACH((struct smb_connobj*)ssp, VCTOCP(vcp)) {
+ SMBCO_FOREACH(scp, VCTOCP(vcp)) {
+ ssp = (struct smb_share *)scp;
error = smb_share_lock(ssp, LK_EXCLUSIVE, td);
if (error)
continue;
@@ -832,6 +837,7 @@
struct smb_share *ssp;
struct smb_vc_info vci;
struct smb_share_info ssi;
+ struct smb_connobj *scp1, *scp2;
int error, itype;
KKASSERT(td->td_proc);
@@ -841,7 +847,8 @@
error = smb_sm_lockvclist(LK_SHARED, td);
if (error)
return error;
- SMBCO_FOREACH((struct smb_connobj*)vcp, &smb_vclist) {
+ SMBCO_FOREACH(scp1, &smb_vclist) {
+ vcp = (struct smb_vc *)scp1;
error = smb_vc_lock(vcp, LK_SHARED, td);
if (error)
continue;
@@ -851,7 +858,8 @@
smb_vc_unlock(vcp, 0, td);
break;
}
- SMBCO_FOREACH((struct smb_connobj*)ssp, VCTOCP(vcp)) {
+ SMBCO_FOREACH(scp2, VCTOCP(vcp)) {
+ ssp = (struct smb_share *)scp2;
error = smb_share_lock(ssp, LK_SHARED, td);
if (error) {
error = 0;
Index: smb_usr.c
===================================================================
RCS file: /mnt/share/dragonfly-cvs/src/sys/netproto/smb/smb_usr.c,v
retrieving revision 1.3
diff -u -r1.3 smb_usr.c
--- smb_usr.c 7 Aug 2003 21:17:39 -0000 1.3
+++ smb_usr.c 17 Jan 2006 13:03:35 -0000
@@ -296,8 +296,7 @@
struct mdchain *mdp;
int error, len;
- if (dp->ioc_tparamcnt > 0xffff || dp->ioc_tdatacnt > 0xffff ||
- dp->ioc_setupcnt > 3)
+ if (dp->ioc_setupcnt > 3)
return EINVAL;
error = smb_t2_init(t2p, SSTOCP(ssp), dp->ioc_setup[0], scred);
if (error)
[
Date Prev][
Date Next]
[
Thread Prev][
Thread Next]
[
Date Index][
Thread Index]