diff options
author | Takashi Iwai <tiwai@suse.de> | 2019-05-31 05:47:24 -0400 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2019-05-31 05:47:24 -0400 |
commit | e046b64b1547e2dc1ac27e0a5ac57e55213e16f1 (patch) | |
tree | 17eb0a12537a47384f5be4909a8b17e75bb9a18a | |
parent | a2d4560f0be9a48cd342992fbec0688ea05d564b (diff) |
ALSA: hda/ca0132: Use struct_size()
For code simplification and safety, use struct_size() macro for
calculating the dsp_image_seg object size.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
-rw-r--r-- | sound/pci/hda/patch_ca0132.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/sound/pci/hda/patch_ca0132.c b/sound/pci/hda/patch_ca0132.c index e1ebc6d5f382..de61179c91e2 100644 --- a/sound/pci/hda/patch_ca0132.c +++ b/sound/pci/hda/patch_ca0132.c | |||
@@ -2731,7 +2731,7 @@ static bool is_last(const struct dsp_image_seg *p) | |||
2731 | 2731 | ||
2732 | static size_t dsp_sizeof(const struct dsp_image_seg *p) | 2732 | static size_t dsp_sizeof(const struct dsp_image_seg *p) |
2733 | { | 2733 | { |
2734 | return sizeof(*p) + p->count*sizeof(u32); | 2734 | return struct_size(p, data, p->count); |
2735 | } | 2735 | } |
2736 | 2736 | ||
2737 | static const struct dsp_image_seg *get_next_seg_ptr( | 2737 | static const struct dsp_image_seg *get_next_seg_ptr( |