Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1237698 > unrolled thread
| Started by | Rasmus Villemoes <linux@rasmusvillemoes.dk> |
|---|---|
| First post | 2015-10-01 22:00 +0200 |
| Last post | 2015-10-02 09:10 +0200 |
| Articles | 2 — 2 participants |
Back to article view | Back to linux.kernel
[PATCH] [SCSI] fnic: use kzalloc in fnic_fcoe_process_vlan_resp Rasmus Villemoes <linux@rasmusvillemoes.dk> - 2015-10-01 22:00 +0200
Re: [PATCH] [SCSI] fnic: use kzalloc in fnic_fcoe_process_vlan_resp Johannes Thumshirn <jthumshirn@suse.de> - 2015-10-02 09:10 +0200
| From | Rasmus Villemoes <linux@rasmusvillemoes.dk> |
|---|---|
| Date | 2015-10-01 22:00 +0200 |
| Subject | [PATCH] [SCSI] fnic: use kzalloc in fnic_fcoe_process_vlan_resp |
| Message-ID | <qeSbg-61i-13@gated-at.bofh.it> |
This saves a little .text and avoids the sizeof(...) style
inconsistency.
Signed-off-by: Rasmus Villemoes <linux@rasmusvillemoes.dk>
---
drivers/scsi/fnic/fnic_fcs.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/drivers/scsi/fnic/fnic_fcs.c b/drivers/scsi/fnic/fnic_fcs.c
index bf0bbd42efb5..2d013076bfba 100644
--- a/drivers/scsi/fnic/fnic_fcs.c
+++ b/drivers/scsi/fnic/fnic_fcs.c
@@ -415,15 +415,13 @@ static void fnic_fcoe_process_vlan_resp(struct fnic *fnic, struct sk_buff *skb)
vid = ntohs(((struct fip_vlan_desc *)desc)->fd_vlan);
shost_printk(KERN_INFO, fnic->lport->host,
"process_vlan_resp: FIP VLAN %d\n", vid);
- vlan = kmalloc(sizeof(*vlan),
- GFP_ATOMIC);
+ vlan = kzalloc(sizeof(*vlan), GFP_ATOMIC);
if (!vlan) {
/* retry from timer */
spin_unlock_irqrestore(&fnic->vlans_lock,
flags);
goto out;
}
- memset(vlan, 0, sizeof(struct fcoe_vlan));
vlan->vid = vid & 0x0fff;
vlan->state = FIP_VLAN_AVAIL;
list_add_tail(&vlan->list, &fnic->vlans);
--
2.1.3
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
[toc] | [next] | [standalone]
| From | Johannes Thumshirn <jthumshirn@suse.de> |
|---|---|
| Date | 2015-10-02 09:10 +0200 |
| Message-ID | <qf2DE-4Dq-27@gated-at.bofh.it> |
| In reply to | #1237698 |
Rasmus Villemoes <linux@rasmusvillemoes.dk> writes:
> This saves a little .text and avoids the sizeof(...) style
> inconsistency.
>
> Signed-off-by: Rasmus Villemoes <linux@rasmusvillemoes.dk>
> ---
> drivers/scsi/fnic/fnic_fcs.c | 4 +---
> 1 file changed, 1 insertion(+), 3 deletions(-)
>
> diff --git a/drivers/scsi/fnic/fnic_fcs.c b/drivers/scsi/fnic/fnic_fcs.c
> index bf0bbd42efb5..2d013076bfba 100644
> --- a/drivers/scsi/fnic/fnic_fcs.c
> +++ b/drivers/scsi/fnic/fnic_fcs.c
> @@ -415,15 +415,13 @@ static void fnic_fcoe_process_vlan_resp(struct fnic *fnic, struct sk_buff *skb)
> vid = ntohs(((struct fip_vlan_desc *)desc)->fd_vlan);
> shost_printk(KERN_INFO, fnic->lport->host,
> "process_vlan_resp: FIP VLAN %d\n", vid);
> - vlan = kmalloc(sizeof(*vlan),
> - GFP_ATOMIC);
> + vlan = kzalloc(sizeof(*vlan), GFP_ATOMIC);
> if (!vlan) {
> /* retry from timer */
> spin_unlock_irqrestore(&fnic->vlans_lock,
> flags);
> goto out;
> }
> - memset(vlan, 0, sizeof(struct fcoe_vlan));
> vlan->vid = vid & 0x0fff;
> vlan->state = FIP_VLAN_AVAIL;
> list_add_tail(&vlan->list, &fnic->vlans);
Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>
--
Johannes Thumshirn Storage
jthumshirn@suse.de +49 911 74053 689
SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg
GF: Felix Imendörffer, Jane Smithard, Graham Norton
HRB 21284 (AG Nürnberg)
Key fingerprint = EC38 9CAB C2C4 F25D 8600 D0D0 0393 969D 2D76 0850
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
[toc] | [prev] | [standalone]
Back to top | Article view | linux.kernel
csiph-web