From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751603AbcF2Io7 (ORCPT ); Wed, 29 Jun 2016 04:44:59 -0400 Received: from mx2.suse.de ([195.135.220.15]:33909 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750921AbcF2Io4 (ORCPT ); Wed, 29 Jun 2016 04:44:56 -0400 From: Andreas Schwab To: Yury Norov Cc: , , , , , , , , , , , , , , , , , Andrew Pinski Subject: Re: [PATCH 16/23] [AARCH64] Make lp64 and ilp32 directories. References: <1467131978-669-1-git-send-email-ynorov@caviumnetworks.com> <1467131978-669-17-git-send-email-ynorov@caviumnetworks.com> X-Yow: --- I have seen the FUN --- Date: Wed, 29 Jun 2016 10:43:55 +0200 In-Reply-To: <1467131978-669-17-git-send-email-ynorov@caviumnetworks.com> (Yury Norov's message of "Tue, 28 Jun 2016 19:39:31 +0300") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Yury Norov writes: > diff --git a/sysdeps/unix/sysv/linux/aarch64/ilp32/getdents.c b/sysdeps/unix/sysv/linux/aarch64/ilp32/getdents.c > new file mode 100644 > index 0000000..1183f49 > --- /dev/null > +++ b/sysdeps/unix/sysv/linux/aarch64/ilp32/getdents.c > @@ -0,0 +1,77 @@ > +/* Copyright (C) 2007-2015 Free Software Foundation, Inc. > + This file is part of the GNU C Library. > + > + The GNU C Library is free software; you can redistribute it and/or > + modify it under the terms of the GNU Lesser General Public > + License as published by the Free Software Foundation; either > + version 2.1 of the License, or (at your option) any later version. > + > + The GNU C Library is distributed in the hope that it will be useful, > + but WITHOUT ANY WARRANTY; without even the implied warranty of > + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU > + Lesser General Public License for more details. > + > + You should have received a copy of the GNU Lesser General Public > + License along with the GNU C Library. If not, see > + . */ > + > +#include > +#include > +#include > +#include > +#include > +#include > +#include > + > +#include > +#include > +#include > + > +struct kernel_dirent64 > + { > + uint64_t d_ino; > + int64_t d_off; > + unsigned short int d_reclen; > + unsigned char d_type; > + char d_name[256]; > + }; > + > +static size_t conv (char *buf, size_t nbytes) > +{ > + char *end = buf + nbytes; > + struct dirent *u = (struct dirent *) buf; > + struct kernel_dirent64 *k = (struct kernel_dirent64 *) buf; > + size_t sizd = offsetof(struct kernel_dirent64, d_name) > + - offsetof(struct dirent, d_name); > + > + while ((char*) k < end) > + { > + struct kernel_dirent64 *nk = (char *) k + k->d_reclen; > + size_t name_len = k->d_reclen - offsetof(struct kernel_dirent64, d_name); > + > + u->d_ino = k->d_ino; > + u->d_off = k->d_off; > + u->d_reclen = k->d_reclen - sizd; > + u->d_type = k->d_type; > + memcpy (u->d_name, k->d_name, name_len); > + > + u = (char *) u + u->d_reclen; > + k = nk; > +} ../sysdeps/unix/sysv/linux/aarch64/ilp32/getdents.c: In function 'conv': ../sysdeps/unix/sysv/linux/aarch64/ilp32/getdents.c:49:36: error: initialization from incompatible pointer type [-Werror=incompatible-pointer-types] struct kernel_dirent64 *nk = (char *) k + k->d_reclen; ^ ../sysdeps/unix/sysv/linux/aarch64/ilp32/getdents.c:58:9: error: assignment from incompatible pointer type [-Werror=incompatible-pointer-types] u = (char *) u + u->d_reclen; ^ Andreas. -- Andreas Schwab, SUSE Labs, schwab@suse.de GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE 1748 E4D4 88E3 0EEA B9D7 "And now for something completely different."