From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from gate.crashing.org (gate.crashing.org [63.228.1.57]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTP id 9A695DDE11 for ; Wed, 1 Aug 2007 18:18:18 +1000 (EST) In-Reply-To: References: <00a85f152aa3547f0f0b4acd7954468a@kernel.crashing.org> <2055bb54b9816faaf5b2ceedc9cfa039@kernel.crashing.org> <87DC7695-382B-4641-B9D9-75ACB49D41A4@kernel.crashing.org> <719AE7E4-FE6D-4973-8887-F787EC8ABC85@kernel.crashing.org> <235e0ff22961e25016727c0e74fd0c0f@kernel.crashing.org> Mime-Version: 1.0 (Apple Message framework v623) Content-Type: text/plain; charset=US-ASCII; format=flowed Message-Id: <19a13f8700d078abc4cab0064a7d0183@kernel.crashing.org> From: Segher Boessenkool Subject: Re: [PATCH] powerpc: Add of_register_i2c_devices() Date: Wed, 1 Aug 2007 10:18:08 +0200 To: Guennadi Liakhovetski Cc: linuxppc-dev@ozlabs.org, Paul Mackerras List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , >>>>> + strncpy(info->driver_name, i2c_devices[i].i2c_driver, >>>>> KOBJ_NAME_LEN); >>>>> + strncpy(info->type, i2c_devices[i].i2c_type, I2C_NAME_SIZE); >>>> >>>> Why not just strcpy(), btw? >>> >>> Because target strings are finite length, and sources are just >>> pointers to >>> some constant strings, which one might make arbitrarily long. >> >> So it's no problem if the name or type string gets cut short? >> Just checking :-) > > Then it just won't match. strncpy() won't put a terminating zero on there, is everything that uses the resulting string okay with that? Also, if the name gets cut short, it might match some _other_ expected name. > Have I passed or failed?:-) Dunno, what is this test, anyway? :-) Segher