Commit 5030c807907ae90ad21e9220c1a9d592558deba2

Authored by Stefan Richter
1 parent 0fcff4e393

ieee1394: remove unused variables

which caused gcc 4.6 to warn about
    variable 'XYZ' set but not used.

sbp2.c, unit_characteristics:

The underlying problem which was spotted here --- an incomplete
implementation --- is already 50% fixed in drivers/firewire/sbp2.c which
observes mgt_ORB_timeout but not yet ORB_size.

raw1394.c, length_conflict; dv1394.c, ts_off:

Impossible to tell why these variables are there.  We can safely remove
them though because we don't need a compiler warning to realize that we
are dealing with (at least stylistically) flawed code here.

dv1394.c, packet_time:

This was used in debug macro that is only compiled in with
DV1394_DEBUG_LEVEL >= 2 defined at compile-time.  Just drop it since
nobody debugs dv1394 anymore.  Avoids noise in regular kernel builds.

dv1394.c, ohci; eth1394.c, priv:

These variables clearly can go away.  Somebody wanted to use them but
then didn't (or not anymore).

Note, all of this code is considered to be at its end of life and is
thus not really meant to receive janitorial updates anymore.  But if we
can easily remove noisy warnings from kernel builds, we should.

Reported-by: Justin P. Mattock <justinmattock@gmail.com>
Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>

Showing 4 changed files with 7 additions and 24 deletions Side-by-side Diff

drivers/ieee1394/dv1394.c
... ... @@ -610,7 +610,7 @@
610 610 } else {
611 611  
612 612 u32 transmit_sec, transmit_cyc;
613   - u32 ts_cyc, ts_off;
  613 + u32 ts_cyc;
614 614  
615 615 /* DMA is stopped, so this is the very first frame */
616 616 video->active_frame = this_frame;
... ... @@ -636,7 +636,6 @@
636 636 transmit_sec += transmit_cyc/8000;
637 637 transmit_cyc %= 8000;
638 638  
639   - ts_off = ct_off;
640 639 ts_cyc = transmit_cyc + 3;
641 640 ts_cyc %= 8000;
642 641  
... ... @@ -2004,7 +2003,7 @@
2004 2003  
2005 2004 int sof=0; /* start-of-frame flag */
2006 2005 struct frame *f;
2007   - u16 packet_length, packet_time;
  2006 + u16 packet_length;
2008 2007 int i, dbc=0;
2009 2008 struct DMA_descriptor_block *block = NULL;
2010 2009 u16 xferstatus;
2011 2010  
... ... @@ -2024,12 +2023,7 @@
2024 2023 sizeof(struct packet));
2025 2024  
2026 2025 packet_length = le16_to_cpu(p->data_length);
2027   - packet_time = le16_to_cpu(p->timestamp);
2028 2026  
2029   - irq_printk("received packet %02d, timestamp=%04x, length=%04x, sof=%02x%02x\n", video->current_packet,
2030   - packet_time, packet_length,
2031   - p->data[0], p->data[1]);
2032   -
2033 2027 /* get the descriptor based on packet_buffer cursor */
2034 2028 f = video->frames[video->current_packet / MAX_PACKETS];
2035 2029 block = &(f->descriptor_pool[video->current_packet % MAX_PACKETS]);
2036 2030  
... ... @@ -2320,16 +2314,12 @@
2320 2314  
2321 2315 static void dv1394_host_reset(struct hpsb_host *host)
2322 2316 {
2323   - struct ti_ohci *ohci;
2324 2317 struct video_card *video = NULL, *tmp_vid;
2325 2318 unsigned long flags;
2326 2319  
2327 2320 /* We only work with the OHCI-1394 driver */
2328 2321 if (strcmp(host->driver->name, OHCI1394_DRIVER_NAME))
2329 2322 return;
2330   -
2331   - ohci = (struct ti_ohci *)host->hostdata;
2332   -
2333 2323  
2334 2324 /* find the corresponding video_cards */
2335 2325 spin_lock_irqsave(&dv1394_cards_lock, flags);
drivers/ieee1394/eth1394.c
... ... @@ -1258,7 +1258,6 @@
1258 1258 char *buf;
1259 1259 struct eth1394_host_info *hi;
1260 1260 struct net_device *dev;
1261   - struct eth1394_priv *priv;
1262 1261 unsigned int len;
1263 1262 u32 specifier_id;
1264 1263 u16 source_id;
... ... @@ -1287,8 +1286,6 @@
1287 1286 specifier_id = (be32_to_cpu(data[0]) & 0xffff) << 8 |
1288 1287 (be32_to_cpu(data[1]) & 0xff000000) >> 24;
1289 1288 source_id = be32_to_cpu(data[0]) >> 16;
1290   -
1291   - priv = netdev_priv(dev);
1292 1289  
1293 1290 if (info->channel != (iso->host->csr.broadcast_channel & 0x3f)
1294 1291 || specifier_id != ETHER1394_GASP_SPECIFIER_ID) {
drivers/ieee1394/raw1394.c
... ... @@ -1015,7 +1015,7 @@
1015 1015 struct arm_addr *arm_addr = NULL;
1016 1016 struct arm_request *arm_req = NULL;
1017 1017 struct arm_response *arm_resp = NULL;
1018   - int found = 0, size = 0, rcode = -1, length_conflict = 0;
  1018 + int found = 0, size = 0, rcode = -1;
1019 1019 struct arm_request_response *arm_req_resp = NULL;
1020 1020  
1021 1021 DBGMSG("arm_write called by node: %X "
... ... @@ -1054,7 +1054,6 @@
1054 1054 }
1055 1055 if (arm_addr->rec_length < length) {
1056 1056 DBGMSG("arm_write blocklength too big -> rcode_data_error");
1057   - length_conflict = 1;
1058 1057 rcode = RCODE_DATA_ERROR; /* hardware error, data is unavailable */
1059 1058 }
1060 1059 if (rcode == -1) {
drivers/ieee1394/sbp2.c
... ... @@ -1351,12 +1351,11 @@
1351 1351 struct csr1212_keyval *kv;
1352 1352 struct csr1212_dentry *dentry;
1353 1353 u64 management_agent_addr;
1354   - u32 unit_characteristics, firmware_revision, model;
  1354 + u32 firmware_revision, model;
1355 1355 unsigned workarounds;
1356 1356 int i;
1357 1357  
1358 1358 management_agent_addr = 0;
1359   - unit_characteristics = 0;
1360 1359 firmware_revision = SBP2_ROM_VALUE_MISSING;
1361 1360 model = ud->flags & UNIT_DIRECTORY_MODEL_ID ?
1362 1361 ud->model_id : SBP2_ROM_VALUE_MISSING;
1363 1362  
... ... @@ -1373,17 +1372,15 @@
1373 1372 lu->lun = ORB_SET_LUN(kv->value.immediate);
1374 1373 break;
1375 1374  
1376   - case SBP2_UNIT_CHARACTERISTICS_KEY:
1377   - /* FIXME: This is ignored so far.
1378   - * See SBP-2 clause 7.4.8. */
1379   - unit_characteristics = kv->value.immediate;
1380   - break;
1381 1375  
1382 1376 case SBP2_FIRMWARE_REVISION_KEY:
1383 1377 firmware_revision = kv->value.immediate;
1384 1378 break;
1385 1379  
1386 1380 default:
  1381 + /* FIXME: Check for SBP2_UNIT_CHARACTERISTICS_KEY
  1382 + * mgt_ORB_timeout and ORB_size, SBP-2 clause 7.4.8. */
  1383 +
1387 1384 /* FIXME: Check for SBP2_DEVICE_TYPE_AND_LUN_KEY.
1388 1385 * Its "ordered" bit has consequences for command ORB
1389 1386 * list handling. See SBP-2 clauses 4.6, 7.4.11, 10.2 */