Suppress gcc 4.6 warnings about unused variables.

git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@3350 d57e44dd-8a1f-0410-8b47-8ef2f437770f
This commit is contained in:
Bart Van Assche
2011-04-03 14:34:48 +00:00
parent a4b8c0ecc6
commit d1acc24bed
5 changed files with 22 additions and 17 deletions

View File

@@ -30,13 +30,9 @@ static u32 iscsid_pid;
static int event_recv_msg(struct sk_buff *skb, struct nlmsghdr *nlh)
{
u32 uid, pid, seq;
char *data;
u32 pid;
pid = NETLINK_CREDS(skb)->pid;
uid = NETLINK_CREDS(skb)->uid;
seq = nlh->nlmsg_seq;
data = NLMSG_DATA(nlh);
pid = NETLINK_CREDS(skb)->pid;
iscsid_pid = pid;

View File

@@ -121,7 +121,6 @@ int __add_target(struct iscsi_kern_target_info *info)
int err;
u32 tid = info->tid;
struct iscsi_target *target = NULL; /* to calm down sparse */
struct iscsi_kern_params_info *params_info;
struct iscsi_kern_attr *attr_info;
union add_info_union {
struct iscsi_kern_params_info params_info;
@@ -157,7 +156,6 @@ int __add_target(struct iscsi_kern_target_info *info)
err = -ENOMEM;
goto out;
}
params_info = (struct iscsi_kern_params_info *)add_info;
attr_info = (struct iscsi_kern_attr *)add_info;
if (tid == 0) {

View File

@@ -477,7 +477,7 @@ out:
static void login_start(struct connection *conn)
{
struct iscsi_login_req_hdr *req = (struct iscsi_login_req_hdr *)&conn->req.bhs;
char *name, *alias, *session_type, *target_name;
char *name, *session_type, *target_name;
conn->cid = be16_to_cpu(req->cid);
conn->sid.id64 = req->sid.id64;
@@ -495,7 +495,6 @@ static void login_start(struct connection *conn)
return;
}
alias = text_key_find(conn, "InitiatorAlias");
session_type = text_key_find(conn, "SessionType");
target_name = text_key_find(conn, "TargetName");

View File

@@ -760,7 +760,11 @@ static int recv_pdu(int fd, struct isns_io *rx, struct isns_hdr *hdr)
static char *print_scn_pdu(struct isns_hdr *hdr)
{
struct isns_tlv *tlv = (struct isns_tlv *)hdr->pdu;
uint16_t function, length, flags, transaction, sequence;
uint16_t function __attribute__((unused));
uint16_t length;
uint16_t flags __attribute__((unused));
uint16_t transaction __attribute__((unused));
uint16_t sequence __attribute__((unused));
char *name = NULL;
get_hdr_param(hdr, function, length, flags, transaction, sequence);
@@ -803,7 +807,10 @@ next:
static void qry_rsp_handle(struct isns_hdr *hdr)
{
struct isns_tlv *tlv;
uint16_t function, length, flags, transaction, sequence;
uint16_t function __attribute__((unused));
uint16_t flags __attribute__((unused));
uint16_t sequence __attribute__((unused));
uint16_t length, transaction;
uint32_t status = (uint32_t) (*hdr->pdu);
struct isns_qry_mgmt *mgmt, *n;
struct target *target;
@@ -899,8 +906,11 @@ int isns_handle(int is_timeout)
int err;
struct isns_io *rx = &isns_rx;
struct isns_hdr *hdr = (struct isns_hdr *)rx->buf;
uint32_t result;
uint16_t function, length, flags, transaction, sequence;
uint16_t function;
uint16_t length __attribute__((unused));
uint16_t flags __attribute__((unused));
uint16_t transaction __attribute__((unused));
uint16_t sequence __attribute__((unused));
char *name = NULL;
if (isns_server == NULL)
@@ -922,7 +932,6 @@ int isns_handle(int is_timeout)
}
get_hdr_param(hdr, function, length, flags, transaction, sequence);
result = ntohl((uint32_t) hdr->pdu[0]);
switch (function) {
case ISNS_FUNC_DEV_ATTR_REG_RSP:
@@ -1015,7 +1024,10 @@ int isns_scn_handle(int is_accept)
int err;
struct isns_io *rx = &scn_rx;
struct isns_hdr *hdr = (struct isns_hdr *)rx->buf;
uint16_t function, length, flags, transaction, sequence;
uint16_t function, transaction;
uint16_t length __attribute__((unused));
uint16_t flags __attribute__((unused));
uint16_t sequence __attribute__((unused));
char *name = NULL;
log_error("%s %d: %d", __func__, __LINE__, is_accept);

View File

@@ -897,7 +897,7 @@ static void dev_user_flush_dcache(struct scst_user_cmd *ucmd)
*/
for (i = 0; (bufflen > 0) && (i < buf_ucmd->num_data_pages); i++) {
struct page *page;
struct page *page __attribute__((unused));
page = buf_ucmd->data_pages[i];
#ifdef ARCH_HAS_FLUSH_ANON_PAGE
struct vm_area_struct *vma = find_vma(current->mm, start);