Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S965214AbbLHPyb (ORCPT ); Tue, 8 Dec 2015 10:54:31 -0500 Received: from mail-db3on0064.outbound.protection.outlook.com ([157.55.234.64]:56976 "EHLO emea01-db3-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S965137AbbLHPya convert rfc822-to-8bit (ORCPT ); Tue, 8 Dec 2015 10:54:30 -0500 From: Noam Camus To: Arnd Bergmann , "David S. Miller" CC: Tal Zilcer , "netdev@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "linux-arm-kernel@lists.infradead.org" Subject: RE: [PATCH] net: ezchip: fix address space confusion in nps_enet.c Thread-Topic: [PATCH] net: ezchip: fix address space confusion in nps_enet.c Thread-Index: AQHRMc0w0TbevruPw0uQWVx3XwNzQZ7BPE5g Date: Tue, 8 Dec 2015 15:54:26 +0000 Message-ID: References: <33732958.3idC7H2UPT@wuerfel> In-Reply-To: <33732958.3idC7H2UPT@wuerfel> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: spf=none (sender IP is ) smtp.mailfrom=noamc@ezchip.com; x-originating-ip: [212.179.42.66] x-microsoft-exchange-diagnostics: 1;DB5PR02MB1144;5:AmRXzGCytaBSwWeozvQu662FzKdfcHnTDs6HSQfYU0dtSsL6jsNshHabQ65yKXTdeFsoRnWFiKKkpPQ3ccPToGD1in+PBJB/BtWSzwdUJbB36fhYv02kxioEqxCV+EjeNs/FuLMeKApG1HxMJRTwbw==;24:yzwIre6E9boR1KFwm2EgKekcjN7xdNH3G7qu0F3jHdtrbH769m/REB953OlCrBMc6ENbC6ysil1msPfNB0e6oGpguBvfdxvkayIGWAesLpo= x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:DB5PR02MB1144; x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(121898900299872); x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(601004)(2401047)(5005006)(520078)(8121501046)(3002001)(10201501046);SRVR:DB5PR02MB1144;BCL:0;PCL:0;RULEID:;SRVR:DB5PR02MB1144; x-forefront-prvs: 0784C803FD x-forefront-antispam-report: SFV:NSPM;SFS:(10009020)(6009001)(377454003)(189002)(199003)(1220700001)(1096002)(6116002)(76576001)(189998001)(92566002)(3846002)(33656002)(586003)(102836003)(74316001)(5003600100002)(5002640100001)(106116001)(106356001)(105586002)(40100003)(77096005)(2950100001)(2900100001)(122556002)(86362001)(5004730100002)(66066001)(97736004)(5001770100001)(5001960100002)(81156007)(54356999)(76176999)(50986999)(19580395003)(19580405001)(87936001)(101416001)(10400500002)(5008740100001);DIR:OUT;SFP:1101;SCL:1;SRVR:DB5PR02MB1144;H:DB5PR02MB1141.eurprd02.prod.outlook.com;FPR:;SPF:None;PTR:InfoNoRecords;MX:1;A:1;LANG:en; spamdiagnosticoutput: 1:23 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 8BIT MIME-Version: 1.0 X-MS-Exchange-CrossTenant-originalarrivaltime: 08 Dec 2015 15:54:26.9920 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 0fc16e0a-3cd3-4092-8b2f-0a42cff122c3 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB5PR02MB1144 X-Microsoft-Exchange-Diagnostics: 1;DB5PR02MB0648;2:g+iijA6/8/aCL60oXUoReO/CdQ0fjCoOvy/M1MQukMTW631yZX7y/1TP17JZk720R6ncbgdaEf599LaN+Ml/SPXly5V5mgw2BuqIFZdavMr4pLGbWEwtQ917rsjvGwCuohFpTrD78JIDIbgCkMComg==;23:voq8zHe6SS9Bsrtd4e35UgHtcbxXlHkfVVunz+u+hOZVfoX1yylAhDMXyfssipceDl4NiViD7eQ3T4PfllIQb6qgFJMhvtVjSg4KzN+/gckd47L2OaaDTbr05UtL+lyacTq+zDM1VUIwZ8G70Kg/IivxvWwpbLL2y3K2SPbyeRRXU09EO1wqvYgP5vteKVy2 X-OriginatorOrg: ezchip.com Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1780 Lines: 36 >From: Arnd Bergmann [mailto:arnd@arndb.de] >Sent: Tuesday, December 08, 2015 5:29 PM >To: David S. Miller >Cc: Noam Camus; Tal Zilcer; netdev@vger.kernel.org; linux-kernel@vger.kernel.org; linux-arm-kernel@lists.infradead.org >Subject: [PATCH] net: ezchip: fix address space confusion in nps_enet.c >The nps_enet driver happily mixes virtual, physical and __iomem addresses, which are all different depending on the architecture and configuration. That causes a warning when building the code on ARM with LPAE mode enabled: >drivers/net/ethernet/ezchip/nps_enet.c: In function 'nps_enet_send_frame': >drivers/net/ethernet/ezchip/nps_enet.c:370:13: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast] >but will also fail to work for other reasons. >In this patch, I'm trying to change the code to use only normal kernel pointers, which I assume is what the author actually meant: >* For reading or writing a 32-bit word that may be unaligned when > an SKB contains unaligned data, I'm using get_unaligned/put_unaligned() > rather than memcpy_fromio/toio. >* For converting a u8 pointer to a u32 pointer, I use a cast rather > than the incorrect virt_to_phys. >* For copying a couple of bytes from one place to another while respecting > alignment, I use memcpy instead of memcpy_toio. >Signed-off-by: Arnd Bergmann I have tested it on my simulator environment and driver compiles cleanly and runs happily without any problem. Thank you. Acked-by Noam Camus -- 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/