Re: [PATCH] spc.c: fix compiler warnings

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



2012/4/2 FUJITA Tomonori <fujita.tomonori@xxxxxxxxxxxxx>:
> On Sun, 01 Apr 2012 21:12:58 +0200
> Arne Redlich <arne.redlich@xxxxxxxxxxxxxx> wrote:
>
>> gcc-4.6 points out a number of variables that are set but never
>> used - remove them.
>>
>> Signed-off-by: Arne Redlich <arne.redlich@xxxxxxxxxxxxxx>
>> ---
>>  usr/spc.c |   31 +++++--------------------------
>>  1 files changed, 5 insertions(+), 26 deletions(-)
>>
>> diff --git a/usr/spc.c b/usr/spc.c
>> index 44cd193..93aa062 100644
>> --- a/usr/spc.c
>> +++ b/usr/spc.c
>> @@ -262,7 +262,7 @@ int spc_report_luns(int host_no, struct scsi_cmd *cmd)
>>       struct scsi_lu *lu;
>>       struct list_head *dev_list = &cmd->c_target->device_list;
>>       uint64_t lun, *data;
>> -     int idx, alen, oalen, nr_luns;
>> +     int idx, alen, nr_luns;
>>       unsigned char key = ILLEGAL_REQUEST;
>>       uint16_t asc = ASC_INVALID_FIELD_IN_CDB;
>>       uint8_t *scb = cmd->scb;
>> @@ -279,8 +279,6 @@ int spc_report_luns(int host_no, struct scsi_cmd *cmd)
>>       memset(data, 0, alen);
>>
>>       alen &= ~(8 - 1);
>> -     oalen = alen;
>> -
>>       alen -= 8;
>>       idx = 1;
>>       nr_luns = 0;
>> @@ -720,7 +718,6 @@ static int report_opcodes_all(struct scsi_cmd *cmd, int rctd,
>>  int spc_report_supported_opcodes(int host_no, struct scsi_cmd *cmd)
>>  {
>>       uint8_t reporting_options;
>> -     uint8_t requested_opcode;
>>       uint16_t requested_service_action;
>>       uint32_t alloc_len;
>>       int rctd;
>> @@ -728,8 +725,6 @@ int spc_report_supported_opcodes(int host_no, struct scsi_cmd *cmd)
>>
>>       reporting_options = cmd->scb[2] & 0x07;
>>
>> -     requested_opcode = cmd->scb[3];
>> -
>>       requested_service_action = cmd->scb[4];
>>       requested_service_action <<= 8;
>>       requested_service_action |= cmd->scb[5];
>> @@ -1097,23 +1092,15 @@ static int spc_pr_reserve(int host_no, struct scsi_cmd *cmd)
>>       uint16_t asc = ASC_INVALID_FIELD_IN_CDB;
>>       uint8_t key = ILLEGAL_REQUEST;
>>       uint8_t pr_scope, pr_type;
>> -     uint8_t *buf;
>> -     uint64_t res_key, sa_res_key;
>> -     int ret;
>>       struct registration *reg, *holder;
>> +     int ret = check_pr_out_basic_parameter(cmd);
>
> Is this necessary? I prefer to declaring a valuable and initialization
> by a function separately.

That's just my preferred coding style that inadvertently slipped in.
Will you change it, or do you want me to respin the patch?

Cheers,
Arne
--
To unsubscribe from this list: send the line "unsubscribe stgt" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux SCSI]     [Linux RAID]     [Linux Clusters]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]

  Powered by Linux