[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20190426144457.GH24576@8bytes.org>
Date: Fri, 26 Apr 2019 16:44:57 +0200
From: Joerg Roedel <joro@...tes.org>
To: "Gustavo A. R. Silva" <gustavo@...eddedor.com>
Cc: iommu@...ts.linux-foundation.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] iommu/dmar: Use struct_size() helper
On Thu, Apr 18, 2019 at 01:46:24PM -0500, Gustavo A. R. Silva wrote:
> Make use of the struct_size() helper instead of an open-coded version
> in order to avoid any potential type mistakes, in particular in the
> context in which this code is being used.
>
> So, replace code of the following form:
>
> size = sizeof(*info) + level * sizeof(info->path[0]);
>
> with:
>
> size = struct_size(info, path, level);
>
> Signed-off-by: Gustavo A. R. Silva <gustavo@...eddedor.com>
Applied, thanks.
Powered by blists - more mailing lists