Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

staging: vt6655: Replace unused return value of vt6655_get_current_tsf

Replace unused return value with u64 to increase readability,
reduce address and dereference operators and omit pqwCurrTSF that
uses CamelCase which is not accepted by checkpatch.pl

Signed-off-by: Philipp Hortmann <philipp.g.hortmann@gmail.com>
Link: https://lore.kernel.org/r/62c83d78627196ec0ce2f5a562cb080a1c87a05a.1651435890.git.philipp.g.hortmann@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Philipp Hortmann and committed by
Greg Kroah-Hartman
60a16985 fed5b533

+10 -12
+8 -10
drivers/staging/vt6655/card.c
··· 288 288 u64 local_tsf; 289 289 u64 qwTSFOffset = 0; 290 290 291 - vt6655_get_current_tsf(priv, &local_tsf); 291 + local_tsf = vt6655_get_current_tsf(priv); 292 292 293 293 if (qwBSSTimestamp != local_tsf) { 294 294 qwTSFOffset = CARDqGetTSFOffset(byRxRate, qwBSSTimestamp, ··· 320 320 bool CARDbSetBeaconPeriod(struct vnt_private *priv, 321 321 unsigned short wBeaconInterval) 322 322 { 323 - u64 qwNextTBTT = 0; 323 + u64 qwNextTBTT; 324 324 325 - vt6655_get_current_tsf(priv, &qwNextTBTT); /* Get Local TSF counter */ 325 + qwNextTBTT = vt6655_get_current_tsf(priv); /* Get Local TSF counter */ 326 326 327 327 qwNextTBTT = CARDqGetNextTBTT(qwNextTBTT, wBeaconInterval); 328 328 ··· 739 739 * 740 740 * Return Value: true if success; otherwise false 741 741 */ 742 - bool vt6655_get_current_tsf(struct vnt_private *priv, u64 *pqwCurrTSF) 742 + u64 vt6655_get_current_tsf(struct vnt_private *priv) 743 743 { 744 744 void __iomem *iobase = priv->port_offset; 745 745 unsigned short ww; ··· 753 753 break; 754 754 } 755 755 if (ww == W_MAX_TIMEOUT) 756 - return false; 756 + return 0; 757 757 low = ioread32(iobase + MAC_REG_TSFCNTR); 758 758 high = ioread32(iobase + MAC_REG_TSFCNTR + 4); 759 - *pqwCurrTSF = le64_to_cpu(low + ((u64)high << 32)); 760 - 761 - return true; 759 + return le64_to_cpu(low + ((u64)high << 32)); 762 760 } 763 761 764 762 /* ··· 803 805 unsigned short wBeaconInterval) 804 806 { 805 807 void __iomem *iobase = priv->port_offset; 806 - u64 qwNextTBTT = 0; 808 + u64 qwNextTBTT; 807 809 808 - vt6655_get_current_tsf(priv, &qwNextTBTT); /* Get Local TSF counter */ 810 + qwNextTBTT = vt6655_get_current_tsf(priv); /* Get Local TSF counter */ 809 811 810 812 qwNextTBTT = CARDqGetNextTBTT(qwNextTBTT, wBeaconInterval); 811 813 /* Set NextTBTT */
+1 -1
drivers/staging/vt6655/card.h
··· 46 46 unsigned short wBeaconInterval); 47 47 void CARDvUpdateNextTBTT(struct vnt_private *priv, u64 qwTSF, 48 48 unsigned short wBeaconInterval); 49 - bool vt6655_get_current_tsf(struct vnt_private *priv, u64 *pqwCurrTSF); 49 + u64 vt6655_get_current_tsf(struct vnt_private *priv); 50 50 u64 CARDqGetNextTBTT(u64 qwTSF, unsigned short wBeaconInterval); 51 51 u64 CARDqGetTSFOffset(unsigned char byRxRate, u64 qwTSF1, u64 qwTSF2); 52 52 unsigned char CARDbyGetPktType(struct vnt_private *priv);
+1 -1
drivers/staging/vt6655/device_main.c
··· 1603 1603 struct vnt_private *priv = hw->priv; 1604 1604 u64 tsf; 1605 1605 1606 - vt6655_get_current_tsf(priv, &tsf); 1606 + tsf = vt6655_get_current_tsf(priv); 1607 1607 1608 1608 return tsf; 1609 1609 }