From patchwork Sat Jul 7 23:22:38 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Rodrigo Siqueira X-Patchwork-Id: 10512969 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 0DBBF600CA for ; Sat, 7 Jul 2018 23:22:49 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id F2B71288E8 for ; Sat, 7 Jul 2018 23:22:48 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E5476288EC; Sat, 7 Jul 2018 23:22:48 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, FREEMAIL_FROM, MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id AB0F9288E8 for ; Sat, 7 Jul 2018 23:22:44 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 152306E34E; Sat, 7 Jul 2018 23:22:44 +0000 (UTC) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mail-qk0-x242.google.com (mail-qk0-x242.google.com [IPv6:2607:f8b0:400d:c09::242]) by gabe.freedesktop.org (Postfix) with ESMTPS id 947926E34E; Sat, 7 Jul 2018 23:22:42 +0000 (UTC) Received: by mail-qk0-x242.google.com with SMTP id z74-v6so8085580qkb.10; Sat, 07 Jul 2018 16:22:42 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:content-transfer-encoding :in-reply-to:user-agent; bh=ZBng66jhZ0cnAgkbXNq9qBbIoVZQIb1qhfjuW4mO6pM=; b=fjW2qCbtOyHL79uYwj+TFzcJHkhykNCsoBEv0o0JP9D1YS50xNnueKLeCjp0WK0uGX rG0gsdOvq1Z1P3d1c2NfmkMayS0EDE3S9FtKUogTaWoZ9P/0nCEtiYFr3rMWgtj0z/aE D1xLT+xUQNLOtYAN7U7nSqj+bnSJDPttizs8JV9+OZAg8F4fxT5JocwBW6yqyiWb3xBx PZ5CCh92fcIo7dzC/zpOhFRWOGEWmS4qWc6i8N3GVEKJSEcksgQc8i+mN8jlOus6wK89 iVOl1z2ETs4SlUuxE8ykP37tabT8YQdKClRNJcQc6eDVane9b1ajYVMKp1ElzLNb+sTd S6rA== X-Gm-Message-State: APt69E0Oueday4HGJlObXw0RgS3hSPxxMeJu0pWfd3Sxly3ql1vaQNeK OpjOC514J8Q7d9dvFXxYgV8= X-Google-Smtp-Source: AAOMgpdMHrPcPjFmQS+pm7wSuNsjvf4I3Q9sS+4Nd6KSE7rcuAvqyVbpu/75jSBC91hykAwfxSw1SA== X-Received: by 2002:a37:7185:: with SMTP id m127-v6mr13058103qkc.10.1531005761774; Sat, 07 Jul 2018 16:22:41 -0700 (PDT) Received: from smtp.gmail.com ([143.107.45.1]) by smtp.gmail.com with ESMTPSA id b62-v6sm9161112qkj.48.2018.07.07.16.22.39 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sat, 07 Jul 2018 16:22:41 -0700 (PDT) Date: Sat, 7 Jul 2018 20:22:38 -0300 From: Rodrigo Siqueira To: Petri Latvala , Arkadiusz Hiler Message-ID: References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: User-Agent: NeoMutt/20180622 Subject: [Intel-gfx] [PATCH i-g-t 2/7] Cast void * pointer used in arithmetic to uint32_t* X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: igt-dev@lists.freedesktop.org, intel-gfx@lists.freedesktop.org Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" X-Virus-Scanned: ClamAV using ClamSMTP This commit fixes the GCC warning: warning: pointer of type ‘void *’ used in arithmetic [-Wpointer-arith] memset(ptr + offsets[0], full_range ? 0x00 : 0x10, ^ warning: pointer of type ‘void *’ used in arithmetic [-Wpointer-arith] memset(ptr + offsets[1], 0x80, This commit cast the ptr pointer, which is a void *, to uint32_t * in the pointer arithmetic operation. Signed-off-by: Rodrigo Siqueira --- lib/igt_fb.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/igt_fb.c b/lib/igt_fb.c index ae71d967..ca905038 100644 --- a/lib/igt_fb.c +++ b/lib/igt_fb.c @@ -410,9 +410,11 @@ static int create_bo_for_fb(int fd, int width, int height, switch (format->drm_id) { case DRM_FORMAT_NV12: - memset(ptr + offsets[0], full_range ? 0x00 : 0x10, + memset(((uint32_t *)ptr) + offsets[0], + full_range ? 0x00 : 0x10, calculated_stride * height); - memset(ptr + offsets[1], 0x80, + memset(((uint32_t *)ptr) + offsets[1], + 0x80, calculated_stride * height/2); break; case DRM_FORMAT_YUYV: