diff options
author | Daeseok Youn <daeseok.youn@gmail.com> | 2014-03-14 18:08:43 +0900 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2014-03-17 14:22:47 -0700 |
commit | 5ddd113297288d521faeb551ea575513dfb37828 (patch) | |
tree | d25ff9db8647d9a2d7217819203736f71133c6d4 /drivers/staging/cxt1e1 | |
parent | 14eec444302c97a692a9cdc556f7590355610f92 (diff) |
staging: cxt1e1: remove redundant memset() call
The banner array doens't need to set to 0.
sprintf() adds a terminating '\0'.
And the sn array can be declared and initialized to zero.
So remove redundant memset() with zero.
Remove unnecessary cast for memcpy().
Signed-off-by: Daeseok Youn <daeseok.youn@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/cxt1e1')
-rw-r--r-- | drivers/staging/cxt1e1/hwprobe.c | 12 |
1 files changed, 3 insertions, 9 deletions
diff --git a/drivers/staging/cxt1e1/hwprobe.c b/drivers/staging/cxt1e1/hwprobe.c index d87a011360bd..d41fb79e3304 100644 --- a/drivers/staging/cxt1e1/hwprobe.c +++ b/drivers/staging/cxt1e1/hwprobe.c @@ -51,22 +51,16 @@ show_two(hdw_info_t *hi, int brdno) struct pci_dev *pdev; char *bid; char banner[80]; - char sn[6]; - - /* clear print buffer */ - memset(banner, 0, 80); + char sn[6] = {0,}; ci = (ci_t *)(netdev_priv(hi->ndev)); bid = sbeid_get_bdname(ci); switch (hi->promfmt) { case PROM_FORMAT_TYPE1: - memcpy(sn, (FLD_TYPE1 *)(hi->mfg_info.pft1.Serial), 6); + memcpy(sn, hi->mfg_info.pft1.Serial, 6); break; case PROM_FORMAT_TYPE2: - memcpy(sn, (FLD_TYPE2 *)(hi->mfg_info.pft2.Serial), 6); - break; - default: - memset(sn, 0, 6); + memcpy(sn, hi->mfg_info.pft2.Serial, 6); break; } |