Re: [PATCH] clk: don't use __initconst for non-const arrays

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 12 September 2014 00:04, Uwe Kleine-König
<u.kleine-koenig@xxxxxxxxxxxxxx> wrote:
> Hello,
>
> On Thu, Sep 11, 2014 at 11:04:31PM +0200, Uwe Kleine-König wrote:
>>  /* Mux parent lists. */
>> -static const char *fin_pll_p[] __initconst = {
>> +static const char *fin_pll_p[] __initdata = {
>>       "xxti",
>>       "xusbxti"
>>  };
> As discussed with Tomasz on irc: The sad thing here is that for this
> array only 8 bytes are freed when .init.rodata is thrown away (that is
> two pointers). The actual data---5 + 8 bytes + maybe aligning---isn't
> freed though.
>
> We wondered if there is a nice and easy way to throw away the
> characters, too.
>
> The only way I currently see is:
>
>         const char xxti[] __initconst = "xxti";
>         ...
>
>         static const char *fin_pll_p[] __initdata = {
>                 xxti,
>                 ...
>         };
>
> but this definitively doesn't qualify as "nice and easy". Is there an
> alternative?
>

What about doing

static const char fin_pll_p[][8] __initconst = {
     "xxti",
     "xusbxti"
};
--
To unsubscribe from this list: send the line "unsubscribe linux-samsung-soc" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux SoC Development]     [Linux Rockchip Development]     [Linux USB Development]     [Video for Linux]     [Linux Audio Users]     [Linux SCSI]     [Yosemite News]

  Powered by Linux